AI Chat Paper
Note: Please note that the following content is generated by AMiner AI. SciOpen does not take any responsibility related to this content.
{{lang === 'zh_CN' ? '文章概述' : 'Summary'}}
{{lang === 'en_US' ? '中' : 'Eng'}}
Chat more with AI
Article Link
Collect
Submit Manuscript
Show Outline
Outline
Show full outline
Hide outline
Outline
Show full outline
Hide outline
Regular Paper

Characterizing and Detecting Gas-Inefficient Patterns in Smart Contracts

School of Computer Science and Engineering, Sun Yat-sen University, Guangzhou 510006, China
School of Software Engineering, Sun Yat-sen University, Zhuhai 519082, China
Guangdong Key Laboratory for Big Data Analysis and Simulation of Public Opinion, School of Communication and Design, Sun Yat-sen University Guangzhou 510006, China
Peking University Shenzhen Graduate School, Shenzhen 518000, China
Show Author Information

Abstract

Ethereum blockchain is a new internetware with tens of millions of smart contracts running on it. Different from general programs, smart contracts are decentralized, tamper-resistant and permanently running. Moreover, to avoid resource abuse, Ethereum charges users for deploying and invoking smart contracts according to the size of contract and the operations executed by contracts. It is necessary to optimize smart contracts to save money. However, since developers are not familiar with the operating environment of smart contracts (i.e., Ethereum virtual machine) or do not pay attention to resource consumption during development, there are many optimization opportunities for smart contracts. To fill this gap, this paper defines six gas-inefficient patterns from more than 25000 posts and proposes an optimization approach at the source code level to let users know clearly where the contract is optimized. To evaluate the prevalence and economic benefits of gas-inefficient patterns, this paper conducts an empirical study on more than 160000 real smart contracts. The promising experimental results demonstrate that 52.75% of contracts contain at least one gas-inefficient pattern proposed in this paper. If these patterns are removed from the contract, at least $0.30 can be saved per contract.

Electronic Supplementary Material

Download File(s)
jcst-37-1-67-Highlights.pdf (155.2 KB)

References

【1】
【1】
 
 
Journal of Computer Science and Technology
Pages 67-82

{{item.num}}

Comments on this article

Go to comment

< Back to all reports

Review Status: {{reviewData.commendedNum}} Commended , {{reviewData.revisionRequiredNum}} Revision Required , {{reviewData.notCommendedNum}} Not Commended Under Peer Review

Review Comment

Close
Close
Cite this article:
Kong Q-P, Wang Z-Y, Huang Y, et al. Characterizing and Detecting Gas-Inefficient Patterns in Smart Contracts. Journal of Computer Science and Technology, 2022, 37(1): 67-82. https://doi.org/10.1007/s11390-021-1674-4

1065

Views

26

Crossref

23

Web of Science

27

Scopus

1

CSCD

Received: 02 June 2021
Accepted: 03 December 2021
Published: 31 January 2022
©Institute of Computing Technology, Chinese Academy of Sciences 2022