skip to main content
10.1145/3183399.3183420acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Towards saving money in using smart contracts

Authors Info & Claims
Published:27 May 2018Publication History

ABSTRACT

Being a new kind of software leveraging blockchain to execute real contracts, smart contracts are in great demand due to many advantages. Ethereum is the largest blockchain platform that supports smart contracts by running them in its virtual machine. To ensure that a smart contract will terminate eventually and prevent abuse of resources, Ethereum charges the developers for deploying smart contracts and the users for executing smart contracts. Although our previous work shows that under-optimized smart contracts may cost more money than necessary, it just lists 7 anti-patterns and the detection method for 3 of them. In this paper, we conduct the first in-depth investigation on such under-optimized smart contracts. We first identify 24 anti-patterns from the execution traces of real smart contracts. Then, we design and develop GasReducer, the first tool to automatically detect all these anti-patterns from the bytecode of smart contracts and replace them with efficient code through bytecode-to-bytecode optimization. Using GasReducer to analyze all smart contracts and their execution traces, we detect 9,490,768 and 557,565,754 anti-pattern instances in deploying and invoking smart contracts, respectively.

References

  1. S. Bansal and A. Aiken. 2006. Automatic generation of peephole superoptimizers. In Proc. ASPLOS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Bansal and A. Aiken. 2008. Binary translation using peephole superoptimizers. In Proc. OSDI. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. K. Bhargavan and et al. 2016. Formal Verification of Smart Contracts: Short Paper. In Proc. PLAS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. T. Chen, X. Li, X. Luo, and X. Zhang. 2017. Under-optimized smart contracts devour your money. In Proc. SANER.Google ScholarGoogle Scholar
  5. T. Chen, X. Li, Y. Wang, J. Chen, Z. Li, X. Luo, M. Au, and X. Zhang. 2017. An Adaptive Gas Cost Mechanism for Ethereum to Defend Against Under-Priced DoS Attacks. In Proc. ISPEC.Google ScholarGoogle Scholar
  6. L. Luu, D. H. Chu, H. Olickel, P. Saxena, and A. Hobor. 2016. Making smart contracts smarter. In Proc. CCS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Angela Ruth. 2016. Why build decentralized applications: understanding Dapp. (2016). https://goo.gl/U5RBSsGoogle ScholarGoogle Scholar
  8. Jeffrey Wilcke. 2016. The Ethereum network is currently undergoing a DoS attack. (2016). https://goo.gl/QvW7KjGoogle ScholarGoogle Scholar
  9. G. Wood. 2016. Ethereum: a secure decentralised transaction ledger, EIP-150 revision. (2016). http://gavwood.com/paper.pdfGoogle ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Conferences
    ICSE-NIER '18: Proceedings of the 40th International Conference on Software Engineering: New Ideas and Emerging Results
    May 2018
    130 pages
    ISBN:9781450356626
    DOI:10.1145/3183399

    Copyright © 2018 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 27 May 2018

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Upcoming Conference

    ICSE 2025

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader