Under-optimized smart contracts devour your money
Open accessThe DOI matches its Crossref record; 9 of the 9 references it cites were found in a registry or an index.
Abstract
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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
de Moura, L., & Bjørner, N. (2008) · Lecture Notes in Computer Science · doi:10.1007/978-3-540-78800-3_24 · Cited by 6,595 · cited 1×
“To save gas, this summation should be finished before the loop, and then the result is reused within the loop.”
Background(2013) · Cited by 5,372
Making Smart Contracts Smarter
Luu, L., Chu, D.-H., Olickel, H., Saxena, P., & Hobor, A. (2016) · Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security · doi:10.1145/2976749.2978309 · Cited by 2,249
Hawk: The Blockchain Model of Cryptography and Privacy-Preserving Smart Contracts
Kosba, A., Miller, A., Shi, E., Wen, Z., & Papamanthou, C. (2016) · 2016 IEEE Symposium on Security and Privacy (SP) · doi:10.1109/sp.2016.55 · Cited by 2,227
Formal Verification of Smart Contracts: Short Paper
Bhargavan, K., Delignat-Lavaud, A., Fournet, C., Gollamudi, A., Gonthier, G., Kobeissi, N., Kulatova, N., Rastogi, A., Sibut-Pinote, T., Swamy, N., et al. (2016) · Proceedings of the 2016 ACM Workshop on Programming Languages and Analysis for Security · doi:10.1145/2993600.2993611 · Cited by 626
Town Crier: An Authenticated Data Feed for Smart Contracts
Zhang, F., Cecchetti, E., Croman, K., Juels, A., & Shi, E. (2016) · Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security · doi:10.1145/2976749.2978326 · Cited by 580
Why3 — Where Programs Meet Provers
Filliâtre, J.-C., & Paskevich, A. (2013) · Lecture Notes in Computer Science · doi:10.1007/978-3-642-37036-6_8 · Cited by 538
A survey of attacks on Ethereum smart contracts.Preprint
Atzei, N., Bartoletti, M., & Cimoli, T. (2016) · IACR Cryptology ePrint Archive · Cited by 187
The Ring of Gyges: Investigating the Future of Criminal Smart Contracts
Juels, A., Kosba, A., & Shi, E. (2016) · Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security · doi:10.1145/2976749.2978362 · Cited by 179
Cited by
A Survey on the Security of Blockchain Systems
Li, X., Jiang, P., Chen, T., Luo, X., & Wen, Q. (2020) · Future Generation Computer Systems · doi:10.1016/j.future.2017.08.020 · Cited by 1,772
“[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.”
BackgroundSelf-citationAn overview on smart contracts: Challenges, advances and platforms
Zheng, Z., Xie, S., Dai, H.-N., Chen, W., Chen, X., Weng, J., & Imran, M. (2020) · Future Generation Computer Systems · doi:10.1016/j.future.2019.12.019 · Cited by 1,197
Securify: Practical Security Analysis of Smart Contracts
Tsankov, P., Dan, A., Drachsler-Cohen, D., Gervais, A., Bünzli, F., & Vechev, M. (2018) · Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security · doi:10.1145/3243734.3243780 · Cited by 1,043
Slither: A Static Analysis Framework for Smart Contracts
Feist, J., Grieco, G., & Groce, A. (2019) · 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB) · doi:10.1109/wetseb.2019.00008 · Cited by 872
Smart Contract Development: Challenges and Opportunities
Zou, W., Lo, D., Kochhar, P. S., Le, X.-B. D., Xia, X., Feng, Y., Chen, Z., & Xu, B. (2021) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2019.2942301 · Cited by 727
SmartCheck: static analysis of ethereum smart contracts
Tikhomirov, S., Voskresenskaya, E., Ivanitskiy, I., Takhaviev, R., Marchenko, E., & Alexandrov, Y. (2018) · Proceedings of the 1st International Workshop on Emerging Trends in Software Engineering for Blockchain · doi:10.1145/3194113.3194115 · Cited by 672
Finding The Greedy, Prodigal, and Suicidal Contracts at Scale
Nikolić, I., Kolluri, A., Sergey, I., Saxena, P., & Hobor, A. (2018) · Proceedings of the 34th Annual Computer Security Applications Conference · doi:10.1145/3274694.3274743 · Cited by 660
Smart contract applications within blockchain technology: a systematic mapping study
Macrinici, D., Cartofeanu, C., & Gao, S. (2018) · Telematics and Informatics · doi:10.1016/j.tele.2018.10.004 · Cited by 458
Empirical review of automated analysis tools on 47,587 Ethereum smart contracts
Durieux, T., Ferreira, J. F., Abreu, R., & Cruz, P. (2020) · Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering · doi:10.1145/3377811.3380364 · Cited by 409
“10 Gasper [9] N/A”
Detecting Ponzi Schemes on Ethereum: Towards Healthier Blockchain Technology
Chen, W., Zheng, Z., Cui, J., Ngai, E., Zheng, P., & Zhou, Y. (2018) · Proceedings of the 2018 World Wide Web Conference on World Wide Web - WWW '18 · doi:10.1145/3178876.3186046 · Cited by 407
Sidechain technologies in blockchain networks: an examination and state-of-the-art review
Singh, A., Click, K., Parizi, R. M., Zhang, Q., Dehghantanha, A., & Choo, K.-K. R. (2020) · Journal of Network and Computer Applications · doi:10.1016/j.jnca.2019.102471 · Cited by 360
Systematic Review of Security Vulnerabilities in Ethereum Blockchain Smart Contract
Kushwaha, S. S., Joshi, S., Singh, D., Kaur, M., & Lee, H.-N. (2022) · IEEE Access · doi:10.1109/access.2021.3140091 · Cited by 350
MadMax: surviving out-of-gas conditions in Ethereum smart contracts
Grech, N., Kong, M., Jurisevic, A., Brent, L., Scholz, B., & Smaragdakis, Y. (2018) · Proceedings of the ACM on Programming Languages · doi:10.1145/3276486 · Cited by 347
Security, Performance, and Applications of Smart Contracts: A Systematic Survey
Rouhani, S., & Deters, R. (2019) · IEEE Access · doi:10.1109/access.2019.2911031 · Cited by 309
“They introduce seven under-optimized patterns in smart contracts that classified into two groups: uselesscode related, and loop-related [97].”
BackgroundsFuzz: an efficient adaptive fuzzer for solidity smart contracts
Nguyen, T. D., Pham, L. H., Sun, J., Lin, Y., & Minh, Q. T. (2020) · Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering · doi:10.1145/3377811.3380334 · Cited by 275
Smart contracts on the blockchain – A bibliometric analysis and review
Ante, L. (2021) · Telematics and Informatics · doi:10.1016/j.tele.2020.101519 · Cited by 267
Exploiting Blockchain Data to Detect Smart Ponzi Schemes on Ethereum
Chen, W., Zheng, Z., Ngai, E. C.-H., Zheng, P., & Zhou, Y. (2019) · IEEE Access · doi:10.1109/access.2019.2905769 · Cited by 261
Smart contracts in energy systems: A systematic review of fundamental approaches and implementations
Kirli, D., Couraud, B., Robu, V., Salgado-Bravo, M., Norbu, S., Andoni, M., Antonopoulos, I., Negrete-Pincetic, M., Flynn, D., & Kiprakis, A. (2022) · Renewable and Sustainable Energy Reviews · doi:10.1016/j.rser.2021.112013 · Cited by 240
“In order to reduce the future transaction cost of smart contracts, different gas-wasteful patterns are identified in [25,26], where the use of loops as for and while, non 256-bit and unnecessary public variables in the code increases the contracts deployment and execution cost.”
BackgroundSurvey on Blockchain-Based Smart Contracts: Technical Aspects and Future Research
Hewa, T. M., Hu, Y., Liyanage, M., Kanhare, S. S., & Ylianttila, M. (2021) · IEEE Access · doi:10.1109/access.2021.3068178 · Cited by 189
“[147] developed GASPER, a tool which locates the Ethereum smart contract gas costly patterns by analyzing the smart contract bytecode.”
MethodA survey on blockchain cybersecurity vulnerabilities and possible countermeasures
Hasanova, H., Baek, U., Shin, M., Cho, K., & Kim, M. (2019) · International Journal of Network Management · doi:10.1002/nem.2060 · Cited by 181
“Also, there is another security tool called GASPER by Chen et al.(53) It tackles the vulnerability in under‐optimized smart contracts that consume more gas than required.”
BackgroundMethodInfluentialDecentralised Image Sharing and Copyright Protection using Blockchain and Perceptual Hashes
Mehta, R., Kapoor, N., Sourav, S., & Shorey, R. (2019) · 2019 11th International Conference on Communication Systems & Networks (COMSNETS) · doi:10.1109/comsnets.2019.8711440 · Cited by 55
“use lightweight algorithms such as wavelet hash (WHASH) for providing copyright protection, thus requiring less gas amount [13].”
MethodDepFuzz: Efficient Smart Contract Fuzzing with Function Dependence Guidance
Ma, C., Song, W., & Huang, J. (2025) · Proceedings of the ACM on Programming Languages · doi:10.1145/3763185 · Cited by 4
Metadata
- Authors
- Chen, T., Li, X., Luo, X., & Zhang, X.
- Venue
- 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER)
- Publisher
- IEEE
- Published
- 2017-02
- Pages
- 442-446
- OpenAlex
- W2598139937
- Cited by
- 394
- References
- 9
- FWCI
- 33.67
- Type
- conference paper
- Language
- en
- Open access
- green
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.