Lune

EMNLP2025Top-tier venue

SolEval: Benchmarking Large Language Models for Repository-level Solidity Smart Contract Generation

Zhiyuan Peng, Xin Yin, Rui Qian, Peiqin Lin, Yongkang Liu, Hao Zhang, Chenhao Ying, Yuan Luo

Abstract

Large language models (LLMs) have transformed code generation. However, most existing approaches focus on mainstream languages such as Python and Java, neglecting the Solidity language, the predominant programming language for Ethereum smart contracts. Due to the lack of adequate benchmarks for Solidity, LLMs' ability to generate secure, costeffective smart contracts remains unexplored. To fill this gap, we construct SolEval, the first repository-level benchmark designed for Solidity smart contract generation, to evaluate the performance of LLMs on Solidity. Sol-Eval consists of 1,507 samples from 28 different repositories, covering 6 popular domains, providing LLMs with a comprehensive evaluation benchmark. Unlike the existing Solidity benchmark, SolEval not only includes complex function calls but also reflects the real-world complexity of the Ethereum ecosystem by incorporating Gas@k and Vul@k. We evaluate 16 LLMs on SolEval, and our results show that the best-performing LLM achieves only 26.29% Pass@10, highlighting substantial room for improvement in Solidity code generation by LLMs. Additionally, we conduct supervised fine-tuning (SFT) on Qwen-7B using SolEval, resulting in a significant performance improvement, with Pass@5 increasing from 16.67% to 58.33%, demonstrating the effectiveness of fine-tuning LLMs on our benchmark. We release our data and code at https: //github.com/pzy2000/SolEval . Stats: SolEval benchmark is made up of 1,125 samples. Task: Repository-level Code Generation. Metrics: ⑥ Pass@k and Compile@k, ⑦ Gas Fee and Vul. function ternary(bool condition, uint256 a, uint256 b) /** * @notice A branchless ternary function that returns one of two values based on a condition. * @param condition A boolean condition that determines which value to return. * @param a The value to return if the condition is true. * @param b The value to return if the condition is false. * @return The result of the ternary operation, either a or b. */

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis cites Language Models are Few-Shot Learners
  • Teaching Large Language Models to Self-Debug cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • Teaching Large Language Models to Self-Debug cites Language Models are Few-Shot Learners
  • Repository-Level Prompt Generation for Large Language Models of Code cites Language Models are Few-Shot Learners
  • Large Language Models are Human-Level Prompt Engineers cites Language Models are Few-Shot Learners
  • PlayCoder: Making LLM-Generated GUI Code Playable cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • PlayCoder: Making LLM-Generated GUI Code Playable cites Teaching Large Language Models to Self-Debug
  • PlayCoder: Making LLM-Generated GUI Code Playable cites Repository-Level Prompt Generation for Large Language Models of Code
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. PlayCoder: Making LLM-Generated GUI Code PlayableZhiyuan Peng, Wei Tao, Xin Yin, Chenhao Ying et al.FSE 2026

Builds on15

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
  3. Large Language Models are Human-Level Prompt EngineersYongchao Zhou, Andrei Ioan Muresanu, Ziwen Han, Keiran Paster et al.ICLR 2023 · 297 citations
  4. CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisErik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu et al.ICLR 2023 · 234 citations
  5. Repository-Level Prompt Generation for Large Language Models of CodeDisha Shrivastava, Hugo Larochelle, Daniel TarlowICML 2023 · 184 citations

Related papers

  1. SolContractEval: A Benchmark for Evaluating Contract-Level Solidity Code GenerationZhifan Ye, Jiachi Chen, Zhenzhe Shao, Lingfeng Bao et al.ASE 2025
  2. PrefGen: A Preference-Driven Methodology for Secure Yet Gas-Efficient Smart Contract GenerationZhiyuan Peng, Xin Yin, Zijie Zhou, Chenhao Ying et al.ASE 2025 · 3 citations
  3. Towards Automated Smart Contract Generation: Evaluation, Benchmarking, and Retrieval-Augmented RepairZaoyu Chen, Haoran Qin, Nuo Chen, Xiangyu Zhao et al.FSE 2026
  4. Can Language Models Replace Programmers for Coding? REPOCOD Says 'Not Yet'Shanchao Liang, Nan Jiang, Yiran Hu, Lin TanACL 2025 · 9 citations
  5. 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
Dusk over the sea between two cliffs drawn in fine vertical lines