A Multimodal-based Approach for Smart Contract Vulnerability Detection
摘要
As blockchain technology continues to advance rapidly, vulnerabilities in smart contracts can lead to severe issues such as user asset losses and privacy leakage. Existing vulnerability detection techniques largely depend on rule sets defined by experts, leading to inefficiency. Machine learning-based approaches, on the other hand, often focus on extracting contract features from a single characteristic or employ a single deep learning model, thus failing to make full use of the information embedded in smart contracts. To overcome these limitations and improve detection accuracy, this research presents a multimodal feature fusion method designed to identify vulnerabilities within smart contracts. By integrating both bytecode image features and opcode textual features, this method facilitates the precise detection of potential security flaws within smart contracts. Specifically, a residual convolutional neural network is utilized to extract local structural characteristics from bytecode images, whereas a triple-attention mechanism network captures the semantic representations of opcodes. Subsequently, a cross-modal Transformer module is designed to facilitate deep feature interaction, establishing correlations between bytecode and opcodes through an attention mechanism with multiple heads. To address the class imbalance problem, a normal-contract-enhanced classifier is introduced, which significantly improves the accuracy of normal contract identification. According to experimental analysis, our method consistently achieves detection accuracy above 90% for reentrancy, integer overflow, and timestamp dependency issues. Furthermore, ablation studies confirm that the multimodal fusion approach yields substantial improvements compared with single-modality methods.