Case · DiggingBeagle record

ContractLens finds useful internal model signals for malicious smart-contract screening

An October 4, 2026 preprint reports that logistic regression over selected feed-forward neuron activations predicts annotated token-contract capabilities. The highest main-table macro accuracy is 92.41% across ten controlled intent tasks; held-out-intent, neuron-masking and temporal tests offer narrower checks, while the underlying labels do not prove actual token fraud or live detection performance.

Scope

Controlled defensive experiments on pre-execution source-code classification for BNB Smart Chain contracts using internal activations of frozen Qwen3-8B, Qwen2.5-Coder-7B and the manuscript's CodeGemma-family backbone. The 32,141-contract main corpus uses ten code-intent labels; held-out-intent, small-decoder-training and post-backbone-release evaluations have distinct filtered populations. Classification is not an incident report, confirmation of fraud, an exploit witness, a production alert rate or a loss estimate.

Assessment profile

Assessment method
Setting
evaluation
Exploitation
not established
Evidence
Grade C
Remediation
not applicable
AI role
WITH AI
Basis and provenance

An original dated preprint was directly inspected and its dataset lineage checked against the public maintainer dataset card. Results are author-reported controlled evaluations with some hold-out and masking controls; no independent reproduction or prospective alert study was established. This is not an exploitation report and documents no victims or monetary loss, so impact remains null rather than a guessed severity. The paper describes a defensive research method, not a remediated product vulnerability. Evidence grade C reflects a directly inspectable empirical primary source without independent reproduced outcomes.

Assessed Oct 9, 2026 using diggingbeagle.assessment/1.

At a glance

Timeline

  1. Oct 4, 2026
    Event type unspecified

    ContractLens preprint submitted to arXiv

    The research framework, dataset and ablation results become publicly documented in arXiv:2610.04992v1.

  2. Oct 4, 2026
    disclosure

    Public disclosure

Claims & evidence

CLM-CONTRACTLENS-METHODContractLens first locates model layers with separability, counterfactual malicious-logic sensitivity and surface-edit stability; it then ranks feed-forward units by activation contrast, probe weight and logic specificity, before training a separate logistic-regression classifier on selected activations while keeping the pretrained language model frozen.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-ORIGINMiao and six coauthors from Beihang University, Beijing University of Posts and Telecommunications, and the National University of Singapore submitted ContractLens as arXiv:2610.04992v1 on October 4, 2026; the record is a preprint, not an independently reproduced evaluation.supported

Basis: direct observation

Link to claim
CLM-CONTRACTLENS-DATASETThe authors report a filtered BNB Smart Chain set of 32,141 contracts with 21,166 contracts labeled positive for at least one of ten risky token-code intents and 10,975 labeled benign. The intent labels identify code-level capabilities rather than established malicious use or on-chain victimization. Creator- or source-identical contracts are assigned to the same 64/16/20 training, validation or test group.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-HELDOUTIn CodeGemma-based leave-one-intent-out tests on five held-out malicious mechanisms, the authors report 73.50% mean accuracy and 73.51% mean F1 for ContractLens; the strongest competing mean accuracy shown is 66.08% for SCMDetector. Each held-out test set is balanced between malicious and benign samples.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-ABLATIONIn the Qwen3-8B functional masking test, zeroing the identified discriminative units reduced a full-activation linear probe's accuracy from 91.52% to 83.04%, an 8.48-percentage-point loss; masking random neurons produced no reduction, and masking activation-matched nonselected neurons reduced accuracy by 0.25 point.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-TEMPORALIn a separate evaluation of three scam-related token mechanisms drawn from BSC token data originally collected from March 2023 through June 2025 and filtered to deployments after the backbone model's public release, the authors report 77.50% average accuracy and 84.13% AUROC. The experiment is not a prospective measurement of 2026 live-screening performance.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-PRIOR-WORKAn earlier July 2026 study by Dao and collaborators examined neuron-level malicious-code detection on 1,500 malicious and 1,500 benign PyPI packages, including interventions in three language models. ContractLens therefore extends a related interpretability approach to EVM contract intent detection rather than introducing the first security-neuron probing experiment.supported

Basis: inference

Link to claim
CLM-CONTRACTLENS-CODE-EXAMPLEThe paper's Lucky Shiba case study describes an owner-controlled allowlist, a delegated-transfer counter that can block later transfers, and an owner-accessible mint function that overwrites account balances without adjusting total supply or emitting a Transfer event. ContractLens assigns 95.68% predicted probability to the dataset's malicious Mint label for that sample; the example does not document victim losses.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-MAIN-METRICSFor Qwen2.5-Coder-7B, ContractLens reports 92.41% accuracy and 96.24% AUROC averaged across ten one-versus-benign intent tasks; the main study also reports 91.21% accuracy on Qwen3-8B and 90.94% on the named CodeGemma backbone. These are author-run benchmark averages, not field precision or independently confirmed interception rates.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-NOT-UNIVERSALThe ContractLens authors explicitly caution that their identified signals do not establish a universal detector of arbitrary future malicious behavior and remain limited by the security knowledge of the underlying pretrained backbone. Their experiments use code-intent labels and controlled held-out settings rather than independent validation of real-world exploitation outcomes.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-DATASET-LABELSThe underlying Web3 Software Engineering Lab dataset defines Reflection as token-tax redistribution to holders, Reward as distributions intended to incentivize participation, Rebase as algorithmic supply adjustments, and Mint as token creation; it also defines features such as blacklists, sell limits and trading controls. These are categorized capabilities, so a model hit on an annotated intent is not by itself a finding of fraud, loss, or exploitable vulnerability.supported

