Litcius/Paper detail

GasChecker: Scalable Analysis for Discovering Gas-Inefficient Smart Contracts

Ting Chen, Youzheng Feng, Zihao Li, Hao Zhou, Xiaopu Luo, Xiaoqi Li, Xiuzhuo Xiao, Jiachi Chen, Xiaosong Zhang

2020IEEE Transactions on Emerging Topics in Computing100 citationsDOIOpen Access PDF

Abstract

Ethereum, the largest blockchain for running smart contracts, charges the people who send transactions to deploy or invoke smart contracts for thwarting resource abuse. The amount of transaction fee depends on the size of that contract and the operations executed by that contract. Consequently, smart contracts with inefficient code will waste money. In this article, we propose and develop the first tool, named <monospace xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">GasChecker</monospace> , for automatically identifying gas-inefficient code in smart contracts, and conduct the first empirical study on the prevalence of gas-inefficient code in the deployed smart contracts. More precisely, we first summarize ten gas-inefficient programming patterns and propose a new approach based on symbolic execution (SE) to detect them in the bytecode of smart contracts. To make our approach scalable to analyze millions of smart contracts, we parallelize SE by tailoring it to the MapReduce programming model, and propose a new feedback-based load balancing strategy to effectively utilize cloud resources. Extensive experiments show that <monospace xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">GasChecker</monospace> scales well with the increase of workers. The empirical study demonstrates that lots of real smart contracts contain various inefficient code. Manual investigation demonstrates that only 2.5 percent of discovered gas-inefficient instances are false positives.

Topics & Concepts

BytecodeComputer scienceScalabilityDatabase transactionSmart contractCode (set theory)Cloud computingEmpirical researchDatabaseComputer securityProgramming languageOperating systemJavaSet (abstract data type)EpistemologyPhilosophyBlockchain Technology Applications and SecurityAdvanced Malware Detection TechniquesIoT and Edge/Fog Computing
GasChecker: Scalable Analysis for Discovering Gas-Inefficient Smart Contracts | Litcius