Enhanced Smart Contract Vulnerability Detection via Graph Neural Networks: Achieving High Accuracy and Efficiency

Chang Xu*, Huaiyu Xu, Liehuang Zhu, Xiaodong Shen, Kashif Sharif

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

Abstract

As blockchain technology becomes prevalent, smart contracts have shown significant utility in finance and supply chain management. However, vulnerabilities in smart contracts pose serious threats to blockchain security, leading to substantial economic losses. Therefore, developing effective vulnerability detection solutions is urgent. To address this issue, we propose a method for detecting vulnerabilities in smart contracts using graph neural networks (GNNs) that can identify eight common vulnerabilities. Our method is fully automated, applicable to all Ethereum smart contracts, and does not require expert-defined rules or manually defined features. We extract the Control Flow Graph and Abstract Syntax Graph from the smart contract code, which are then processed by a GNN to generate feature vectors for classification. Experiments on a real Ethereum dataset demonstrate that our method significantly outperforms existing state-of-the-art approaches. For individual detection tasks, the combined source code and bytecode method achieves an average accuracy of 95.78%, with a peak of 99.13%, and an average F1 score of 93.80%. Compared to competitors, our method shows an average improvement of 51.92% in accuracy and 47.21% in F1 score. The bytecode-only method achieves an average accuracy of 94.68% and an F1 score of 92.36%. For multi-class tasks, both methods achieve high accuracies of 91.26% and 87.34%, with F1 scores of 97.42% and 96.43%, respectively.

Original languageEnglish
Pages (from-to)1854-1865
Number of pages12
JournalIEEE Transactions on Software Engineering
Volume51
Issue number6
DOIs
Publication statusPublished - 2025
Externally publishedYes

Keywords

  • Ethereum
  • Smart contract
  • blockchain
  • graph neural network
  • vulnerability detection

Fingerprint

Dive into the research topics of 'Enhanced Smart Contract Vulnerability Detection via Graph Neural Networks: Achieving High Accuracy and Efficiency'. Together they form a unique fingerprint.

Cite this