GaSaver: A Static Analysis Tool for Saving Gas
Lists
Only you see this
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 <inline-formula><tex-math notation="LaTeX">$\%$</tex-math></inline-formula> of the 1172 smart contracts suffer from gas-expensive patterns, 94.27 <inline-formula><tex-math notation="LaTeX">$\%$</tex-math></inline-formula> of 1100 new smart contracts are gas-expensive, and 80.56 <inline-formula><tex-math notation="LaTeX">$\%$</tex-math></inline-formula> 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.
BibTeX
@article{zhao2023gasaver,
author = {Ziyi Zhao and Jiliang Li and Zhou Su and Yuyi Wang},
title = {{GaSaver: A Static Analysis Tool for Saving Gas}},
journal = {IEEE Trans. Sustain. Comput.},
year = {2023},
url = {https://openreview.net/forum?id=ycOaGBlNEU},
}Loading related content...