AtomGraph: Tackling Atomicity Violation in Smart Contracts using Multimodal GCNs

AtomGraph: Tackling Atomicity Violation in Smart Contracts using Multimodal GCNs
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

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.


💡 Research Summary

AtomGraph is a novel automated framework designed to detect atomicity violations in Ethereum smart contracts with high precision and recall. Atomicity violations occur when a transaction fails to execute in an all‑or‑nothing fashion, leaving the contract in an inconsistent intermediate state. Existing static and dynamic analysis tools either suffer from high false‑positive rates or low coverage, especially for this subtle class of bugs.

The pipeline begins by disassembling contract bytecode according to the EVM specification and partitioning the instruction stream into basic blocks—continuous sequences with a single entry and exit point, delimited by control‑flow instructions such as JUMP, JUMPI, STOP, REVERT, and RETURN. By analyzing jump targets, a complete Control Flow Graph (CFG) is constructed, capturing the exact execution flow of the contract. The CFG is exported in DOT format for downstream processing.

AtomGraph then extracts two heterogeneous modalities from the CFG: (1) a structural modality using Node2Vec to embed the topological relationships among basic blocks, and (2) a semantic modality using Word2Vec to embed opcode sequences within each block. Both embeddings are L2‑normalized before fusion. An adaptive weighted fusion mechanism linearly combines the two vectors as V_fused = α·V_struct + β·V_semantic, subject to α + β = 1. The weights α and β are learned by minimizing validation loss, allowing the model to dynamically emphasize the more informative modality for a given contract. This adaptive fusion outperforms naïve concatenation by 6.4 % in F1 score.

The fused node features are fed into a multi‑layer Graph Convolutional Network (GCN). Each GCN layer follows the propagation rule H^{(l+1)} = σ(Ď^{-1/2}ÂĎ^{-1/2} H^{(l)} W^{(l)}), where  = A + I adds self‑loops, Ď is the degree matrix, σ is a non‑linear activation, and W^{(l)} are trainable weights. Training employs the AdamW optimizer with a dynamic learning‑rate schedule, focus loss to prioritize hard examples, class‑weighting to address imbalance, data augmentation, dropout, and gradient clipping for stability.

Experiments were conducted on a curated dataset of 1,880 contracts (837 benign, 1,043 atomicity‑violating) derived from SmartBugs Wild and DAppSCAN, split 90 %/10 % for training/testing. AtomGraph achieved 96.88 % accuracy, 98.27 % recall, 96.00 % precision, 96.97 % F1, and a false‑positive rate of only 0.05 %. Compared against ten state‑of‑the‑art tools—including static analyzers (Conkas, Vandal), symbolic execution engines (Mythril, Oyente), and pattern‑matching systems (Securify)—AtomGraph consistently outperformed them, especially in recall while maintaining a low FPR.

Performance profiling on an NVIDIA GTX 4070 Ti GPU and an Intel i9‑13900KF CPU showed inference times in the order of a few hundred milliseconds per contract, making the approach viable for both batch and near‑real‑time analysis. The authors also released the source code and experimental data to ensure reproducibility.

Key contributions are: (1) the first systematic study of atomicity‑violation detection in smart contracts, (2) a multimodal learning architecture that jointly leverages CFG topology and opcode semantics, (3) an adaptive weighted fusion mechanism that dynamically balances modalities, (4) empirical validation achieving near‑perfect detection metrics, and (5) open‑source artifacts for community use.

Future work will extend AtomGraph to cross‑contract interaction graphs, support multiple blockchain platforms, and explore reinforcement‑learning‑based detection policies to further improve scalability and robustness.


Comments & Academic Discussion

Loading comments...

Leave a Comment