SmartLLM: Smart Contract Auditing using Custom Generative AI
Authors:
- Pujianto YugopuspitoPYPujianto Yugopuspito
Preprint
Abstract
Smart contracts are essential to decentralized finance (DeFi) and blockchain ecosystems but are increasingly vulnerable to exploits due to coding errors and complex attack vectors. Traditional static analysis tools and existing vulnerability detection methods often fail to address these challenges comprehensively, leading to high false-positive rates and an inability to detect dynamic vulnerabilities. This paper introduces SmartLLM, a novel approach leveraging fine-tuned LLaMA 3.1 models with Retrieval-Augmented Generation (RAG) to enhance the accuracy and efficiency of smart contract auditing. By integrating domain-specific knowledge from ERC standards and employing advanced techniques such as QLoRA for efficient fine-tuning, SmartLLM achieves superior performance compared to static analysis tools like Mythril and Slither, as well as zero-shot large language model (LLM) prompting methods such as GPT-3.5 and GPT-4. Experimental results demonstrate a perfect recall of 100% and an accuracy score of 70%, highlighting the model's robustness in identifying vulnerabilities, including reentrancy and access control issues. This research advances smart contract security by offering a scalable and effective auditing solution, supporting the secure adoption of decentralized applications.Keywords
All Related Versions
This publication has 13 references indexed in Scilit:
- The Faiss LibraryIEEE Transactions on Big Data, 2025
- Large Language Model-Powered Smart Contract Vulnerability Detection: New Perspectives2023
- Generative AIBusiness & Information Systems Engineering, 2023
- SoK: Decentralized Finance (DeFi) Attacks2023
- Demystifying Exploitable Bugs in Smart Contracts2023
- AChecker: Statically Detecting Smart Contract Access Control Vulnerabilities2023
- Parameter-efficient fine-tuning of large-scale pre-trained language modelsNature Machine Intelligence, 2023
- Smart Contract Vulnerability Analysis and Security AuditIEEE Network, 2020
- Empirical review of automated analysis tools on 47,587 Ethereum smart contracts2020
- Slither: A Static Analysis Framework for Smart Contracts2019