Abstract
Smart contracts are programmable protocols that run on Ethereum and require gas to be deployed and used. Gas-expensive operations in some smart contracts can cause users to consume extra gas in transactions. There are already several methods to detect gas-expensive patterns in smart contracts. However, some problems still need to be solved: most static analysis methods are based on specialist knowledge, and the patterns used to detect gas-expensive patterns must be manually summarized before the detection methods can be applied. Furthermore, due to the explosive growth of smart contracts, which generate a large amount of data, it is challenging to reuse these methods across different patterns. To address these issues, this work first proposes a new learning-based method, ExpenGas, based on the idea of evolutionary computation-based machine learning to detect Expensive Operation patterns of smart contracts through pre-trained techniques and multi-crucial data flow graphs. The low complexity of the multi-crucial data flow graph enables the model to focus on key features. Finally, by testing on 21981 smart contract files, ExpenGas has 83.05% accuracy and 91.96% recall in detecting the Expensive Operation patterns of gas-expensive patterns, which is significantly more optimal than the current state-of-the-art methods.
| Original language | English |
|---|---|
| Article number | 110542 |
| Journal | Applied Soft Computing Journal |
| Volume | 145 |
| DOIs | |
| State | Published - Sep 2023 |
Keywords
- Code optimization
- Expensive Operation
- Pre-trained model
- Smart contract
Fingerprint
Dive into the research topics of 'Gas-expensive patterns detection to optimize smart contracts'. Together they form a unique fingerprint.Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver