mlsanityData to 14 Oct 2026

Guiding LLM-based Smart Contract Generation with Finite State Machine

arXiv 2505.08542 ↗First posted 13 May 2025cs.AIcited by 5

Not on the map. Why?

Abstract (arXiv)

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%.

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 17 of its 38 references that are in the map. First posted on arXiv 13 May 2025.

Builds on

17 of 38 references.

References · 17

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2024A Survey on Large Language Models for Code Generationcited by 658
  4. 2023Harnessing the Power of LLMs in Practice: A Survey on ChatGPT and Beyondcited by 411
  5. 2023Recommender Systems in the Era of Large Language Models (LLMs)cited by 189
  6. 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
  7. 2023Structured Chain-of-Thought Prompting for Code Generationcited by 138
  8. 2023When MOE Meets LLMs: Parameter Efficient Fine-tuning for Multi-task Medical Applicationscited by 111
  9. 2019Slither: A Static Analysis Framework For Smart Contractscited by 89
  10. 2023Taiyi: A Bilingual Fine-Tuned Large Language Model for Diverse Biomedical Taskscited by 36
  11. 2016Smart Contract Templates: foundations, design landscape and research directionscited by 6
  12. 2024Retrofitting Temporal Graph Neural Networks with Transformercited by 5
5 more
  1. 2024Efficacy of Various Large Language Models in Generating Smart Contractscited by 4
  2. 2023Learning Diffusions under Uncertaintycited by 2
  3. 2024TreeCSS: An Efficient Framework for Vertical Federated Learningcited by 2
  4. 2018Tool Demonstration: FSolidM for Designing Secure Ethereum Smart Contractscited by 1
  5. 2019Smart Contract Design Meets State Machine Synthesis: Case Studiescited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 2.

5 papers.