paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SCPatcher: Automated Smart Contract Code Repair via Retrieval-Augmented Generation and Knowledge Graph

SCPatcher:基于检索增强生成与知识图谱的智能合约代码自动修复
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 3/10 · 该论文将 LLM 作为工具用于智能合约漏洞修复(RAG+知识图谱),属于 LLM for SE/程序修复方向;但用户核心关注的是静态分析、形式化验证、浮点程序分析与贝叶斯程序分析及其与 LLM 的交叉,本文既未涉及静态分析或验证技术,也未触及浮点/贝叶斯等具体领域,仅在'LLM 作为工具处理程序'层面有弱关联。引用 5 inbox
Xiaoqi Li, Shipeng Ye, Wenkai Li, Zongwei Li
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:结合知识图谱与检索增强生成,用知识引导加思维链的两阶段策略实现智能合约漏洞自动修补。

智能合约部署后代码不可更改,漏洞往往造成重大经济损失,而现有工具只能检测漏洞、无法有效修复。本文提出 SCPatcher 框架,将检索增强生成(RAG)与知识图谱结合用于智能合约自动修复。作者从 5,000 个已验证的以太坊合约中抽取函数级关系,构建语义网络作为外部知识库,用以增强大语言模型的推理能力并支持精确的漏洞修补。修复过程采用两阶段策略:先进行知识引导的初步修复,再针对复杂漏洞引入思维链(Chain-of-Thought)推理。在一组多样化的含漏洞合约上评估,SCPatcher 达到 81.5% 的整体修复率与 91.0% 的编译通过率,显著优于现有方法。

问题
智能合约一经部署便不可修改,漏洞会带来严重资金损失,而已有工具只能检测漏洞,无法有效地自动修复它们。
方法
从 5,000 个已验证以太坊合约中提取函数级关系构建知识图谱作为外部知识库,结合检索增强生成提升大语言模型推理能力,并采用“知识引导初步修复 + 思维链推理处理复杂漏洞”的两阶段修复策略。
评估
在多样化的含漏洞智能合约集合上进行实验,SCPatcher 取得 81.5% 的整体修复率与 91.0% 的编译通过率,明显优于现有方法。
原文摘要(Abstract)

Smart contract vulnerabilities can cause substantial financial losses due to the immutability of code after deployment. While existing tools detect vulnerabilities, they cannot effectively repair them. In this paper, we propose SCPatcher, a framework that combines retrieval-augmented generation with a knowledge graph for automated smart contract repair. We construct a knowledge graph from 5,000 verified Ethereum contracts, extracting function-level relationships to build a semantic network. This graph serves as an external knowledge base that enhances Large Language Model reasoning and enables precise vulnerability patching. We introduce a two-stage repair strategy, initial knowledge-guided repair followed by Chain-of-Thought reasoning for complex vulnerabilities. Evaluated on a diverse set of vulnerable contracts, SCPatcher achieves 81.5% overall repair rate and 91.0% compilation pass rate, substantially outperforming existing methods.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2604-00687,
  title = {SCPatcher: Automated Smart Contract Code Repair via Retrieval-Augmented Generation and Knowledge Graph},
  author = {Xiaoqi Li and Shipeng Ye and Wenkai Li and Zongwei Li},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3805558}
}