Profiling Gas Consumption in Solidity Smart Contracts
Andrea Di Sorbo, Sonia Laudanna, Anna Vacca, Corrado A. Visaggio,, Gerardo Canfora

TL;DR
This paper identifies 19 code smells in Solidity smart contracts that impact gas costs, proposes a set of metrics to evaluate code quality related to gas consumption, and validates their effectiveness through an extensive experiment.
Contribution
It introduces GasMet, a novel suite of metrics for assessing Solidity smart contract quality concerning gas efficiency, and empirically validates their relevance.
Findings
19 code smells affect gas costs
GasMet metrics correlate with deployment costs
Metrics help identify optimization opportunities
Abstract
Nowadays, more and more applications are developed for running on a distributed ledger technology, namely dApps. The business logic of dApps is usually implemented within smart contracts developed through Solidity, a programming language for writing smart contracts on different blockchain platforms, including the popular Ethereum. In Ethereum, the smart contracts run on the machines of miners and the gas corresponds to the execution fee compensating such computing resources. However, the deployment and execution costs of a smart contract depend on the implementation choices done by developers. Unappropriated design choices could lead to higher gas consumption than necessary. In this paper, we (i) identify a set of 19 Solidity code smells affecting the deployment and transaction costs of a smart contract, and (ii) assess the relevance of such smells through a survey involving 34…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsBlockchain Technology Applications and Security · Mobile Crowdsensing and Crowdsourcing · Green IT and Sustainability
