AI-Based Vulnerability Analysis of NFT Smart Contracts
Xin Wang, Xiaoqi Li · 2025
Read AI-Based Vulnerability Analysis of NFT Smart Contracts by Xin Wang, Xiaoqi Li (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-16113.txt.
Introduction
Xin Wang and Xiaoqi Li build an artificial intelligence method for finding flaws in NFT smart contracts in a 2025 paper. The NFT market grew fast, and contract bugs can cost users dearly. Manual review is slow and costly, while past automated models handled the task poorly.
The team gathered over sixteen thousand public contracts and sorted them into five flaw types, such as reentrancy and unlimited minting. A random forest model, tuned by grid search, learned to spot each flaw type from code features. It read access control patterns for one flaw and call placement for another. The ensemble beat single decision trees and held up after tuning. The authors offer it as an efficient path to automated contract checks.
Catalog record
| CREATOR | Xin Wang, Xiaoqi Li |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 61 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2504-16113
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
AI-Based Vulnerability Analysis of NFT Smart Contracts Xin Wang, Xiaoqi Li Abstract . With the rapid growth of the NFT market, the security of smart contracts has become crucial. However, existing AI-based detection models for NFT contract vulnerabilities remain limited due to their complexity, while traditional manual methods are time-consuming and costly. This study proposes an AI-driven approach to detect vulnerabilities in NFT smart contracts. We collected 16,527 public smart contract codes, classifying them into five vulnerability categories: Risky Mutable Proxy, ERC-721 Reentrancy, Unlimited Minting, Missing Requirements, and Public Burn. Python-processed data was structured into training/test sets. Using the CART algorithm with Gini coefficient evaluation, we built initial decision trees for feature extraction. A random forest model was implemented to improve robustness through random data/feature sampling and multitree integration. GridSearch hyperparameter tuning further optimized the model, with 3D visualizations demonstrating parameter impacts on vulnerability detection. Results show the random forest model excels in detecting all five vulnerabilities. For example, it identifies Risky Mutable Proxy by analyzing authorization mechanisms and state modifications, while ERC-721 Reentrancy detection relies on external call locations and lock mechanisms. The ensemble approach effectively reduces single-tree overfitting, with stable performance improvements after parameter tuning. This method provides an efficient technical solution for automated NFT contract detection and lays groundwork for scaling AI applications. 1. INTRODUCTION NFT (Non-fungible Token), or non-fungible token, is a certified storage unit operating on a unique and indivisible blockchain platform. Currently, it is mostly in the form of electronic files of the source files of artistic creation, and its value is reflected by virtual cryptocurrencies ( Kong et al. 2024 ) . The current focus on the NFT smart contract market revolves mainly around four aspects: classification and mining of vulnerabilities, development of audit tools, repair of vulnerability strategy, and construction of the NFT ecosystem ( Liu and Li 2025 ) . Due to the complexity of NFT smart contract vulnerabilities, there is currently no mature large-scale artificial intelligence detection model specifically for NFT smart contract vulnerabilities in the market. ( Li et al. 2024b ) Therefore, the analysis, detection, repair, and maintenance of vulnerabilities in the NFT smart contract require a significant amount of resources, which is not conducive to the continuous healthy development of the existing NFT market. Therefore, this paper proposes an AI-based NFT smart contract vulnerability analysis project in response to the lack of large-scale artificial intelligence analysis models. The goal is to analyze vulnerabilities and carefully analyze the generated models, starting from data, models, and effects, and conducting a large amount of demonstration and experimental work ( Li et al. 2024f ) . We strive to accumulate experience in NFT smart contract vulnerabilities and contribute to the application of large-scale artificial intelligence models. There are already several examples of defect detection in AI-based smart contracts,rocessing (NLP) and machine learning algorithms to perform static analysis and vulnerability detection on smart contract code ( Bu et al. 2025 ) , identifying potential security risks and providing improvement suggestions, offering reliable security assurance for blockchain developers; ( Niu et al. 2024 ) Li Tao and others proposed a public audit of smart contracts based on game theory; Chuang Ma1 proposed HGAT, ( Ma et al. 2023 ) a hierarchical graph attention network-based detection model. Internationally, the Harvard University Blockchain Security Laboratory has developed a static analysis tool for smart contracts using artificial intelligence technology, which can automatically detect vulnerabilities and security risks in smart contracts; and Anzhelika Mezina ( Mezina and Ometov 2023 ) and others proposed a method combining binary classification and multiclassification to detect vulnerability in smart contracts in their paper. This paper focuses on the currently widely used NFT smart contracts, conducting a comprehensive and in-depth study on their related security issues, collecting a large number of applied NFT smart contract codes; after careful sorting and differentiation, the attacks are divided into five categories; they are processed and studied separately and finally trained, in addition, this paper also continues to explore its shortcomings and possible future work directions and priorities, providing its own opinions for the improvement of NFT smart contract detection technology. The paper has the following contribution: • Sufficient and accurate data: This paper compiled a dataset of 16,527 smart contracts, and analyzed and labeled the vulnerabilities in their line codes. We also carefully cleaned and preprocessed the data to exclude inaccurate or low-quality code samples, ensuring that the data quality on which the model is based is highly reliable. • Targeted solutions: We conducted an in-depth analysis of NFT smart contracts and discovered five main defects: Risky Mutable Proxy, ERC-721 Reentrancy, Unlimited Minting, Missing Requirements, and Public Burn. These defects may seriously impact the contract’s security and robustness. To solve these problems, we formulate targeted solutions to improve the program’s quality and robustness. • Sufficient training and organization: In our research, we performed a detailed parameter tuning for the random forest model. Adjusting the number of trees, the depth of trees, the selection of features, and other parameters, we explored many different training results. This sufficient training and organization process improved our model and provided more reliable prediction and evaluation capabilities for smart contract code security. 2. BACKGROUND 2.1. Smart Contracts Smart contracts, in terms of classification, belong to protocols. Their primary application scenario is within the blockchain, containing a large number of code functions. ( Li et al. 2025 ) . Additionally, they can interact and operate with other smart contracts to achieve a series of required functionalities. ( Li et al. 2023 ) Similar to protocols, they need to follow specified steps and processes for application. Moreover, smart contracts allow two parties to conduct trusted transactions independently without the need for a traditional trusted center. These transactions are traceable and irreversible ( Gong et al. 2023 ) . When a specific scenario or action triggers the corresponding terms of a smart contract in a certain way, the smart contract code can execute accordingly. Figure 1. Blockchain Industry Development Trends As one of the important components of blockchain technology, smart contracts were first proposed by the renowned cryptographer Nick Szabo in 1994 ( Lakshminarayana and Sathiyamurthy 2022 ) . However, due to technological and infrastructure constraints, they have not been fully implemented. Although smart contracts are now widely used on the Internet in areas such as automatic payments and drone sales, they are mostly limited to contracts between individuals and institutions. ( Li et al. 2020 ) The main reason is the increasing unfamiliarity between people in modern society, making it difficult to establish precise and effective constraint mechanisms, thus resulting in higher living costs for most people when dealing with issues. Using blockchain technology, trust issues between people can be resolved through technical methods, promoting the further development of smart contracts. Figure 2. Smart Contract Logic Blockchain, with its decentralized nature and the characteristic that data cannot be altered at certain points, theoretically and technically solves the trust issues between two or more unfamiliar parties, laying the foundation for the large-scale application of smart contracts. ( Li et al. 2024d ) The birth of Ethereum marked the beginning of this phase, applying smart contract technology on the blockchain and endowing Ethereum with more