Intelligent contract vulnerability detection method and system based on ASTNN and attention mechanism
Through the smart contract vulnerability detection method combining ASTNN and attention mechanism, the existing detection methods are solved, and the existing detection methods are low in automation and high false alarm rate are achieved, high accuracy and automated vulnerability detection are achieved, which significantly improves the security of smart contracts.
Patent Information
- Application Number
- CN202411654004.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-14
AI Technical Summary
The existing smart contract vulnerability detection methods are low in automation, relying on static analysis and manual writing, which is prone to false positives, and the types of vulnerabilities covered are limited, making it difficult to meet the security detection needs of complex smart contracts.
A smart contract vulnerability detection method combining abstract syntax tree neural network (ASTNN) and attention mechanism is adopted to extract syntax and semantic features in the abstract syntax tree of smart contracts through the ASTNN model, and an attention mechanism is introduced, dynamically adjusting the attention intensity of different code segments, fusing the extracted features and automated vulnerability detection with the help of deep learning classifiers.
It significantly improves the security and reliability of smart contract vulnerability detection, realizes automated, fast and high-accuracy vulnerability detection, and can more effectively capture the key security features in smart contracts and enhances the security guarantee of blockchain technology.
Smart Images

Figure CN119622732A_ABST
Abstract
Description
Technical Field
[0001] The present invention proposes a smart contract vulnerability detection method and system combining an abstract syntax tree neural network (ASTNN) and an attention mechanism, which belongs to the application field of smart contract security research and deep learning technology. Background Art
[0002] Blockchain is a distributed, decentralized database technology first proposed by Satoshi Nakamoto in 2008 and widely used through the implementation of Bitcoin. Blockchain combines transaction records into an unalterable data block and stores it on multiple nodes in a chain-like manner. This distributed storage and verification mechanism gives blockchain significant characteristics such as decentralization, tamper-proof, irreversible and traceable, making it show great potential in many fields such as finance, supply chain management, identity authentication and smart contracts.
[0003] As one of the most successful applications of blockchain, smart contracts have been widely studied and applied in academia and industry in recent years. Smart contracts are computer programs that run on blockchains and automatically execute and verify transactions based on preset rules and conditions. An important feature of this mechanism is its automatic execution without any human intervention; once the preset conditions are met, the smart contract will automatically trigger related operations and transactions. In addition, smart contracts are tamper-proof and cannot be updated or modified once deployed on the blockchain, which provides security guarantees.
[0004] Since smart contracts are often used to manage encrypted digital assets (such as Bitcoin and Ethereum), they attract many malicious attackers. Once a smart contract is successfully attacked, it may cause significant economic losses. There have been many famous hacker attacks in history. In 2016, attackers exploited a reentrancy vulnerability in the DAO contract to steal 3.6 million Ethereum coins, causing users to lose $60 million; in 2018, EOS.WIN was attacked by continuous random numbers, and attackers stole more than 20,000 EOS digital currencies. The security vulnerabilities of smart contracts not only lead to huge economic losses, but also undermine people's trust in blockchain and smart contracts. Therefore, vulnerability detection and security prevention for smart contracts are crucial.
[0005] The security of smart contracts is not only related to economic interests, but also to the future development of blockchain technology. With the continuous evolution of blockchain technology, the complexity of smart contracts is also increasing, which puts higher requirements on security detection. Many traditional vulnerability detection tools often appear to be insufficient when facing complex contract logic. In order to ensure the security of smart contracts, more effective and accurate detection methods must be adopted.
[0006] Traditional smart contract vulnerability detection methods are mainly divided into formal verification, symbolic execution, fuzz testing and intermediate representation. Formal verification uses mathematical logic to prove whether smart contracts can achieve their intended goals and whether there are other security risks; symbolic execution collects and explores all execution paths through symbolic program input to find potential vulnerabilities; fuzz testing finds potential vulnerabilities and security issues by inputting random, abnormal or boundary value test cases into smart contracts; intermediate representation converts source code or programs into an abstract form that is independent of specific programming languages, allowing for more efficient vulnerability detection.
[0007] Although these traditional detection methods have a certain theoretical basis, in actual application, many tools still have a low degree of automation, usually relying on static analysis and requiring manual writing or analysis. This means that the results are often subject to the technical level and experience of the analysts, increasing the risk of missed detections and false positives. Traditional tools often generate a large number of false positives during the detection process, resulting in potential vulnerabilities not being discovered and fixed in a timely manner, affecting the accuracy of vulnerability detection, and the types of vulnerabilities covered are relatively limited.
[0008] In order to cope with these challenges in the field of smart contract vulnerability detection, it is urgent to develop more efficient and accurate detection tools. In recent years, deep learning technology has made significant progress in many fields and has become an effective means to improve the automation and accuracy of vulnerability detection tools. Through the training and learning of deep learning algorithms, we can better identify and analyze potential vulnerabilities in smart contracts, thereby providing stronger protection for the security of blockchain technology. Summary of the invention
[0009] Purpose of the invention: In view of the limitations of existing smart contract vulnerability detection methods, the present invention aims to provide a smart contract vulnerability detection method and system based on ASTNN and attention mechanism. The method uses the ASTNN model to extract the grammatical and semantic features in the abstract syntax tree (AST) of the smart contract, and introduces the attention mechanism to dynamically adjust the intensity of attention to different code segments, so as to more effectively capture key security features. By integrating the extracted features and using deep learning classifiers for automated vulnerability detection, the present invention significantly improves the security and reliability of smart contract vulnerability detection, laying a foundation for the healthy development of blockchain technology.
[0010] Technical solution: To achieve the above-mentioned invention purpose, the present invention provides a smart contract vulnerability detection method and system based on ATNN and attention mechanism, comprising the following steps:
[0011] (1) Based on the open source smart contract vulnerability information, source code was collected and processed from Estherscan to generate a labeled data set, and duplicate smart contract files were removed by combining a deduplication algorithm;
[0012] (2) Standardize the content of the smart contract source code and then use a syntax parser to generate an abstract syntax tree (AST);
[0013] (3) The complete sequence after traversing the AST is obtained through the tree depth-first algorithm, which is used as the corpus for word embedding training. The word2vec algorithm is used for word embedding to generate a word embedding matrix.
[0014] (4) According to the defined division rules, the smart contract abstract syntax tree is divided into non-overlapping multi-way statement trees, the corresponding statement tree sequence is traversed, and it is converted into a word embedding vector sequence as a feature vector;
[0015] (5) The feature vector obtained above is used as the input of the model and input into the ASTNN model integrated with the attention mechanism to perform smart contract vulnerability detection and output the obtained vulnerability detection results.
[0016] Preferably, the step (1) comprises the following steps:
[0017] ① Collect open source smart contract vulnerability information and filter out the vulnerability types and provided contract addresses;
[0018] ② Use the API provided by Etherscan to query the corresponding source code according to the contract address;
[0019] ③ Combined with the collected vulnerability information, add corresponding tags to each contract code, save the obtained source code locally or in a database to form a preliminary data set;
[0020] ④ Clean the collected source code, remove invalid characters, blank lines, comments and other non-essential information, and ensure that all smart contract codes follow a consistent format, such as unified indentation, removal of extra spaces, etc.;
[0021] ⑤ Delete duplicates, that is, delete all blank lines and comments and check whether the MD5 checksums of the two source code files are the same, eliminate similar or duplicate smart contract files, and save the processed smart contract vulnerability dataset.
[0022] Preferably, the step (2) comprises the following steps:
[0023] ① In order to effectively eliminate the influence of specific names and focus on the structure and logic of the program, the function name in the smart contract source code is replaced with the general identifier FUN{#}, and the variable name in the smart contract source code is replaced with the general identifier VAR{#}, where # represents the serial number;
[0024] ②Import the syntax parser solidity-parser in the code file to obtain the abstract syntax tree of the smart contract source code file.
[0025] Preferably, the step (3) comprises the following steps:
[0026] ① Implement a recursive function, use the depth-first algorithm to traverse the abstract syntax tree, and get the complete sequence after traversal;
[0027] ② Use all the words in the abstract syntax tree sequence as the training corpus, train the word embedding model word2vec, set appropriate parameters, and save the trained word embedding model for subsequent use.
[0028] Preferably, the step (4) comprises the following steps:
[0029] ① The statement tree refers to a subtree with a statement declaration node as the root node and all related node statements of this statement. According to the specific rules for dividing the statement tree and the segmentation node set P, the complete abstract syntax tree is decomposed into a series of non-overlapping multi-way statement trees;
[0030] ②During the division process, it is necessary to additionally process the nested statement structure in the source code, retain the Block node at the beginning of each statement body, and add the corresponding End node at the end to retain its structural characteristics;
[0031] ③ Visit each node in the statement subtree in depth-first traversal order and add it to the statement subtree sequence;
[0032] ④Convert the sequence into a word embedding vector sequence as the input of the subsequent model.
[0033] Preferably, the step (5) comprises the following steps:
[0034] ① The feature vector is used as the original input of the model and input into the encoding layer constructed by the RvNN recursive neural model. The feature vector of each node is calculated by the vector representation of its child nodes. The node information is transmitted and integrated in a recursive manner to capture the hierarchical relationship between nodes.
[0035] ② Add a multi-head attention mechanism layer after the encoding layer to better weight the node representation, so that the model can dynamically adjust the degree of attention to different feature nodes. Important feature nodes will receive higher weights, thereby enhancing the expressiveness of these features;
[0036] ③ Input the vector of fused attention information obtained in the previous step into the bidirectional GRU model to capture contextual information to improve the model's understanding of the sentence tree features;
[0037] ④The final classification layer takes the output of the bidirectional GRU model as input to obtain the final result of vulnerability classification.
[0038] Beneficial effects: The present invention proposes a smart contract vulnerability detection method and system based on ASTNN and attention mechanism. By collecting a large amount of non-repetitive smart contract source code from the Etherscan platform and marking it, the diversity and effectiveness of the data set are ensured. At the same time, in order to ensure the standardization of the smart contract code, we cleaned the collected source code and standardized the function names and variable names therein. On this basis, the syntax parser solidity_parser is used to generate an abstract syntax tree, and the traversal sequence is obtained through depth-first traversal as the corpus for training the word embedding model word2vec. In the feature extraction stage, the AST is split into non-overlapping multi-way statement trees according to predefined rules. Subsequently, the vector sequence corresponding to the statement tree is processed in combination with the recursive neural network (RvNN) and the multi-head attention mechanism, as well as the bidirectional GRU model, so as to effectively capture the feature information of the smart contract source code and finally output the vulnerability detection result. The present invention makes full use of the characteristics of the abstract syntax tree of smart contracts, combines multiple non-overlapping statement tree sequences with the ASTNN model, and introduces the attention mechanism to significantly improve the ability to capture important features. It can realize automatic, fast and high-accuracy smart contract vulnerability detection, thereby providing a strong guarantee for the security of smart contracts.
[0039] A computer system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the steps of the smart contract vulnerability detection method and system based on ASTNN and attention mechanism are implemented.
[0040] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the smart contract vulnerability detection method and system based on ASTNN and attention mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is an overall step diagram of an embodiment of the present invention; DETAILED DESCRIPTION
[0042] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0043] like Figure 1As shown, a smart contract vulnerability detection method and system based on ASTNN and attention mechanism disclosed in an embodiment of the present invention mainly includes the following steps:
[0044] (1) Based on the open source smart contract vulnerability information, collect the source code of the relevant smart contracts from Etherscan. Use the Etherscan API to query the source code by contract address, and preliminarily organize the obtained source code to form a labeled data set. In this step, detect and remove duplicate smart contract files based on the MD5 checksum algorithm to ensure the uniqueness and validity of the data set;
[0045] (2) The collected smart contract source code is standardized to eliminate the influence of specific names on model training. Function names (such as FUN{#}) and variable names (such as VAR{#}) in smart contracts are replaced with universal identifiers, where # represents a sequence number. Subsequently, a syntax parser (such as solidity_parser) is used to generate an abstract syntax tree (AST) for the processed code for subsequent analysis and feature extraction;
[0046] (3) By implementing a recursive function, the abstract syntax tree is traversed using the tree depth-first algorithm to obtain a complete traversal sequence. This sequence will be used as the corpus for training the word embedding model word2vec. Appropriate parameters are set for training to generate a word embedding matrix, which will provide a basis for subsequent feature extraction;
[0047] (4) According to predefined rules, the abstract syntax tree is divided into non-overlapping multi-way statement trees. Each statement tree is traversed and converted into a corresponding word embedding vector sequence to form a feature vector. These feature vectors will effectively represent the grammatical structure and logical relationship of the source code, preparing for the subsequent model input;
[0048] (5) The input is fed into the ASTNN model combined with the multi-head attention mechanism for smart contract vulnerability detection. The model outputs the final vulnerability detection result by analyzing the feature vector. Using the attention mechanism, the model can dynamically focus on different feature nodes, thereby improving the accuracy and efficiency of vulnerability detection.
[0049] The following is a detailed description of the steps of a smart contract vulnerability detection method and system based on ASTNN and attention mechanism disclosed in an embodiment of the present invention, which are as follows:
[0050] (1) Based on the open source smart contract vulnerability information, collect the source code of the relevant smart contracts from Etherscan. Use the Etherscan API to query the source code by contract address, and preliminarily organize the obtained source code to form a labeled data set. In this step, detect and remove duplicate smart contract files based on the MD5 checksum algorithm to ensure the uniqueness and validity of the data set:
[0051] ① Determine the source of the collected vulnerability information, such as top conference papers, GitHub repositories, etc., to ensure the authority of the data. Create a database table to store each vulnerability type and its corresponding contract address;
[0052] ②Use the Etherscan API interface, write the request code, construct a GET request combined with the contract address, and save the corresponding smart contract source code file;
[0053] ③ Design a csv storage structure to match each contract code with its label to form a preliminary smart contract vulnerability dataset;
[0054] ④Write a cleaning function and use regular expressions to remove invalid characters, blank lines and comments in the source code. Standardize the code format, use a unified indentation style and remove extra spaces;
[0055] ⑤ Calculate the MD5 hash value of each smart contract file, using Python's hashlib library. Create a collection to store unique MD5 hash values, compare the newly generated hash value, and mark it as a duplicate if it already exists. Ensure the uniqueness of the generated data set.
[0056] (2) The collected smart contract source code is standardized to eliminate the influence of specific names on model training. By replacing function names and variable names with common identifiers, the model learning focuses more on the structure and logic of the code rather than specific identifiers. Subsequently, the syntax parser is used to generate an abstract syntax tree, laying the foundation for subsequent analysis and feature extraction. The specific steps are as follows:
[0057] ① Use regular expressions to replace function names and variable names in the source code. Design a dictionary to store the corresponding relationships for later reference;
[0058] ②Install the corresponding solidity_parser parser library and use the syntax parser provided by the library to generate an abstract syntax tree.
[0059] (3) Implement a recursive function to traverse the abstract syntax tree (AST) using a depth-first algorithm to obtain a complete traversal sequence. This sequence will be used as a corpus for training the word embedding model word2vec. Afterwards, use appropriate parameters to train the word2vec model and generate a word embedding matrix to provide a basis for subsequent feature extraction. The specific steps are as follows:
[0060] ① Implement a recursive function to traverse the AST. This function receives AST nodes and performs depth-first traversal, collects node information and generates a traversal sequence;
[0061] ② Use all the words in the sequence generated in the previous step as the training corpus, convert the traversal results into a format suitable for the word2vec model, import it into the word2vec library (such as Gensim), and set appropriate parameters for training.
[0062] (4) Divide the abstract syntax tree (AST) into non-overlapping multi-way statement trees according to predefined rules. Then, traverse each statement tree and convert it into a corresponding word embedding vector sequence to form a feature vector. These feature vectors effectively represent the feature information of the source code and prepare for the input of the subsequent model. The specific steps are as follows:
[0063] ① A statement tree refers to a subtree with a statement declaration node as the root node and all related node statements of this statement structure. Since a nested statement structure usually contains two parts: a statement declaration and a statement body, and there are other sub-expressions in the statement body, it is necessary to customize the rules for splitting nested expression statements into expression declarations and statement bodies. The method declaration and method body parts of nested expressions are split by splitting the node set P. Among them, the split node set P consists of nested nodes such as IfStatement, ForStatement, WhileStatement, EmitStatement, AssemblySwitch, and StructDefinition. All descendants of the statement node s∈S are represented by D(s). For any d∈D(s), if there is a path from s to d through a node p∈P, it means that node d is included in a statement in the body of statement s. We call node d a sub-statement node of s. Then the statement tree (ST tree) with the statement node s∈S as the root is a tree consisting of node s and all its descendants in T that do not include its sub-statement nodes. Thus, the complete abstract syntax tree is decomposed into a series of non-overlapping multi-way statement trees;
[0064] ②During the division process, the nested statement structure in the source code needs to be specially handled. In order to retain its grammatical structure characteristics, a Block node is added at the beginning of each statement body, and a corresponding End node is inserted at the end;
[0065] ③ Visit the nodes in each statement subtree in the order of depth-first traversal and add them to the statement subtree sequence in order. The depth-first traversal method ensures that we can start from the root node and go deep into each child node to form a complete expression sequence, thereby preserving the hierarchical relationship of the source code and providing the necessary context information;
[0066] ④ Combined with the word embedding matrix generated in step (3), convert each sentence subtree sequence into a corresponding word embedding vector sequence;
[0067] (5) Input the feature vector into the ASTNN model combined with the multi-head attention mechanism to detect smart contract vulnerabilities. At this stage, the model generates the final vulnerability detection results through in-depth analysis of the feature vector. With the help of the attention mechanism, the model can dynamically focus on different feature nodes, thereby improving the accuracy and efficiency of vulnerability detection. The specific steps are as follows:
[0068] ① The feature vector is used as the original input of the model and sent to the encoding layer constructed by the recursive neural network (RvNN). In this layer, the feature vector of each node is calculated through the vector representation of its child nodes, and the node information is transmitted and integrated in a recursive manner. This capture of hierarchical relationships enables the model to effectively understand the structure and logic of smart contracts;
[0069] ②After the encoding layer, add a multi-head attention mechanism layer to enhance the weighting ability of node representation. Through the multi-head attention mechanism, the model can dynamically adjust the degree of attention to different feature nodes, thereby giving higher weights to important feature nodes. This mechanism effectively improves the model's sensitivity to key features, enabling it to capture potential vulnerability information in complex code structures;
[0070] ③ Input the vector that incorporates the attention information into the bidirectional GRU (Gated Recurrent Unit) model. The bidirectional GRU can capture the contextual information in the sequence and use the feature information in both the forward and backward directions to further improve the model's understanding of the statement tree features. This bidirectional feature enables the model to fully consider the relationship between nodes when parsing the code logic, thereby improving the accuracy of detection;
[0071] ④The final classification layer takes the output of the bidirectional GRU model as input to make the final decision on vulnerability classification. Through this layer, the model will comprehensively consider the extracted feature information, output the vulnerability classification results for the smart contract, and clearly point out the possible security risks.
[0072] Through the above steps, a detection model for reentrancy vulnerabilities in smart contracts is constructed, and the classification model is applied to the contract samples in the test set for classification. The final model classification effect is shown in Table 1, where the classification effect is evaluated using accuracy, precision, recall, and F1 value. TP (True Positive) is the number of samples that are judged as positive samples and are actually positive samples, TN (True Negative) is the number of samples that are judged as negative samples and are actually negative samples, FP (False Positive) is the number of samples that are judged as positive samples but are actually negative samples, and FN (False Negative) is the number of samples that are judged as negative samples but are actually positive samples.
[0073] The accuracy rate ACC indicates the proportion of correctly classified samples to the total number of samples, and the calculation formula is:
[0074]
[0075] Precision indicates the ability of the model to accurately identify positive samples. The calculation formula is:
[0076]
[0077] Recall rate Recall represents the ability of the model to find all positive samples. The calculation formula is:
[0078]
[0079] The F1 value is a comprehensive indicator of precision and recall, and the calculation formula is:
[0080]
[0081] Table 1 Detection results of reentrancy vulnerabilities
[0082]
[0083] Comparing the detection effects of the above tools, it can be seen that compared with other smart contract vulnerability detection tools based on deep learning, the F1 value of the method provided by the present invention reaches 94.32%, which is an increase of more than 10%. This further proves that the present invention can improve the accuracy of smart contract vulnerability detection.
Claims
1. A smart contract vulnerability detection method and system based on ASTNN and attention mechanism, characterized in that: The method comprises the following steps: (1) Collect smart contract source code with annotated vulnerability types, build a dataset, and standardize the source code; (2) Apply the syntax parser to generate an abstract syntax tree to prepare for subsequent analysis and feature extraction; (3) For each abstract syntax tree, use the depth-first algorithm to traverse it and obtain a complete traversal sequence, which is used as the corpus for training the word embedding model word2vec to generate a word embedding matrix; (4) defining specific rules for dividing the abstract syntax tree into statement trees, dividing the abstract syntax tree into non-overlapping multi-way statement trees, and traversing the statement tree sequence to form a feature vector; (5) Using the ASTNN model combined with the multi-head attention mechanism, the hierarchical relationship between features is captured through the recursive neural network RvNN (Recursive Neural Network) encoding layer, the multi-head attention mechanism is used to dynamically adjust the focus on important features, and the bidirectional GRU (Gated Recurrent Units) model is used to further understand the context information; the statement tree sequence corresponding to the training data set is used for model training, the grammatical features of the smart contract source code are learned, and a vulnerability detection classification model is constructed.
2. According to claim 1, the smart contract vulnerability detection method and system based on the ASTNN model and attention mechanism is characterized in that: The step (3) comprises: ① According to the defined traversal rules, traverse the abstract syntax tree in depth first, collect the information of each node to obtain the traversal sequence. The traversal rules include: for nodes of logical structure, retain their type attributes, for nodes representing parameter values and operators, retain their name attributes, etc.; ② Use the generated traversal sequence to build the corpus of the word2vec model and obtain the word embedding matrix.
3. The smart contract vulnerability detection method and system based on the ASTNN model and attention mechanism according to claim 1, characterized in that: The step (4) comprises: ① A statement tree is a subtree that takes a statement declaration node as its root node and contains all the related node statements of this statement. According to the specific rules for dividing the statement tree and the segmentation node set P, the complete abstract syntax tree is decomposed into a series of non-overlapping multi-way statement trees. When traversing the AST, if the current node is a node in the split node set P, then a new expression subtree is constructed with this node as the root node. The specific rules are: Traverse the AST and check whether each node belongs to the set of split nodes P. If it does, build a new expression subtree with this node as the root node. The child nodes of the new expression tree are the direct child nodes of the current node, but the split nodes among the child nodes of the current node need to be removed. For each child node, recursively perform the same steps to continue to build a deeper expression subtree. According to this rule, a statement tree sequence is constructed; ② When processing nested statement structures, add a Block node at the beginning of the statement body and insert a corresponding End node at the end to preserve the integrity of the grammatical structure; ③ Visit each node in the statement subtree in depth-first traversal order and add it to the sequence in order to ensure that the hierarchical relationship and context information of the source code are fully preserved; ④ Combine each sentence subtree sequence with the word embedding matrix and convert it into a vector sequence.
4. The smart contract vulnerability detection method and system based on the ASTNN model and attention mechanism according to claim 1, characterized in that: The step (5) comprises: ① Input the feature vector into the encoding layer of the recursive neural network (RvNN), and recursively calculate the features through the vectors of the child nodes to capture the hierarchical structure and logical relationship of the smart contract; ② Add a multi-head attention mechanism after the encoding layer, so that the model can dynamically adjust its attention to feature nodes, thereby improving sensitivity to key features and capturing potential vulnerability information; ③ The weighted vector set {e1,e2,e i ,...,e s }, input into the bidirectional GRU model, its internal hidden state is: Utilize forward and backward context information to enhance the model’s understanding of code logic and improve detection accuracy; ④The final classification layer processes the output of the bidirectional GRU model and performs vulnerability classification.
5. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is loaded into the processor, the steps of the smart contract vulnerability detection method and system based on ASTNN and attention mechanism are implemented according to any one of claims 1 to 4.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, the smart contract vulnerability detection method and system steps based on ASTNN and attention mechanism are implemented according to any one of claims 1 to 4.
Citation Information
Cited By
Intelligent contract vulnerability detection method based on hierarchical multi-granularity coding
CN121706106A