Search papers, labs, and topics across Lattice.
This paper introduces a Tree-of-Thought framework designed to enhance the accuracy of smart contract repair by addressing the limitations of traditional linear reasoning methods. By integrating document parsing, static analysis, and a multi-path exploration of repair options, the framework significantly reduces error propagation and improves the reliability of patches. Testing on 50 real vulnerabilities demonstrates a 62% single success rate and an 84% top-3 success rate, marking substantial improvements over existing methods like ContractTinker.
A novel Tree-of-Thought framework achieves a 62% success rate in repairing smart contracts, significantly outpacing traditional linear methods.
Smart contracts power blockchain applications such as DeFi and NFTs. However, once deployed, they cannot be modified. Even minor bugs can result in significant financial losses. Current AI-based repair methods rely on linear reasoning, which leads to the accumulation of errors and unreliable patches. Our method combines document parsing, static analysis, and Tree of Thoughts reasoning. We first convert audit reports into structured data. Then we use Slither to locate the exact vulnerable code. Our three-step framework explores multiple repair paths simultaneously, evaluates options, and eliminates poor choices. Finally, we verify patches through compilation and manual checks. We test our method on 50 real vulnerabilities from Code4Rena. Our method achieves a 62% single success rate and an 84% top-3 success rate, outperforming ContractTinker by 12 and 6 percentage points, respectively. We also increase the proportion of fully effective patches to 44%, while reducing defective patches from 38% to 22% and invalid patches from 10% to 4%. This approach overcomes the limitations of linear reasoning and makes smart contract repair more accurate and practical.