GasAgent: A Multi-Agent Framework for Automated Gas Optimization in Smart Contracts
On the map: LLM agents and tool use → Agent threats, guardrails and governance
Abstract (arXiv)
Smart contracts are trustworthy, immutable, and automatically executed programs on the blockchain. Their execution requires the Gas mechanism to ensure efficiency and fairness. However, due to non-optimal coding practices, many contracts contain Gas waste patterns that need to be optimized. Existing solutions mostly rely on manual discovery, which is inefficient, costly to maintain, and difficult to scale. Recent research uses large language models (LLMs) to explore new Gas waste patterns. However, it struggles to remain compatible with existing patterns, often produces redundant patterns, and requires manual validation/rewriting. To address this gap, we present GasAgent, the first multi-agent system for smart contract Gas optimization that combines compatibility with existing patterns and automated discovery/validation of new patterns, enabling end-to-end optimization. GasAgent consists of four specialized agents, Seeker, Innovator, Executor, and Manager, that collaborate in a closed loop to identify, validate, and apply Gas-saving improvements. Experiments on 100 verified real-world contracts demonstrate that GasAgent successfully optimizes 82 contracts, achieving an average deployment Gas savings of 9.97%. In addition, our evaluation confirms its compatibility with existing tools and validates the effectiveness of each module through ablation studies. To assess broader usability, we further evaluate 500 contracts generated by five representative LLMs across 10 categories and find that GasAgent optimizes 79.8% of them, with deployment Gas savings ranging from 4.79% to 13.93%, showing its usability as the optimization layer for LLM-assisted smart contract development.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 31 of its 60 references that are in the map. First posted on arXiv 21 Jul 2025.
Builds on
31 of 60 references.
References · 31
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2023GPT-4 Technical Reportcited by 18,396
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,568
- 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,808
- 2023Improving Factuality and Reasoning in Language Models through Multiagent Debatecited by 1,784
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2024Large Language Model based Multi-Agents: A Survey of Progress and Challengescited by 769
- 2023API-Bank: A Comprehensive Benchmark for Tool-Augmented LLMscited by 591
19 more
- 2022Decomposed Prompting: A Modular Approach for Solving Complex Taskscited by 558
- 2023Cognitive Architectures for Language Agentscited by 429
- 2023Harnessing the Power of LLMs in Practice: A Survey on ChatGPT and Beyondcited by 411
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023Building Cooperative Embodied Agents Modularly with Large Language Modelscited by 237
- 2023RoCo: Dialectic Multi-Robot Collaboration with Large Language Modelscited by 172
- 2023Language Agents with Reinforcement Learning for Strategic Play in the Werewolf Gamecited by 152
- 2023Jina Embeddings 2: 8192-Token General-Purpose Text Embeddings for Long Documentscited by 104
- 2019Slither: A Static Analysis Framework For Smart Contractscited by 89
- 2023TPTU: Large Language Model-based AI Agents for Task Planning and Tool Usagecited by 55
- 2023Simulating Public Administration Crisis: A Novel Generative Agent-Based Simulation System to Lower Technology Barriers in Social Science Researchcited by 21
- 2019An Overview on Smart Contracts: Challenges, Advances and Platformscited by 20
- 2017Under-Optimized Smart Contracts Devour Your Moneycited by 9
- 2019GASOL: Gas Analysis and Optimization for Ethereum Smart Contractscited by 5
- 2024Smart Contracts in the Real World: A Statistical Exploration of External Data Dependenciescited by 5
- 2024How to Save My Gas Fees: Understanding and Detecting Real-world Gas Issues in Solidity Programscited by 3
- 2017An Adaptive Gas Cost Mechanism for Ethereum to Defend Against Under-Priced DoS Attackscited by 1
- 2020Profiling Gas Consumption in Solidity Smart Contractscited by 1
- 2023A Two-Layer Blockchain Sharding Protocol Leveraging Safety and Liveness for Enhanced Performancecited by 1
Built on by
Citing papers per year: 2025: 3; 2026: 2.
5 papers.
- 2025BetaWeb: Towards a Blockchain-enabled Trustworthy Agentic Webcited by 7
- 2025Empowering Real-World: A Survey on the Technology, Practice, and Evaluation of LLM-driven Industry Agentscited by 2
- 2026What Your Posts Reveal: A Benchmark and Agentic Framework for User-Level Privacy Leakage on Social Mediacited by 2
- 2025TxSum: User-Centered Ethereum Transaction Understanding with Micro-Level Semantic Groundingcited by 1
- 2026TransMeme: A Multi-Agent Framework for Cross-Cultural Meme Transcreationcited by 0
- 2026TransMeme: A Multi-Agent Framework for Cross-Cultural Meme Transcreation27 Aug 2026
- 2026What Your Posts Reveal: A Benchmark and Agentic Framework for User-Level Privacy Leakage on Social Media5 Jun 2026
- 2025TxSum: User-Centered Ethereum Transaction Understanding with Micro-Level Semantic Grounding7 Dec 2025
- 2025Empowering Real-World: A Survey on the Technology, Practice, and Evaluation of LLM-driven Industry Agents20 Oct 2025
- 2025BetaWeb: Towards a Blockchain-enabled Trustworthy Agentic Web19 Aug 2025
Similar, not cited
Close in wording, no citation either way
- 2026RAGas: Retrieval-Augmented Gas Optimization for Smart Contracts with Continuous Knowledge Integration
- 2025Curriculum-Guided Reinforcement Learning for Synthesizing Gas-Efficient Financial Derivatives Contracts
- 2026SolAgent: A Specialized Multi-Agent Framework for Solidity Code Generation
- 2026Autonomous Agents on Blockchains: Standards, Execution Models, and Trust Boundaries
- 2025Securing Smart Contract Languages with a Unified Agentic Framework for Vulnerability Repair in Solidity and Move
- 2025Beyond Code Similarity: Benchmarking the Plausibility, Efficiency, and Complexity of LLM-Generated Smart Contracts
- 2026SolarChain-Eval: A Physics-Constrained Benchmark for Trustworthy Economic Agents in Decentralized Energy Markets
- 2025Multi-Agent Collaborative Fuzzing with Continuous Reflection for Smart Contracts Vulnerability Detection