Papers1 provider Ā· 1 record
August 1, 2025Ā· 2025 11th IEEE International Conference on Privacy Computing and Data Security (PCDS)
conference-paper

LogicRepair: An Empirical Study on Automated Repair of Smart Contract Logic Vulnerabilities Based on Large Language Models

Authors:Mingchao AiKai WangHe WangChen ZhengYuqing Zhang

Abstract

Blockchain technology has exploded in popularity, providing robust technical support for decentralized finance (DeFi) and other domains. However, logical vulnerabilities in smart contracts can lead to serious security issues and economic losses. Traditional repair tools often fail to handle these logic flaws effectively. To address this issue, our study proposes an automated repair framework for smart contract logic vulnerabilities, which takes advantage of large language models (LLM) to improve repair effectiveness. First, we perform a static analysis to retrieve essential information about the vulnerable function. This information, along with predefined vulnerability scenarios and repair suggestions, prepares to generate accurate patches. Secondly, the chain-of-thought (CoT) strategy is used to decompose complex repair tasks, and the LLM is gradually guided to generate patches to reduce the probability of generating incorrect patches. Finally, the generated patch code is verified through multiple rounds of iterative verification through a multi-agent dialectical mechanism to ensure the effectiveness and reliability of the patch code. We conducted an empirical study, and the results showed that the framework can effectively repair smart contract logic vulnerabilities. Among 39 vulnerable contracts in the real world, 36 were successfully repaired, with a successful repair rate of$\mathbf{9 2. 3 \%}$. Experimental statistics show that the relevant large model call cost and reasoning efficiency are at an ideal level. The average repair time for each vulnerability is 69.42 s. The research results of this paper prove the effectiveness and reliability of the LLM-based method in repairing smart contract logic vulnerabilities, and have broad application prospects.

Community

0 comments
Use Connect Wallet in the navigation

No discussion yet

Be the first to share a question or observation.