Intelligent Smart Contract Vulnerability Detection Using Graph Neural Networks and Explainable Artificial Intelligence
DOI:
https://doi.org/10.66592/dfgw246tpKeywords:
Smart contracts; graph neural networks; explainable artificial intelligence; blockchain security; vulnerability detection; heterogeneous graphs; Solidity; code auditingAbstract
Smart contracts automate asset transfers and decentralized application logic, yet their immutability and compositional complexity amplify the consequences of implementation defects. This paper proposes XG-SCV, an explainable heterogeneous graph neural network framework for vulnerability detection and source-level localization. Solidity source code is transformed into a typed graph combining abstract syntax, control flow, data dependence, external calls, and cross-function storage interactions. Relation-aware message passing and attention-based pooling produce multi-label vulnerability probabilities, while integrated gradients and graph-substructure attribution provide auditable explanations. The evaluation protocol emphasizes project-disjoint splits, duplicate removal, calibrated thresholds, class imbalance, and explanation fidelity. An illustrative numerical study demonstrates how the proposed model could be compared with static analysis and neural baselines; these illustrative numbers are not empirical findings. The framework offers a reproducible research design for detecting reentrancy, access-control weaknesses, unchecked external calls, arithmetic risks, and timestamp dependence while retaining interpretable evidence for developer review.