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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Peng, Zhiyuan, Yin, Xin, Qian, Rui, Lin, Peiqin, Liu, Yongkang, Zhang, Hao, Ying, Chenhao, Luo, Yuan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914004822130688
author Peng, Zhiyuan
Yin, Xin
Qian, Rui
Lin, Peiqin
Liu, Yongkang
Zhang, Hao
Ying, Chenhao
Luo, Yuan
author_facet Peng, Zhiyuan
Yin, Xin
Qian, Rui
Lin, Peiqin
Liu, Yongkang
Zhang, Hao
Ying, Chenhao
Luo, Yuan
contents 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, cost-effective 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. SolEval 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.
format Preprint
id arxiv_https___arxiv_org_abs_2502_18793
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle SolEval: Benchmarking Large Language Models for Repository-level Solidity Code Generation
Peng, Zhiyuan
Yin, Xin
Qian, Rui
Lin, Peiqin
Liu, Yongkang
Zhang, Hao
Ying, Chenhao
Luo, Yuan
Software Engineering
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, cost-effective 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. SolEval 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.
title SolEval: Benchmarking Large Language Models for Repository-level Solidity Code Generation
topic Software Engineering
url https://arxiv.org/abs/2502.18793