loading page

GuessGas:Tell me Fine-Grained Gas Consumption of My Smart Contract and Why
  • +2
  • Qing Huang,
  • Renxiong Chen,
  • Jinshan Zeng,
  • Qinghua Lu,
  • Xiwei Xu
Qing Huang
Author Profile
Renxiong Chen
Jiangxi Normal University

Corresponding Author:[email protected]

Author Profile
Jinshan Zeng
Author Profile
Qinghua Lu
Author Profile


Smart contracts with excessive gas consumption can cause economic losses, such as black hole contracts. Acutal gas consumption depends on runtime information and has a probability distribution under different runtime situations. However, existing static analysis tools (e.g., Solc) cannot define runtime information and only provide an approximate upper bound on gas consumption without explanation. To address the challenge, we propose a label named GCL, which describes the probability distribution of Gas consumption, a code representation method containing domain features and a Graph Neural Network named Attention-based Graph Isomorphism Network (AGIN) oriented to domain feature, and SubgraphGas, a domain-oriented subgraph-level GNN explanation model. By combining AGIN and SubgraphGas, we have created a new explainable gas consumption prediction model (EGE). Our evaluations show that EGE outperforms prediction schemes based on Bi-LSTM. And EGE has similar explainability accuracy to general methods, but it is more efficient.
18 May 2024Submitted to TechRxiv
24 May 2024Published in TechRxiv