Answers are grounded in this paper and cite their sources.
Analysis reveals significant gas savings in smart contracts, indicating effective function equivalence through optimization methods.
Deploying smart contracts and invoking their functions on block-chains incur gas costs, which depend on the operations executed by those functions. This makes optimizing the gas cost of smart contract functions a rewarding goal. However, existing approaches to gas cost optimization of smart contracts mainly involve rule-based optimization or automatic optimization for specific types of patterns. In this paper, we discuss a novel approach to automatically retrieving optimized versions of Solidity functions from a repository of smart contracts. The system identifies and suggests gas-efficient alternatives that maintain functional equivalence by comparing the opcode sequences of individual functions. We evaluate this approach on a dataset of 16,529 functions from real-world contracts, demonstrating substantial gas savings, as high as 34% on average when considering the most similar functions.
No takes yet. Share an insight, caveat, or question.
Avik et al. (2025) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: