Lune

EMNLP2025顶会

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

摘要

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. */

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis 引用了 Language Models are Few-Shot Learners
  • Teaching Large Language Models to Self-Debug 引用了 CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • Teaching Large Language Models to Self-Debug 引用了 Language Models are Few-Shot Learners
  • Repository-Level Prompt Generation for Large Language Models of Code 引用了 Language Models are Few-Shot Learners
  • Large Language Models are Human-Level Prompt Engineers 引用了 Language Models are Few-Shot Learners
  • PlayCoder: Making LLM-Generated GUI Code Playable 引用了 CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • PlayCoder: Making LLM-Generated GUI Code Playable 引用了 Teaching Large Language Models to Self-Debug
  • PlayCoder: Making LLM-Generated GUI Code Playable 引用了 Repository-Level Prompt Generation for Large Language Models of Code
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper1

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

它引用的 Paper15

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

相关 Paper

  1. SolContractEval: A Benchmark for Evaluating Contract-Level Solidity Code GenerationZhifan Ye, Jiachi Chen, Zhenzhe Shao, Lingfeng Bao 等ASE 2025
  2. PrefGen: A Preference-Driven Methodology for Secure Yet Gas-Efficient Smart Contract GenerationZhiyuan Peng, Xin Yin, Zijie Zhou, Chenhao Ying 等ASE 2025 · 3 次引用
  3. Towards Automated Smart Contract Generation: Evaluation, Benchmarking, and Retrieval-Augmented RepairZaoyu Chen, Haoran Qin, Nuo Chen, Xiangyu Zhao 等FSE 2026
  4. Can Language Models Replace Programmers for Coding? REPOCOD Says 'Not Yet'Shanchao Liang, Nan Jiang, Yiran Hu, Lin TanACL 2025 · 9 次引用
  5. SmartCoder-R1: Towards Secure and Explainable Smart Contract Generation with Security-Aware Group Relative Policy OptimizationLei Yu, Jingyuan Zhang, Xin Wang, Li Yang 等FSE 2026 · 3 次引用
黄昏的海面,两侧是细线勾勒的悬崖