Answers are grounded in this paper and cite their sources.
Smart contracts have been widely used on blockchain to automate financial and business transactions. While they are susceptible to attacks because of their involvement in operations like asset transfers. Researchers have suggested various methods to address vulnerabilities in these contracts and improve their reliability. Nevertheless, when the contract code is excessively lengthy, redundant contextual information may adversely affect repair performance. To address this problem, we propose a localizable machine learning model to repair long contracts. Firstly, we extract a data collection that includes code structure information from the abstract syntax tree of the smart contract source code. Then we leverage a pre-trained BERT model to generate code embeddings and use BiLSTM for training the vulnerability localization model. Finally, the vulnerable code lines in the contract are localized based on statistical thresholding of the model’s output values. On this basis, we construct the corresponding code extraction algorithms to generate code repair fragments and use machine learning techniques to repair contracts. We compare our method with existing approaches using public datasets. The results demonstrate a significant improvement in performance over direct repair methods, effectively addressing the challenges associated with the repair of long-code smart contracts.
No takes yet. Share an insight, caveat, or question.
Yu et al. (2025) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: