Under-optimized smart contracts devour your money
By Ting Chen, Xiaoqi Li, Xiapu Luo, Xiaosong Zhang. IEEE International Conference on Software Analysis, Evolution, and Reengineering, 2017
381 citations recorded by the source corpus.
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.
Subfields: Computer Networks and Communications, Information Systems, Signal Processing
View Paper: https://www.semanticscholar.org/paper/78b7ebe5a9d47ddaaa31f876125fc6f791f68a2c
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Computer Networks and Communications
- Zibin Zheng
- Vincent Gramoli
- Muhammad Imran
- Yong Yuan
- Baowen Xu
- Michael Bailey
- Jian Weng
- Andrew K. Miller
In Information Systems
- Zibin Zheng
- Yong Yuan
- Feiyue Wang
- Vincent Gramoli
- Shuai Wang
- Petar Tsankov
- Hongning Dai
- Maher Alharby
In Signal Processing
- Zibin Zheng
- Xin Xia
- Michael Bailey
- Martin T. Vechev
- Xiaodong Lin
- Petar Tsankov
- Miltiadis Allamanis
- Marc Brockschmidt
Citations in the corpus
- Erays: Reverse Engineering Ethereum's Opaque Smart Contracts (2018, background): “Finally, a particular gene is mutated with 25% probability if the larger of the 6See Chen et al [16] for a survey of underoptimization in Ethereum contracts. two parents’ corresponding gene is less than 23 and with 12.5% probability otherwise.”
- Understanding Ethereum via Graph Analysis (2020, background): “There are various studies about Ethereum’s security [16, 24, 32, 33, 43] and performance [15, 17].”
- Blockchain-based Smart Contracts: A Systematic Mapping Study (2017, background): “• Use of ‘GASPER’ tool [20].”
- A Survey on the Security of Blockchain Systems (2017, background): “[50] identify 7 gas-costly patterns and group them into 2 categories (as shown in Table 6): useless-code related patterns, and loop-related patterns.”
- Slither: A Static Analysis Framework for Smart Contracts (2019, methodology): “GASPER [5] and GasReduce [6] use static analysis to detect potential optimizations in contracts, GASPER at a high-level (e.g. dead code) and GasReduce at the bytecode instruction pattern level.”
- Empirical Review of Automated Analysis Tools on 47,587 Ethereum Smart Contracts (2019, neutral): “10 Gasper [9] N/A”
- sFuzz: An Efficient Adaptive Fuzzer for Solidity Smart Contracts (2020, neutral): “In [10], Chen et al.”
- Smart Contract Development: Challenges and Opportunities (2021, background): “More and more researchers are taking smart contracts as study targets [21],”
- Securify: Practical Security Analysis of Smart Contracts (2018, background): “[27] show that the current standard compiler Solidity does not properly optimize the EVM bytecode.”
- MadMax: surviving out-of-gas conditions in Ethereum smart contracts (2018, background): “The GASPER [Chen et al. 2017] identifies GAS-costly programming patterns.”
- Vandal: A Scalable Security Analysis Framework for Smart Contracts (2018, methodology): “A wide range of known security vulnerabilities have been described [17–23].”
- An Overview on Smart Contracts: Challenges, Advances and Platforms (2019, positive): “It is shown in recent work [44] that smart contracts can be overcharged due to the under-optimization of smart contracts.”
- Blockchain-Enabled Smart Contracts: Architecture, Applications, and Future Trends (2019, background): “Besides, T. Chen et al. pointed out that the under-optimized smart contracts may also devour users’ money [42].”