mlsanityData to 14 Oct 2026

Towards Automated Smart Contract Generation: Evaluation, Benchmarking, and Retrieval-Augmented Repair

arXiv 2503.01098 ↗First posted 3 Mar 2025cs.SE cs.AI cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

Smart contracts, predominantly written in Solidity and deployed on blockchains such as Ethereum, are immutable after deployment, making functional correctness critical. However, existing evaluations of Solidity code generation rely largely on surface-level metrics (e.g., BLEU, CrystalBLEU) or manual inspection, which correlate poorly with functional correctness. In contrast to Python, Solidity lacks large-scale, execution-based benchmarks, limiting systematic evaluation of large language models for smart contract development. We introduce SolBench, a comprehensive benchmark and automated testing pipeline for Solidity that emphasizes functional correctness via differential fuzzing. SolBench consists of 28825 functions extracted from 7604 real-world smart contracts collected from Etherscan (genesis-2024), spanning ten application domains. We benchmark 14 diverse LLMs, covering open and closed models, 1.3B-671B parameters, and both general-purpose and code-specialized architectures. The dominant failure mode is missing critical intra-contract information, such as state variables and type definitions. Providing full-contract context improves accuracy but incurs prohibitive inference costs. To address this, we propose Retrieval-Augmented Repair (RAR), a cost-effective framework that integrates execution feedback into code repair. RAR uses compiler and runtime error messages to retrieve only the minimal contract snippets needed to correct a target function, avoiding full-context inference. This significantly reduces input length while improving functional correctness. We further analyze retrieval and repair strategies within RAR, demonstrating consistent gains in accuracy and efficiency. SolBench and RAR enable principled, execution-based evaluation and economical improvement of Solidity code generation. Dataset and code are publicly available at https://github.com/ZaoyuChen/SolBench.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 32 of its 44 references that are in the map. First posted on arXiv 3 Mar 2025.

Builds on

32 of 44 references.

References · 32

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  3. 2021Program Synthesis with Large Language Modelscited by 3,637
  4. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  6. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  7. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  8. 2023Teaching Large Language Models to Self-Debugcited by 988
  9. 2021Measuring Coding Challenge Competence With APPScited by 902
  10. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  11. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 452
  12. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
20 more
  1. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  2. 2022The Stack: 3 TB of permissively licensed source codecited by 359
  3. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 353
  4. 2022Generating Sequences by Learning to Self-Correctcited by 277
  5. 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 197
  6. 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 187
  7. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 183
  8. 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 111
  9. 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
  10. 2019Slither: A Static Analysis Framework For Smart Contractscited by 89
  11. 2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationcited by 57
  12. 2020SmartBugs: A Framework to Analyze Solidity Smart Contractscited by 18
  13. 2024Can We Verify Step by Step for Incorrect Answer Detection?cited by 15
  14. 2024ACFIX: Guiding LLMs with Mined Common RBAC Practices for Context-Aware Repair of Access Control Vulnerabilities in Smart Contractscited by 15
  15. 2023Efficient Avoidance of Vulnerabilities in Auto-completed Smart Contract Code Using Vulnerability-constrained Decodingcited by 14
  16. 2024Smart-LLaMA: Two-Stage Post-Training of Large Language Models for Smart Contract Vulnerability Detection and Explanationcited by 8
  17. 2023Automatic Smart Contract Comment Generation via Large Language Models and In-Context Learningcited by 6
  18. 2025SolEval: Benchmarking Large Language Models for Repository-level Solidity Code Generationcited by 5
  19. 2023Optimizing Large Language Models to Expedite the Development of Smart Contractscited by 1
  20. 2024DISL: Fueling Research with A Large Dataset of Solidity Smart Contractscited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Beyond Code Similarity: Benchmarking the Plausibility, Efficiency, and Complexity of LLM-Generated Smart Contracts
  2. 2026Repository-Level Solidity Code Generation with Large Language Models: From Prompting to Fine-Tuning
  3. 2026An end-to-end agentic pipeline for smart contract translation and quality evaluation
  4. 2026SolAgent: A Specialized Multi-Agent Framework for Solidity Code Generation
  5. 2025Securing Smart Contract Languages with a Unified Agentic Framework for Vulnerability Repair in Solidity and Move
  6. 2026SCPatcher: Automated Smart Contract Code Repair via Retrieval-Augmented Generation and Knowledge Graph
  7. 2025ParaVul: A Parallel Large Language Model and Retrieval-Augmented Framework for Smart Contract Vulnerability Detection
  8. 2026Mitigating Error Propagation in Chain-of-Thought: A Tree-of-Thought Framework for Smart Contract Repair ↗