Towards Trustworthy Smart Contract Synthesis: A Multi-Agent Framework with Lean-Based Verification
Bowei Zhang, Hanbing Liu, Qixin Tian, Siyu Chen, Ziyuan Wang, Qi Qi
Abstract
Smart Contracts are the foundation of Decentralized Finance (DeFi), executing financial logic without trusted intermediaries. Recent advances in large language models (LLMs) have substantially lowered the barrier to smart contract development by enabling code generation from natural language. However, because smart contracts are immutable and directly manage financial assets, this accessibility introduces a critical trust gap: generated contracts are easy to produce but hard to trust. To bridge this gap, We present LeVer, the first trustworthy smart contract synthesis framework that integrates LLM-based generation with Lean-based autoformalization and Verification. LeVer employs a closed-loop multi-agent architecture to iteratively generate, verify, attack, and repair contracts, providing both formal guarantees and empirical robustness. To facilitate the adoption of automated formal verification in smart contract generation and audition, we opensource our framework and datasets at: https: //github.com/gl-bowei/LeVer
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 8f952b30-5aa1-466d-89fc-726c325a6107Related papers
- LEVER: Learning to Verify Language-to-Code Generation with ExecutionAnsong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov et al.ICML 2023 · 318 citations
- SmartCoder-R1: Towards Secure and Explainable Smart Contract Generation with Security-Aware Group Relative Policy OptimizationLei Yu, Jingyuan Zhang, Xin Wang, Li Yang et al.FSE 2026 · 3 citations
- FHE-Coder: Benchmarking Secure Agentic Code Generation for Fully Homomorphic EncryptionMayank Kumar, Jiaqi Xue, Mengxin Zheng, Qian LouICLR 2026
- Thought Is All You Need: Smart Contract Vulnerability Detection with Thought-Augmented Large Language ModelChaoyuan Peng, Muhui Jiang, Yajin Zhou, Lei WuFSE 2026
- AlphaVerus: Bootstrapping Formally Verified Code Generation through Self-Improving Translation and TreefinementPranjal Aggarwal, Bryan Parno, Sean WelleckICML 2025
