SolAgent: A Specialized Multi-Agent Framework for Solidity Code Generation
Wei Chen, Zhiyuan Peng, Xin Yin, Chao Ni, Chenhao Ying, Bang Xie, Yuan Luo

TL;DR
SolAgent is a multi-agent framework that improves Solidity smart contract code generation by combining code correctness and security checks, outperforming existing models and reducing vulnerabilities.
Contribution
We introduce SolAgent, a novel multi-agent system with dual-loop refinement for secure, correct Solidity code generation, leveraging compiler and static analysis tools.
Findings
Achieves up to 64.39% Pass@1 rate on SolEval+ Benchmark
Reduces security vulnerabilities by up to 39.77% compared to human-written code
Outperforms state-of-the-art LLMs and AI IDEs in smart contract generation
Abstract
Smart contracts are the backbone of the decentralized web, yet ensuring their functional correctness and security remains a critical challenge. While Large Language Models (LLMs) have shown promise in code generation, they often struggle with the rigorous requirements of smart contracts, frequently producing code that is buggy or vulnerable. To address this, we propose SolAgent, a novel tool-augmented multi-agent framework that mimics the workflow of human experts. SolAgent integrates a \textbf{dual-loop refinement mechanism}: an inner loop using the \textit{Forge} compiler to ensure functional correctness, and an outer loop leveraging the \textit{Slither} static analyzer to eliminate security vulnerabilities. Additionally, the agent is equipped with file system capabilities to resolve complex project dependencies. Experiments on the SolEval+ Benchmark, a rigorous suite derived from…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsBlockchain Technology Applications and Security · Adversarial Robustness in Machine Learning · Advanced Malware Detection Techniques
