FlowMemRep: Automated Workflow with Memory-Aware for Smart Contract Vulnerability Repair Using LLMs
Abstract
Large language models (LLMs) have advanced code generation, yet code repair remains difficult due to complex multi-step reasoning, strict correctness requirements, limited data, and real-time constraints. Smart contracts, as immutable blockchain programs, are an important case for repair. This paper presents FlowMemRep, a memory-based workflow for smart contract vulnerability repair. It extracts repair logic from a few-shot prompts, retrieves knowledge with gas cost profiles, version constraints, and deployment rules. In addition, outputs are stored in short-term memory, and then verified information is transferred to long-term memory for accurate reuse. Experiments on 205 real-world vulnerabilities show that FlowMemRep reaches 75 percent remediation accuracy, surpassing prior methods by 20 percent.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.