With the wide use of blockchain technology, the security of smart contracts has attracted wide attention. The conversion of smart contract source code to bytecode will lose some semantic information, and the existing deep learning vulnerability detection methods cannot detect reentrancy vulnerabilities and timestamp vulnerabilities well. This paper proposed a smart contract source vulnerability detection method (GNN-film) based on feature-wise modulation graph neural network. Firstly, the characteristics of reentrancy vulnerabilities and timestamp vulnerabilities were analyzed, the graph structure was constructed and simplified by using smart contract source code. Secondly, constructing the model of feature-wise linear modulation graph neural network, and getting accurate representation of contract vulnerability features by using the powerful feature modulation ability of the model. Finally, put simplified graph structure data into the model to obtain the detection results. The experimental results show that the detection accuracy of reentrancy vulnerability and timestamp vulnerability is 91.00% and 91.64% respectively, which is 4.20 and 9.70 percentage points higher than that of graph neural network method. It is proved that the detection ability of this method for related vulnerabilities is better than other detection tools.
WRIGHTC S. Bitcoin: A peer-to-peer electronic cash system [J]. SSRN Electronic Journal, 2008: 1-9.
[2]
DI PIERROM. What is the blockchain?[J]. Computing in Science & Engineering, 2017, 19(5): 92-95
[3]
BUTERINV. A next-generation smart contract and decentralized application platform[EB/OL].[2023-11-22].
[4]
GARFATTAI, KLAIK, GAALOULW, et al. A survey on formal verification for solidity smart contracts[C]//2021 Australasian Computer Science Week Multiconference, 2021: 1-10.
[5]
TORRESC F, SCHUTTEJ, STATER. Osiris: Hunting for integer bugs in ethereum smart contracts[C]//Proceedings of the 34th Annual Computer Security Applications Conference, 2018, 664⁃676.
[6]
JIANGB, LIUY, CHANW K. Contractfuzzer: Fuzzing smart contracts for vulnerability detection[C]//33rd ACM/IEEE International Conference on Automated Software Engineering(ASE). IEEE: 2018, 259⁃269.
[7]
TIKHOMIROVS, VOSKRESENSKAYAE, IVANITSKIYI,et al.SmartCheck: static analysis of ethereum smart contracts[C]//Proceedings of the 2018 IEEE/ACM 1st International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB).Gpthenburg: IEEE,2018: 9-16.
[8]
QIANP, LIUZ, HEQ, et al.Towards automated reentrancy detection for smart contracts based on sequential models[J]. IEEE Access, 2020, 8: 19685⁃19695.
ZHANGZheng, ZHANGXingna, ZhuoLYU, et al.Detecting vulnerabilities in smart contracts based on deep learning models[J]. Journal of Chongqing University of Posts and Telecommunications(Natural Science Edition ), 2022,34(5): 914-920.(in Chinese)
BAIYingmin, SHIZhibin, XINWenge, et al. Research on smart contract vulnerability detection method based on word embedding and shapelet time series features[J]. Journal of North University of China (Natural Science Edition), 2023, 44(4): 381-387.(in Chinese)
[16]
BROCKSCHMIDTM. GNN-FiLM: Graph neural networks with feature-wise linear modulation[DB/OL]. (2019-06-28)[2023-11-22].
[17]
ALLAMANISM, BROCKSCHMIDTM, KHADEMIM.Learning to represent programs with graphs.[DB/OL]. (2017-11-01)[2023-11-22].
WANGShouliang.A source code vulnerability detection scheme based on code sequence and graph structure[J].Journal of North University of China(Natural Science Edition), 2023, 44(6): 641-653.(in Chinese)
[20]
孙逊. 基于图注意力网络的智能合约漏洞检测[D].成都: 电子科技大学, 2022.
[21]
HAMILTONW L, YINGR, LESKOVECJ. Inductive representation learning on large graphs[C]//Proceedings of the 31st International Conference on Neural Information Processing Systems, 2017: 1025⁃1035.
[22]
DURIEUXT, FERREIRAJ F, ABREUR,et al.Empirical review of automated analysis tools on 47,587 ethereum smart contracts[C]//Proceedings of the 2020 ACM/IEEE 42nd International Conference on Software Engineering (ICSE).Seoul: IEEE,2020: 530⁃541.