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 high-quality real-world projects, demonstrate that SolAgent achieves a Pass@1 rate of up to \textbf{64.39\%}, significantly outperforming state-of-the-art LLMs ($\sim$25\%), AI IDEs (e.g., GitHub Copilot), and existing agent frameworks. Moreover, it reduces security vulnerabilities by up to \textbf{39.77\%} compared to human-written baselines. Finally, we demonstrate that the high-quality trajectories generated by SolAgent can be used to distill smaller, open-source models, democratizing access to secure smart contract generation. We release our data and code at https://github.com/openpaperz/SolAgent.


翻译:智能合约是去中心化网络的基石,然而确保其功能正确性与安全性仍是一项关键挑战。尽管大语言模型在代码生成方面展现出潜力,但它们往往难以满足智能合约的严苛要求,生成的代码常存在缺陷或漏洞。为此,我们提出了SolAgent,一个新颖的工具增强型多智能体框架,它模拟了人类专家的工作流程。SolAgent集成了一个**双循环精炼机制**:内循环使用 _Forge_ 编译器确保功能正确性,外循环利用 _Slither_ 静态分析器消除安全漏洞。此外,该智能体具备文件系统能力,以解决复杂的项目依赖关系。在SolEval+基准测试(一套源自高质量真实项目的严格测试集)上的实验表明,SolAgent的Pass@1率最高可达**64.39%**,显著优于最先进的大语言模型(约25%)、AI集成开发环境(例如GitHub Copilot)以及现有的智能体框架。同时,相较于人工编写的基线,它能将安全漏洞减少高达**39.77%**。最后,我们证明了SolAgent生成的高质量轨迹可用于蒸馏更小规模的开源模型,从而普及安全智能合约的生成。我们在https://github.com/openpaperz/SolAgent发布了数据与代码。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
智能体工程(Agent Engineering)
专知会员服务
33+阅读 · 2025年12月31日
设计和构建强大的大语言模型智能体
专知会员服务
55+阅读 · 2024年10月6日
走向通用虚拟智能体
专知会员服务
76+阅读 · 2023年11月26日
AI Agent:基于大模型的自主智能体
专知会员服务
249+阅读 · 2023年9月9日
面向多智能体博弈对抗的对手建模框架
专知
18+阅读 · 2022年9月28日
浅谈群体智能——新一代AI的重要方向
中国科学院自动化研究所
44+阅读 · 2019年10月16日
面向人工智能的计算机体系结构
计算机研究与发展
14+阅读 · 2019年6月6日
群体智能:新一代人工智能的重要方向
走向智能论坛
12+阅读 · 2017年8月16日
【强化学习】强化学习+深度学习=人工智能
产业智能官
55+阅读 · 2017年8月11日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
VIP会员
最新内容
2025年大语言模型进展报告
专知会员服务
1+阅读 · 今天13:30
多智能体协作机制
专知会员服务
1+阅读 · 今天13:26
非对称优势:美海军开发低成本反无人机技术
专知会员服务
4+阅读 · 今天4:39
《美战争部小企业创新研究(SBIR)计划》
专知会员服务
6+阅读 · 今天2:48
《军事模拟:将军事条令与目标融入AI智能体》
专知会员服务
9+阅读 · 今天2:43
【NTU博士论文】3D人体动作生成
专知会员服务
7+阅读 · 4月24日
以色列军事技术对美国军力发展的持续性赋能
专知会员服务
8+阅读 · 4月24日
《深度强化学习在兵棋推演中的应用》40页报告
专知会员服务
14+阅读 · 4月24日
《多域作战面临复杂现实》
专知会员服务
10+阅读 · 4月24日
《印度的多域作战:条令与能力发展》报告
专知会员服务
5+阅读 · 4月24日
相关VIP内容
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员