首页 | 官方网站   微博 | 高级检索  
     

Characterizing and Detecting Gas-Inefficient Patterns in Smart Contracts
作者姓名:孔雀屏  王子彦  黄袁  陈湘萍  周晓聪  郑子彬  黄罡
作者单位:School of Computer Science and Engineering;School of Software Engineering;Guangdong Key Laboratory for Big Data Analysis and Simulation of Public Opinion;Peking University Shenzhen Graduate School
基金项目:supported by the Key-Area Research and Development Program of Guangdong Province of China under Grant No.2020B010164002;the National Natural Science Foundation of China under Grant No.62032025.
摘    要: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 25,000 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 160,000 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.

关 键 词:smart  contract  ANTI-PATTERN  detection  optimization  empirical  study
收稿时间:2021-06-02

Characterizing and Detecting Gas-Inefficient Patterns in Smart Contracts
Que-Ping Kong,Zi-Yan Wang,Yuan Huang,Xiang-Ping Chen,Xiao-Cong Zhou,Zi-Bin Zheng,Gang Huang.Characterizing and Detecting Gas-Inefficient Patterns in Smart Contracts[J].Journal of Computer Science and Technology,2022,37(1):67-82.
Authors:Que-Ping Kong  Zi-Yan Wang  Yuan Huang  Xiang-Ping Chen  Xiao-Cong Zhou  Zi-Bin Zheng  Gang Huang
Affiliation:1.School of Computer Science and Engineering, Sun Yat-sen University, Guangzhou 510006, China;2.School of Software Engineering, Sun Yat-sen University, Zhuhai 519082, China;3.Guangdong Key Laboratory for Big Data Analysis and Simulation of Public Opinion, School of Communication and Design, Sun Yat-sen University, Guangzhou 510006, China;4.Peking University Shenzhen Graduate School, Shenzhen 518000, China
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 25,000 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 160,000 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.
Keywords:smart contract  anti-pattern  detection  optimization  empirical study  
本文献已被 维普 等数据库收录!
点击此处可从《计算机科学技术学报》浏览原始摘要信息
点击此处可从《计算机科学技术学报》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号