A General Smart Contract Vulnerability Detection Framework with Self-attention Graph Pooling
摘要
In recent years, the increasing development of Web 3.0 has generated growing attention toward blockchain and smart contracts. However, due to their immutability, smart contracts still exhibit various vulnerabilities that hackers can exploit, resulting in significant losses. Numerous smart contracts on various blockchains, including Ethereum, have been attacked due to various vulnerabilities. The inefficiency of detecting these vulnerabilities has become a major bottleneck in advancing blockchain and smart contracts. Although detecting smart contract vulnerabilities has attracted much attention, most existing machine learning-based methods rely on adequate expert knowledge and target only specific known vulnerabilities via binary classification models. To address this limitation, our proposed approach introduced a general vulnerability detection method that can be applied to identify various common vulnerabilities via a uniform framework. We leveraged the Abstract Syntax Trees (AST) and self-attention-based graph pooling models to generate topological graphs from smart contract code analysis. We adopted Graph Neural Networks for vulnerability detection. Experimental results demonstrated that the proposed approach exhibited satisfactory performance in detecting multiple and unseen vulnerabilities compared to traditional methods.