Abstract:
To address the issues of high false positives and false negatives, lack of intuitiveness in detection results, and insufficient interpretability in the analysis process, which are common in traditional blockchain smart contract code vulnerability detection methods, a visual analysis approach for smart contract code vulnerability detection is proposed, and BCodeVis, a visual analysis tool, is designed and implemented. The proposed method builds a multi-label classification model based on CodeBERT to effectively detect eight types of code vulnerabilities in smart contracts. The design of multiple views enables users to explore the performance of the vulnerability detection model and discover anomalies in contract code through visual interaction at three levels: macro statistics, meso analysis, and micro code. Case studies and user evaluation demonstrate that BCodeVis enhances users’ ability to analyze and address smart contract code vulnerabilities, providing an effective solution for the security of blockchain platforms.