paper-with-me

Papers

Guiding LLM-based Smart Contract Generation with Finite State Machine

2025-05-13 · Hao Luo, YuHao Lin, Xiao Yan, Xintong Hu, Yuxiang Wang, Qiming Zeng, Hao Wang, Jiawei Jiang

Smart contract is a kind of self-executing code based on blockchain technology with a wide range of application scenarios, but the traditional generation method relies on manual coding and expert auditing, which has a high threshold and low efficiency. Although Large Language Models (LLMs) show great potential in programming tasks, they still face challenges in smart contract generation w.r.t. effectiveness and security. To solve these problems, we propose FSM-SCG, a smart contract generation framework based on finite state machine (FSM) and LLMs, which significantly improves the quality of the generated code by abstracting user requirements to generate FSM, guiding LLMs to generate smart contracts, and iteratively optimizing the code with the feedback of compilation and security checks. The experimental results show that FSM-SCG significantly improves the quality of smart contract generation. Compared to the best baseline, FSM-SCG improves the compilation success rate of generated smart contract code by at most 48%, and reduces the average vulnerability risk score by approximately 68%.

📄 PDF Abstract BibTeX arXiv:2505.08542

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

A formal model for ledger management systems based on contracts and temporal logic

2021-09-30 · Paolo Bottoni, Anna Labella, Remo Pareschi

A key component of blockchain technology is the ledger, viz., a database that, unlike standard databases, keeps in memory the complete history of past transactions as in a notarial archive for the benefit of any future t…

Management

An Empirical Study of AI-based Smart Contract Creation

2023-08-05 · Rabimba Karanjai, Edward Li, Lei Xu, Weidong Shi

The introduction of large language models (LLMs) like ChatGPT and Google Palm2 for smart contract generation seems to be the first well-established instance of an AI pair programmer. LLMs have access to a large number of…

Code Generation

Combining Graph Neural Networks with Expert Knowledge for Smart Contract Vulnerability Detection

2021-07-24 · Zhenguang Liu, Peng Qian, Xiaoyang Wang, Yuan Zhuang 외

Smart contract vulnerability detection draws extensive attention in recent years due to the substantial losses caused by hacker attacks. Existing efforts for contract security analysis heavily rely on rigid rules defined…

Vulnerability Detection

SmartEval: A Benchmark for Evaluating LLM-Generated Smart Contracts from Natural Language Specifications

2026-05-10 · Abhinav Goel, Agostino Capponi, Alfio Gliozzo, Chaitya Shah arxiv

We introduce SmartEval, a benchmark for systematically evaluating the quality of Solidity smart contracts generated by large language models (LLMs) from natural language specifications. SmartEval provides a corpus of 9,0…

SCALM: Detecting Bad Practices in Smart Contracts Through LLMs

2025-02-04 · Zongwei Li, Xiaoqi Li, Wenkai Li, Xin Wang

As the Ethereum platform continues to mature and gain widespread usage, it is crucial to maintain high standards of smart contract writing practices. While bad practices in smart contracts may not directly lead to securi…

RAGRetrievalRetrieval-augmented Generation