Logo: Code Sleuth

Code Sleuth

Communautéit
Gabson0x
code-sleuth

Analyséiert EVM-Smart-Contracts op Schwachstelle vun der Storage-Sécherheet, duerch déi permanent Ännerungen am Zoustand verluer kënne goen, iwwerschriwwe oder falsch zougewise kënne ginn oder bei Proxy- oder Upgrade-Grenzen zu Konflikter féiere kënnen.

Add to TypingMind

Iwwersiicht

EditeurGabson0x
Repositorybountyforge
Skill-Nummcode-sleuth
Stären
455
Forks
63
Matgeliwwert Dateien
Nëmmen Instruktiounen
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Gabson0x huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Code Sleuth an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/Gabson0x/bountyforge/tree/main/skills/code-sleuth
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Gabson0x/bountyforge.git /tmp/bountyforge
mkdir -p .claude/skills
cp -r /tmp/bountyforge/skills/code-sleuth .claude/skills/code-sleuth
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Code Sleuth an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Code Sleuth automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Code Sleuth net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Code Sleuth — Storage Safety

Analyze EVM smart contracts for storage-safety vulnerabilities.

See also: [[Web3 Audit]], [[Smart Contract Audit]], [[Trust Map]], [[Methodology]]

  • memory vs storage confusion
  • lost writes (state mutated in memory but never persisted)
  • arbitrary or attacker-influenced storage slot writes
  • storage collisions across proxy/upgrade layouts
  • other storage semantics that can corrupt or invalidate state

Only report issues that have a clear persistence or state integrity impact.


Applicability gates

Only proceed if BOTH conditions are true:

  1. The contract contains state-mutating logic intended to update persistent storage (balances, shares, positions, roles, configuration, accounting totals, escrow mappings, arrays of records, etc.).

  2. At least one of the following storage-risk signals is present:

  • writes to structs, arrays, or mappings
  • inline assembly interacting with storage (sstore, sload)
  • manual or unstructured storage slots (bytes32 slot constants, StorageSlot libraries)
  • proxy, upgradeable, diamond, or delegatecall-based architecture

If these gates are not satisfied, do not force findings.


Workflow

1) Inventory storage and storage writers

Map the contract’s persistent state surface before looking for bugs.

  • Identify key storage variables such as balances, shares, totals, configuration, roles, escrow mappings, or arrays of user positions.
  • Enumerate functions that mutate them:
    • external/public non-view functions
    • internal helpers reachable from those functions
    • privileged admin or upgrade paths
  • Identify manual slot usage such as:
    • inline assembly sstore / sload
    • StorageSlot libraries
    • bytes32 slot constants
    • custom slot arithmetic

Use this inventory to anchor later findings to specific variables and write paths.


2) Lost write / memory-versus-storage omission

Look for cases where storage-backed data is copied into a temporary value, modified, but never written back to storage.

Typical pattern:

  • A storage value (struct, mapping element, or array entry) is copied into memory or into a value-type variable.
  • The temporary variable is mutated.
  • The mutation is never persisted back to the original storage location.

Report a finding only if all of the following are true:

  • A storage-backed value is copied into a non-storage temporary.
  • That temporary is mutated (field assignment, push/pop, arithmetic update, etc.).
  • On all reachable paths, the mutated value is not written back to the original storage location.
  • The surrounding logic indicates that persistence was expected.

Indicators that persistence is expected:

  • function name suggests an update
  • emitted events imply a state change
  • later code reads the state assuming it was updated
  • callers rely on the update for accounting or permissions

Do not report if:

  • the function is clearly view or pure
  • the code intentionally constructs and returns a modified copy
  • the variable is actually a storage reference
  • the value is written back through a helper function on all paths

3) Attacker-influenced storage slot writes

Look for cases where untrusted input affects which storage slot is written.

This usually occurs in:

  • inline assembly
  • custom slot arithmetic
  • manual mapping key construction
  • delegatecall-based modules or registries

Report a finding only if all of the following are true:

  • attacker-controlled input influences the final storage slot or key used in a write
  • the slot or key is not strictly constrained by validation, allowlists, or provenance checks
  • the resulting write can corrupt unrelated or sensitive state

Examples of realistic overwrite targets:

  • owner or admin variables
  • configuration parameters
  • balances or accounting mappings
  • implementation or proxy slots
  • governance roles

Do not report if:

  • the slot is a fixed constant used in a standard pattern
  • strong access control prevents untrusted writes
  • input-derived keys are tightly validated against trusted state

4) Upgradeable storage collisions and layout hazards

If the contract uses proxy, upgradeable, or diamond architecture, examine storage layout safety.

Look for situations where storage from multiple implementations or facets could overlap.

High-risk signals include:

  • upgrade mechanisms such as upgradeTo, diamondCut, or admin-controlled implementation changes
  • inheritance-heavy storage layouts without reserved gaps
  • custom slot constants inconsistent with EIP-1967 or other standard patterns
  • facets or modules declaring overlapping state without a shared storage struct pattern

Report layout issues carefully:

  • If you can demonstrate an actual collision, report it as a concrete vulnerability.
  • If there is only a credible risk during upgrades, report it as an upgrade-safety risk.

Do not report if:

  • the contract has no upgrade mechanism
  • storage layout follows a standard pattern with reserved gaps and consistent slot usage

5) Other storage semantics (only when security-relevant)

Look for storage behaviors that can corrupt or desynchronize state.

Examples include:

  • deleting mapping or struct entries while leaving auxiliary state inconsistent (index arrays, totals, role flags)
  • manual bit packing or bitmap logic that fails to clear or mask stale bits
  • uninitialized storage reads used as authorization or accounting signals

Only report issues where the result could cause:

  • privilege escalation
  • incorrect accounting
  • corrupted configuration
  • inaccessible funds
  • broken protocol invariants

Heefeg gestallte Froen

Wat mécht de KI-Skill Code Sleuth?

Analyséiert EVM-Smart-Contracts op Schwachstelle vun der Storage-Sécherheet, duerch déi permanent Ännerungen am Zoustand verluer kënne goen, iwwerschriwwe oder falsch zougewise kënne ginn oder bei Proxy- oder Upgrade-Grenzen zu Konflikter féiere kënnen.

Firwat Code Sleuth op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Code Sleuth besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Code Sleuth an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Gabson0x/bountyforge/tree/main/skills/code-sleuth an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Code Sleuth benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Code Sleuth benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Code Sleuth domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Code Sleuth gratis?

Gabson0x huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