Structure-guided Multi-branch Graph Fusion for Smart Contract Vulnerability Detection
Abstract
Smart contract vulnerability detection is essential for ensuring the security and reliability of blockchain applications. Existing program analysis methods rely heavily on handcrafted rules and often generalize poorly to contracts with complex control flow, whereas many learning-based methods depend on a single graph representation and therefore fail to capture multi-level structural semantics sufficiently. To address these limitations, we propose SMGF, a structure-guided multi-branch graph fusion framework for smart contract vulnerability detection. SMGF converts smart contract bytecode into control flow graphs, extracts global structural descriptors, and employs four graph neural networks—GCN, GAT, GGNN, and GraphSAGE—in parallel to learn complementary representations. A structure-guided attention mechanism then adaptively fuses these representations according to contract-level structural characteristics, yielding more robust vulnerability predictions. Experiments on four representative vulnerability categories show that SMGF consistently outperforms both traditional program analysis methods and representative learning-based baselines. In particular, it achieves F1-scores of 81.19%, 87.76%, 80.30%, and 92.71% on reentrancy, timestamp dependency, arithmetic errors, and delegatecall, respectively.