A framework to optimize gas cost for Ethereum smart contracts
Abstract
In blockchain-based systems, smart contracts facilitate transparent and automated transactions. However, since gas is needed for every operation carried out on the blockchain, inefficient smart contract design can greatly raise gas costs. In this paper, using our defined review criteria, we review existing literature on gas optimization techniques. We classify these reviewed works into four different levels of optimization. Using this classification, we identify a gap and propose our framework to fill the identified gap. Further, using two case studies of practical life, we test the smart contracts for gas consumption. For these case studies, to evaluate the effectiveness of our proposed techniques, smart contracts are tested under three configurations: baseline implementation, compiler optimization, and full architectural optimization. According to experimental findings, the full architectural optimization decreased gas consumption on average by 35.31% in both case studies.