Integrating Pretrained Models with Graph Neural Networks for Smart Contract Interpretability
摘要
The rapid development of blockchain technology has driven the widespread use of smart contracts, but the ensuing security issues have attracted widespread attention. Smart contract vulnerabilities have led to hundreds of millions of dollars of property losses, while existing detection methods are less effective in terms of validity and difficult to effectively explain the causes of vulnerabilities. To this end, this paper proposes a novel Token-Graph model, which extracts function semantic features by pre-training the model and constructs the graph structure by combining the function call relationships. In addition, we trace suspicious functions and their calling relationships to present the risk propagation due to function calls. We compare with 9 vulnerability detection tools on 2,893 contracts. The experimental results show that the Token-Graph model significantly outperforms existing methods in terms of accuracy (86.4%), recall (80.60%), precision (79.02%), and F1-score (79.80%). In addition, we demonstrate the advantages of the model in terms of vulnerability detection interpretability using real cases.