GaSaver:一种用于节约天然气的静态分析工具

IF 3 3区 计算机科学 Q2 COMPUTER SCIENCE, HARDWARE & ARCHITECTURE IEEE Transactions on Sustainable Computing Pub Date : 2022-11-11 DOI:10.1109/TSUSC.2022.3221444
Ziyi Zhao;Jiliang Li;Zhou Su;Yuyi Wang
{"title":"GaSaver:一种用于节约天然气的静态分析工具","authors":"Ziyi Zhao;Jiliang Li;Zhou Su;Yuyi Wang","doi":"10.1109/TSUSC.2022.3221444","DOIUrl":null,"url":null,"abstract":"Smart contracts are programs running on Ethereum, whose deployment and use require gas. Gas measures the cost of performing specific operations as an index designed to quantify the computing power consumption. Existing unoptimized smart contracts make contract developers and users spend extra gas. To save gas and optimize smart contracts, this paper proposes a new tool named GaSaver for automatically detecting gas-expensive patterns based on Solidity source code. Specifically, we first identify 12 gas-expensive patterns in smart contracts and classify them into three categories: storage-related, judgment-related, and loop-related. Then, we deploy gas-expensive patterns and group them into three levels according to gas waste degree. By conducting extensive experiments on real data sets, we find that 89.68\n<inline-formula><tex-math>$\\%$</tex-math></inline-formula>\n of the 1172 smart contracts suffer from gas-expensive patterns, 94.27\n<inline-formula><tex-math>$\\%$</tex-math></inline-formula>\n of 1100 new smart contracts are gas-expensive, and 80.56\n<inline-formula><tex-math>$\\%$</tex-math></inline-formula>\n of 72 widely used smart contracts are affected. Finally, the experiment results show that the proposed GaSaver can effectively optimize smart contracts. Besides, the proportion of gas-expensive cases in widely used smart contracts is lower than that in the newly released smart contracts.","PeriodicalId":13268,"journal":{"name":"IEEE Transactions on Sustainable Computing","volume":null,"pages":null},"PeriodicalIF":3.0000,"publicationDate":"2022-11-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":"{\"title\":\"GaSaver: A Static Analysis Tool for Saving Gas\",\"authors\":\"Ziyi Zhao;Jiliang Li;Zhou Su;Yuyi Wang\",\"doi\":\"10.1109/TSUSC.2022.3221444\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Smart contracts are programs running on Ethereum, whose deployment and use require gas. Gas measures the cost of performing specific operations as an index designed to quantify the computing power consumption. Existing unoptimized smart contracts make contract developers and users spend extra gas. To save gas and optimize smart contracts, this paper proposes a new tool named GaSaver for automatically detecting gas-expensive patterns based on Solidity source code. Specifically, we first identify 12 gas-expensive patterns in smart contracts and classify them into three categories: storage-related, judgment-related, and loop-related. Then, we deploy gas-expensive patterns and group them into three levels according to gas waste degree. By conducting extensive experiments on real data sets, we find that 89.68\\n<inline-formula><tex-math>$\\\\%$</tex-math></inline-formula>\\n of the 1172 smart contracts suffer from gas-expensive patterns, 94.27\\n<inline-formula><tex-math>$\\\\%$</tex-math></inline-formula>\\n of 1100 new smart contracts are gas-expensive, and 80.56\\n<inline-formula><tex-math>$\\\\%$</tex-math></inline-formula>\\n of 72 widely used smart contracts are affected. Finally, the experiment results show that the proposed GaSaver can effectively optimize smart contracts. Besides, the proportion of gas-expensive cases in widely used smart contracts is lower than that in the newly released smart contracts.\",\"PeriodicalId\":13268,\"journal\":{\"name\":\"IEEE Transactions on Sustainable Computing\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":3.0000,\"publicationDate\":\"2022-11-11\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"1\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"IEEE Transactions on Sustainable Computing\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://ieeexplore.ieee.org/document/9946440/\",\"RegionNum\":3,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q2\",\"JCRName\":\"COMPUTER SCIENCE, HARDWARE & ARCHITECTURE\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Sustainable Computing","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/9946440/","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, HARDWARE & ARCHITECTURE","Score":null,"Total":0}
引用次数: 1

摘要

智能合约是在以太坊上运行的程序,其部署和使用需要天然气。Gas将执行特定操作的成本作为一个指标来衡量,该指标旨在量化计算功耗。现有的未优化智能合约使合约开发者和用户花费额外的汽油。为了节省天然气并优化智能合约,本文提出了一种基于Solidity源代码的自动检测天然气价格模式的新工具GaSaver。具体而言,我们首先识别了智能合约中的12种天然气昂贵模式,并将其分为三类:与存储相关、与判断相关和与循环相关。然后,我们部署气体昂贵模式,并根据气体浪费程度将其分为三个级别。通过对真实数据集进行广泛的实验,我们发现1172个智能合约中有89.68$\%$存在天然气昂贵模式,1100个新的智能合约中94.27$\%$$$$\%$172个广泛使用的智能合约受到影响。最后,实验结果表明,所提出的GaSaver可以有效地优化智能合约。此外,在广泛使用的智能合约中,天然气价格昂贵的案例比例低于最新发布的智能合约。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
GaSaver: A Static Analysis Tool for Saving Gas
Smart contracts are programs running on Ethereum, whose deployment and use require gas. Gas measures the cost of performing specific operations as an index designed to quantify the computing power consumption. Existing unoptimized smart contracts make contract developers and users spend extra gas. To save gas and optimize smart contracts, this paper proposes a new tool named GaSaver for automatically detecting gas-expensive patterns based on Solidity source code. Specifically, we first identify 12 gas-expensive patterns in smart contracts and classify them into three categories: storage-related, judgment-related, and loop-related. Then, we deploy gas-expensive patterns and group them into three levels according to gas waste degree. By conducting extensive experiments on real data sets, we find that 89.68 $\%$ of the 1172 smart contracts suffer from gas-expensive patterns, 94.27 $\%$ of 1100 new smart contracts are gas-expensive, and 80.56 $\%$ of 72 widely used smart contracts are affected. Finally, the experiment results show that the proposed GaSaver can effectively optimize smart contracts. Besides, the proportion of gas-expensive cases in widely used smart contracts is lower than that in the newly released smart contracts.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
IEEE Transactions on Sustainable Computing
IEEE Transactions on Sustainable Computing Mathematics-Control and Optimization
CiteScore
7.70
自引率
2.60%
发文量
54
期刊最新文献
Editorial 2024 Reviewers List Dynamic Outsourced Data Audit Scheme for Merkle Hash Grid-Based Fog Storage With Privacy-Preserving Battery-Aware Workflow Scheduling for Portable Heterogeneous Computing CloudProphet: A Machine Learning-Based Performance Prediction for Public Clouds
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1