Smart contracts are a core component of blockchain technology and are widely deployed across various scenarios. However, atomicity violations have become a potential security risk. Existing analysis tools often lack the precision required to detect these issues effectively. To address this challenge, we introduce AtomGraph, an automated framework designed for detecting atomicity violations. This framework leverages Graph Convolutional Networks (GCN) to identify atomicity violations through multimodal feature learning and fusion. Specifically, driven by a collaborative learning mechanism, the model simultaneously learns from two heterogeneous modalities: extracting structural topological features from the contract's Control Flow Graph (CFG) and uncovering deep semantics from its opcode sequence. We designed an adaptive weighted fusion mechanism to dynamically adjust the weights of features from each modality to achieve optimal feature fusion. Finally, GCN detects graph-level atomicity violation on the contract. Comprehensive experimental evaluations demonstrate that AtomGraph achieves 96.88% accuracy and 96.97% F1 score, outperforming existing tools. Furthermore, compared to the concatenation fusion model, AtomGraph improves the F1 score by 6.4%, proving its potential in smart contract security detection.
翻译:智能合约作为区块链技术的核心组件,已在多种场景中广泛应用。然而,原子性违规已成为潜在的安全威胁。现有分析工具在检测此类问题时往往缺乏足够的精度。为应对这一挑战,本文提出AtomGraph——一种用于检测原子性违规的自动化框架。该框架利用图卷积网络(GCN)通过多模态特征学习与融合来识别原子性违规。具体而言,在协同学习机制的驱动下,模型同时从两种异构模态中学习:从合约的控制流图(CFG)中提取结构拓扑特征,并从其操作码序列中挖掘深层语义信息。我们设计了一种自适应加权融合机制,动态调整各模态特征的权重以实现最优特征融合。最终,GCN在合约层面进行图级原子性违规检测。综合实验评估表明,AtomGraph实现了96.88%的准确率和96.97%的F1分数,性能优于现有工具。此外,与拼接融合模型相比,AtomGraph将F1分数提升了6.4%,证明了其在智能合约安全检测领域的潜力。