计算机应用研究2023,Vol.40Issue(12):3545-3550,6.DOI:10.19734/j.issn.1001-3695.2023.04.0174
基于网络度量元的Solidity智能合约缺陷预测
Defect prediction for Solidity smart contracts using network metrics
摘要
Abstract
Existing smart contract defect prediction methods are not aware of the impact of the internal structure of contracts on defects prediction.To fill this gap,this paper proposed a novel Solidity smart contract defect prediction method based on a network metric suite.Firstly,it constructed the abstract syntax tree(AST)of the solidity smart contract by using the Solidity-Antlr4 tool.Secondly,it built the contract network based on the AST,with nodes representing functions and attributes,and ed-ges representing the function-call relationship between functions and the operation relationship between functions and attri-butes.Then,it introduced the theory in the field of complex networks to build a network metric suite for Solidity smart contracts.Finally,it build smart contract defect prediction models based on multiple regression and classification models,and compared the performance of different metric in smart contract defect prediction.Comparative results show that defect prediction models combined with network metric suite outperform corresponding models without the network metric suite.关键词
智能合约/软件缺陷预测/网络度量元集/Solidity/抽象语法树Key words
smart contract/software defect prediction/network metrics suite/Solidity/abstract syntax tree分类
信息技术与安全科学引用本文复制引用
李显伟,潘伟丰,王家乐,潘云,袁成祥..基于网络度量元的Solidity智能合约缺陷预测[J].计算机应用研究,2023,40(12):3545-3550,6.基金项目
浙江省科技厅公益项目(LGF19F020007) (LGF19F020007)
国家自然科学基金资助项目(62272412,61976187) (62272412,61976187)
浙江省自然科学基金资助项目(LY22F020007) (LY22F020007)