# Under-Optimized Smart Contracts Devour Your Money

arXiv: https://arxiv.org/abs/1703.03994 · HTML: https://mlsanity.com/paper/1703.03994/

## Key facts

- Cited by 9 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 11 Mar 2017.

## Built on by (most cited first, 9 of 9)

- [AuditGPT: Auditing Smart Contracts with ChatGPT](https://mlsanity.com/paper/2404.04306/) (2024)
- [Eth2Vec: Learning Contract-Wide Code Representations for Vulnerability Detection on Ethereum Smart Contracts](https://mlsanity.com/paper/2101.02377/) (2021)
- [GasAgent: A Multi-Agent Framework for Automated Gas Optimization in Smart Contracts](https://mlsanity.com/paper/2507.15761/) (2025)
- [Data-driven Smart Ponzi Scheme Detection](https://mlsanity.com/paper/2108.09305/) (2021)
- [Deep Smart Contract Intent Detection](https://mlsanity.com/paper/2211.10724/) (2022)
- [SolAgent: A Specialized Multi-Agent Framework for Solidity Code Generation](https://mlsanity.com/paper/2601.23009/) (2026)
- [Who is Gambling? Finding Cryptocurrency Gamblers Using Multi-modal Retrieval Methods](https://mlsanity.com/paper/2211.14779/) (2022)
- [A Survey on Blockchain-based Supply Chain Finance with Progress and Future directions](https://mlsanity.com/paper/2408.08915/) (2024)
- [Decentralized Weather Forecasting via Distributed Machine Learning and Blockchain-Based Model Validation](https://mlsanity.com/paper/2508.09299/) (2025)

## Abstract (arXiv)

Smart contracts are full-fledged programs that run on blockchains (e.g., Ethereum, one of the most popular blockchains). In Ethereum, gas (in Ether, a cryptographic currency like Bitcoin) is the execution fee compensating the computing resources of miners for running smart contracts. However, we find that under-optimized smart contracts cost more gas than necessary, and therefore the creators or users will be overcharged. In this work, we conduct the first investigation on Solidity, the recommended compiler, and reveal that it fails to optimize gas-costly programming patterns. In particular, we identify 7 gas-costly patterns and group them to 2 categories. Then, we propose and develop GASPER, a new tool for automatically locating gas-costly patterns by analyzing smart contracts' bytecodes. The preliminary results on discovering 3 representative patterns from 4,240 real smart contracts show that 93.5%, 90.1% and 80% contracts suffer from these 3 patterns, respectively.
