Two Timin': Repairing Smart Contracts With A Two-Layered Approach

09/14/2023
by   Abhinav Jain, et al.
0

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, reduced the overall vulnerability count by 97.5 repaired contracts shows that all retain functionality, indicating that the proposed method is appropriate for automatic batch classification and repair of vulnerabilities in smart contracts.

READ FULL TEXT
research
12/14/2022

Vulnerability Analysis of Smart Contracts

Blockchain platforms and smart contracts are vulnerable to security brea...
research
12/20/2022

AutoMESC: Automatic Framework for Mining and Classifying Ethereum Smart Contract Vulnerabilities and Their Fixes

Due to the risks associated with vulnerabilities in smart contracts, the...
research
09/11/2023

When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We?

With the development of blockchain technology, smart contracts have beco...
research
12/12/2019

Smart Contract Repair

Smart contracts are automated or self-enforcing contracts that can be us...
research
09/18/2023

Efficient Avoidance of Vulnerabilities in Auto-completed Smart Contract Code Using Vulnerability-constrained Decoding

Auto-completing code enables developers to speed up coding significantly...
research
06/25/2021

Vulnerability and Transaction behavior based detection of Malicious Smart Contracts

Smart Contracts (SCs) in Ethereum can automate tasks and provide differe...

Please sign up or login with your details

Forgot password? Click here to reset