Under-optimized smart contracts devour your money

Ting Chen, Xiaoqi Li, Xiapu Luo, Xiaosong Zhang

Research output: Chapter in book / Conference proceedingConference article published in proceeding or bookAcademic researchpeer-review

131 Citations (Scopus)

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.
Original languageEnglish
Title of host publicationSANER 2017 - 24th IEEE International Conference on Software Analysis, Evolution, and Reengineering
PublisherIEEE
Pages442-446
Number of pages5
ISBN (Electronic)9781509055012
DOIs
Publication statusPublished - 21 Mar 2017
Event24th IEEE International Conference on Software Analysis, Evolution, and Reengineering, SANER 2017 - Klagenfurt, Austria
Duration: 21 Feb 201724 Feb 2017

Conference

Conference24th IEEE International Conference on Software Analysis, Evolution, and Reengineering, SANER 2017
Country/TerritoryAustria
CityKlagenfurt
Period21/02/1724/02/17

ASJC Scopus subject areas

  • Software

Cite this