Abstract:
The most significant feature of Blockchain 2.0 is the introduction of support for smart contracts, which enables the blockchain to run various applications. The smart contract is a type of computer software that runs automatically according to pre-defined code logic. Distinguished from traditional software, smart contracts are empowered by blockchain technology with the ability to execute correctly on mutually untrusted nodes without relying on a trusted central authority, making them widely used in areas such as digital payments and the sharing economy. To prevent the waste of computing resources caused by the abuse of smart contracts, blockchains such as Ethereum charges Gas fees for two activities, deployment and execution of smart contracts. The computing resource consumed by smart contracts is the factor that determines the cost. Smart contracts with inefficient code are wasteful of resources and vulnerable to attacks, and the developers and users of them suffer unnecessary costs. Therefore, optimizing smart contracts to save resources has become a critical issue for developers and researchers. This survey first analyzes the main challenges of Gas optimization for smart contracts in detail, and then reviews and summarizes the various optimization techniques proposed in recent years. Finally, we discuss future work, which provides references for developers and researchers who explore smart contracts.