← Lab /Security & privacy

Focused code slicing and domain knowledge raise NFT vulnerability detection to 97% positive rate

Combining code slicing, an ERC-721 knowledge base, and constrained DeepSeek analysis yields a 97.1% positive-label rate on 450 NFT contracts

Security & privacy arXiv 24 Jul 2026 Method Prototype evidence

Published as “Ethereum NFT Smart Contracts: Knowledge-Guided Vulnerability Detection with LLM and Code Slicing”

Why it matters

The approach shows that narrowing LLM analysis to sliced, domain-constrained code can dramatically increase reported vulnerability detections, but without ground-truth validation its practical security impact remains uncertain.

Summary

The authors report that their knowledge-guided, code-slicing pipeline labels 437 out of 450 NFT contracts as vulnerable, a 97.1% positive-label rate, and that removing the ERC-721 knowledge base or analyzing whole contracts drops this rate to 87.11% and 73.78% respectively. They attribute the differences to the focused context and domain constraints. However, the study lacks independently verified ground-truth labels, so the reported rates cannot be taken as accuracy measures. The paper also does not disclose the exact LLM configuration or knowledge-base contents, limiting reproducibility.

What they found 2

  1. Full configuration yields a 97.1% positive-label rate on 450 NFT contracts.

    “On 450 NFT contract samples, the full configuration produced 437 positive labels, corresponding to a reported positive-label rate of 97.1%.”

  2. Adding external knowledge to sliced inputs raises the positive-label rate by 10 percentage points.

    “Adding external knowledge to sliced inputs increased the reported positive-label rate by 10.00 percentage points, from 87.11% to 97.11%.”

Caveats 5

  • A positive-label rate must not be interpreted as classification accuracy.
  • First, the evaluation does not include independently annotated ground truth, a confusion matrix, per-class precision or recall, or inter-annotator agreement.
  • Second, the vulnerability-category labels used during preprocessing were generated semi-automatically, which may reveal expected classes to the slicing procedure.
  • Third, the exact DeepSeek configuration and full knowledge base were not recorded, limiting reproducibility and analysis of output stability.
  • The detector covers only three vulnerability classes.

What’s new here 3

  • Combines regex-based candidate screening with a structure-aware context window to produce line-numbered code slices.
  • Constrains the DeepSeek LLM with an ERC-721-specific knowledge base, explicit decision rules, and a fixed output schema.
  • Evaluates the impact of domain knowledge and code slicing via ablation studies on a batch of 450 NFT contracts.