Two Timin': Repairing Smart Contracts With A Two-Layered Approach
Abhinav Jain, Ehan Masud, Michelle Han, Rohan Dhillon, Sumukh Rao,, Arya Joshi, Salar Cheema, Saurav Kumar

TL;DR
This paper introduces a two-layered framework combining classification and repair of smart contracts using machine learning models, significantly reducing vulnerabilities while maintaining contract functionality.
Contribution
It presents a novel two-layered approach integrating vulnerability classification and automated repair using LLMs and RFCs, improving smart contract security.
Findings
Reduced vulnerabilities by 97.5% with GPT-3.5-Turbo
Reduced vulnerabilities by 96.7% with Llama-2-7B
Repaired contracts retain full functionality
Abstract
Due to the modern relevance of blockchain technology, smart contracts present both substantial risks and benefits. Vulnerabilities within them can trigger a cascade of consequences, resulting in significant losses. Many current papers primarily focus on classifying smart contracts for malicious intent, often relying on limited contract characteristics, such as bytecode or opcode. This paper proposes a novel, two-layered framework: 1) classifying and 2) directly repairing malicious contracts. Slither's vulnerability report is combined with source code and passed through a pre-trained RandomForestClassifier (RFC) and Large Language Models (LLMs), classifying and repairing each suggested vulnerability. Experiments demonstrate the effectiveness of fine-tuned and prompt-engineered LLMs. The smart contract repair models, built from pre-trained GPT-3.5-Turbo and fine-tuned Llama-2-7B models,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsBlockchain Technology Applications and Security · Cryptography and Data Security · Internet Traffic Analysis and Secure E-voting
MethodsMulti-Head Attention · 15 Ways to Contact How can i speak to someone at Delta Airlines · Attention Is All You Need · Repair · Cosine Annealing · Linear Layer · Softmax · {Dispute@FaQ-s}How to file a dispute with Expedia? · Linear Warmup With Cosine Annealing · Dense Connections
