arXiv:2602.13808cs.AIcs.SE2026-02

用AI把自然语言合同自动转成代码并评估质量

An end-to-end agentic pipeline for smart contract translation and quality evaluation

  • 用多智能体迭代生成代码,结构化输出带溯源信息
  • 从五个维度评估代码质量,支持与真实实现比对
  • 适合研究合约生成、安全检测或区块链开发的开发者

我们提出一个端到端框架,用于系统评估大模型从自然语言规范生成的智能合约。该系统将合同文本解析为结构化模式,生成Solidity代码,并通过编译和安全检查进行自动化质量评估。采用CrewAI风格的智能体团队,通过迭代优化生成带有完整溯源元数据的结构化成果。质量评估涵盖五个维度:功能完整性、变量保真度、状态机正确性、业务逻辑一致性以及代码质量,综合生成评分。框架支持与真实实现的配对评估,量化对齐程度并识别系统性错误模式,如逻辑遗漏和状态转移不一致。这为智能合约合成质量的实证研究提供了可复现基准,并支持扩展至形式化验证和合规检查。

原文摘要 · Abstract (English)

We present an end-to-end framework for systematic evaluation of LLM-generated smart contracts from natural-language specifications. The system parses contractual text into structured schemas, generates Solidity code, and performs automated quality assessment through compilation and security checks. Using CrewAI-style agent teams with iterative refinement, the pipeline produces structured artifacts with full provenance metadata. Quality is measured across five dimensions, including functional completeness, variable fidelity, state-machine correctness, business-logic fidelity, and code quality aggregated into composite scores. The framework supports paired evaluation against ground-truth implementations, quantifying alignment and identifying systematic error modes such as logic omissions and state transition inconsistencies. This provides a reproducible benchmark for empirical research on smart contract synthesis quality and supports extensions to formal verification and compliance checking.

智能合约代码生成质量评估AI代理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。