Secure Smart Contracts: Enhancing Vulnerability Detection With Graph and Tokenization Analysis
Abstract
Blockchain smart contracts can be easily integrated into any DApp because they function automatically and cannot be altered. But the existence of important weaknesses, like reentrancy attacks, integer overflow, underflows, and access control problems, puts these contracts at a considerable risk in terms of reliability and security. To effectively detect the vulnerabilities, smart contract's code needs to be preprocessed into a strong representation that will be properly analyzed by the deep learning models. In this study, we offer a hybrid deep learning model combining the use of Graph Neural Networks (GNNs) and CodeBERT that can effectively be ensured through a dedicated preprocessing pipeline. Our model involves: (1) First, smart contract code is graphically converted by employing Recursive Depth First Traversal (RDFT) and Iterative Depth First Traversal (IDFT) algorithms to allow code structure along with relationships to be preserved; (2) The WordPiece tokenizer is used in smart contracts to comprehend semantics better; and (3) The Slither static analysis tool is incorporated to facilitate the marking of weaknesses. Finally, we examine different graph construction algorithms focusing on accuracy and computational ability while concluding that IDFT is most helpful in completing this task. The proposed preprocessing pipeline enables precise identifi- cation of vulnerable functions, variables, and line numbers while preparing the data for hybrid model training. This work lays a foundation for advancing automated vulnerability detection, contributing to a more secure blockchain ecosystem.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.