Intelligent contract vulnerability detection method
A technology for smart contracts and vulnerability detection, applied in the fields of instruments, computing, electrical and digital data processing, etc., can solve problems such as poor training effect and inability to identify smart contract vulnerabilities well, and achieve the effect of shortening the training process.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0028] see figure 1 , the present embodiment provides a smart contract vulnerability detection method, including the following steps:
[0029] Step S1: Call an existing smart contract with vulnerability detection from the database as a training sample, which is called a smart contract training sample. In order to generate a training opcode corresponding to the smart contract training sample, first crawl the smart contract training sample The Solidity source code, using the Solc compiler to compile the Solidity source code into bytecode, the bytecode generates the original opcode according to the corresponding relationship in the Ethereum Yellow Paper, it can be found that the operands in the original opcode and the smart contract training samples There is no correlation between vulnerabilities, so this embodiment removes operands from the original opcode to obtain the training opcode, which corresponds to the smart contract training sample, and the training opcode is relative ...
Embodiment 2
[0053] There are various types of smart contract vulnerabilities, and different types of vulnerability repair solutions are also very different. In order to further determine the types of smart contract vulnerabilities and determine the vulnerability repair solutions, the difference between this embodiment and embodiment 1 is that Step S2' is also included. Step S2' is a classifier training process, located between step S2 and step S3.
[0054] Specifically, step S2' is carried out as follows:
[0055] For a set of negative training opcode fragments that have been constructed, input it to the Transformer model after training, and then the Transformer model outputs the classifier training data. In addition, a corresponding vulnerability information matrix is constructed for the negative training opcode fragment set, and the vulnerability information matrix contains various types of vulnerability information. For example, there are five common types of smart contract vulnerab...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 
