Characterizing Transaction-Reverting Statements in Ethereum Smart Contracts

08/24/2021
by   Lu Liu, et al.
0

Smart contracts are programs running on blockchain to execute transactions. When input constraints or security properties are violated at runtime, the transaction being executed by a smart contract needs to be reverted to avoid undesirable consequences. On Ethereum, the most popular blockchain that supports smart contracts, developers can choose among three transaction-reverting statements (i.e., require, if...revert, and if...throw) to handle anomalous transactions. While these transaction-reverting statements are vital for preventing smart contracts from exhibiting abnormal behaviors or suffering malicious attacks, there is limited understanding of how they are used in practice. In this work, we perform the first empirical study to characterize transaction-reverting statements in Ethereum smart contracts. We measured the prevalence of these statements in 3,866 verified smart contracts from popular dapps and built a taxonomy of their purposes via manually analyzing 557 transaction-reverting statements. We also compared template contracts and their corresponding custom contracts to understand how developers customize the use of transaction-reverting statements. Finally, we analyzed the security impact of transaction-reverting statements by removing them from smart contracts and comparing the mutated contracts against the original ones. Our study led to important findings, which can shed light on further research in the broad area of smart contract quality assurance and provide practical guidance to smart contract developers on the appropriate use of transaction-reverting statements.

READ FULL TEXT
research
07/22/2019

Truffle tests for free – Replaying Ethereum smart contracts for transparency

The Ethereum blockchain is essentially a globally replicated public data...
research
07/19/2018

Performance Evaluation of the Quorum Blockchain Platform

Quorum is a permissioned blockchain platform built from the Ethereum cod...
research
02/05/2021

Frontrunner Jones and the Raiders of the Dark Forest: An Empirical Study of Frontrunning on the Ethereum Blockchain

Ethereum prospered the inception of a plethora of smart contract applica...
research
06/16/2021

iBatch: Saving Ethereum Fees via Secure and Cost-Effective Batching of Smart-Contract Invocations

This paper presents iBatch, a middleware system running on top of an ope...
research
05/10/2021

Forsage: Anatomy of a Smart-Contract Pyramid Scheme

Pyramid schemes are investment scams in which top-level participants in ...
research
06/17/2022

What makes Ethereum blockchain transactions be processed fast or slow? An empirical study

The Ethereum platform allows developers to implement and deploy applicat...
research
05/29/2019

Read-Uncommitted Transactions for Smart Contract Performance

Smart contract transactions demonstrate issues of performance and correc...

Please sign up or login with your details

Forgot password? Click here to reset