Basis: inference

Link to claim
CLM-CONTRACTLENS-ABLATION-METRICSMasking selected neurons on Qwen3-8B changes the full-activation linear probe from 91.52% to 83.04% accuracy, an 8.48-point drop, but changes AUROC from 95.02% to 94.17%, a 0.85-point drop. The intervention therefore shows a larger effect on classification accuracy than on ranking discrimination under the specific test; it does not establish that all security knowledge has been removed from the backbone.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-FEWSHOT-BOUNDARYWith a previously identified MCDU set held fixed on the CodeGemma-family backbone, the paper reports 85.03% average AUROC across seven intents when the separate logistic-regression classifier receives 32 balanced labeled contracts; larger sample sizes increase AUROC to 94.97% in the displayed experiment. This is low-data classifier fitting after neuron localization, not an end-to-end detector built from only 32 labeled examples.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-INPUT-CONSTRAINTSThe authors process contracts with a maximum window of 2,048 tokens, 512-token sliding-window overlap for longer files and mean pooling of non-padding token embeddings. They report conducting model probing and lightweight-classifier training with one NVIDIA Tesla V100 GPU with 32 GB of memory; neither that hardware statement nor the appendix efficiency comparison establishes an independently measured production end-to-end audit time.supported

Basis: reported finding

Link to claim
CLM-CONTRACTLENS-TEMPORAL-ATTRITIONThe temporal comparison derives from 14,671 BSC token addresses collected between March 18, 2023 and June 15, 2025; after deduplication and activity filtering, the cited source dataset comprises 1,495 tokens, and its upstream study labels 1,201 of them (898 scams, 303 benign). ContractLens additionally filters deployments to after Gemma-7B became public and tests three mechanisms. The paper does not state the per-mechanism denominators remaining after these filters, so 1,201 is not a supported size for its final temporal test.supported

Basis: reported finding

Link to claim

Implications

ContractLens suggests one intermediate validation signal for auditing token contracts: discriminative, intervention-tested model activations may prioritize suspicious privileged minting or transfer restrictions before on-chain harm occurs. This requires a frozen but still computationally substantial model, label-trained neuron localization and classifier fitting, and the study's results depend on the supplied taxonomy. Because the source dataset records token capabilities that can also be used legitimately, a useful real-world pipeline must distinguish potentially abusive authority from actual misuse using program analysis, transaction simulation and reviewer judgment. The smaller AUROC change under neuron masking also warns against equating a probe accuracy drop with complete removal of a model's security knowledge. These findings complement, rather than supersede, post-execution trace methods such as DG-VDT.

Controls and mitigations

  • Treat a ContractLens output as a queueing signal for human source review or sandboxed simulation. Check the actual privileged paths before calling a token a honeypot, and do not convert an intent label into a fraud verdict.
  • For each alert, preserve exact source code and compilation context, model and tokenizer checkpoint, selected layers and neuron IDs, pooling/window configuration, classifier weights and alert threshold so the classification can be replayed.
  • Hold out shared creators, duplicated templates and time-adjacent contract families while evaluating. Report class-specific precision, recall and calibration under the expected real-world prevalence rather than repeating macro accuracy as a field detection rate.
  • Test behavior-preserving refactors and hostile evasion separately, including proxies, upgradeable roles, delegatecall paths and fee/transfer restrictions reachable only through specific state; these tests address failure modes beyond the paper's renamed-variable and comment controls.
  • For action that would block trading or accuse a deployer, require independent contract-state or trace-level evidence. A second, independent verifier may establish whether flagged logic is reachable, but does not by itself establish whether abuse or losses occurred.

Unknowns and contradictions

  • The ContractLens source paper was inspected directly, but no independently rerun full-model benchmark or verified public implementation of its neuron-selection and evaluation stack was established in this step.
  • The original Web3 Software Engineering Lab dataset card is accessible, but neither the paper nor the card independently validates whether every fee, rebase, reward, mint or trading-control label denotes malicious operator conduct.
  • The temporal source dataset contains 1,201 labeled tokens before the paper's post-backbone-release and mechanism-specific filters. The paper does not disclose exact final class denominators or prospective 2026 prevalence.
  • The manuscript uses the name CodeGemma-2.5-7B, whereas its references cite CodeGemma and Gemma sources; the precise checkpoint/revision needs confirmation. Appendix C mentions four backbones while the main results specify three.
  • The few-label AUROC test reuses a previously selected set of neurons, so full-pipeline performance and cost when both neuron selection and classifier training are label-starved remain unknown.
  • The model's susceptibility to proxy upgrade patterns, adversarially obfuscated logic, unseen execution-dependent behavior and code outside the reported ten target intents is not independently measured.
  • No user losses, production alerts, intervention outcomes, or field false-positive/false-negative rates are established by the controlled study.
  • An accuracy decline under neuron masking does not establish unique symbolic meaning for the masked neurons; the substantially smaller AUROC decline merits an explicit threshold and calibration analysis.

Sources and citation

Material revision history

  1. Oct 8, 2026 · Published version · first publication · revision 105