Logo van Code Sleuth

Code Sleuth

Community
Gabson0x
code-sleuth

Analyseer EVM-smart contracts op kwetsbaarheden in de opslagveiligheid die ertoe kunnen leiden dat persistente statusupdates verloren gaan, worden overschreven, verkeerd worden doorverwezen of met elkaar botsen over proxy- of upgradegrenzen heen.

Add to TypingMind

Overzicht

UitgeverGabson0x
Repositorybountyforge
Skillnaamcode-sleuth
Sterren
455
Forks
63
Meegeleverde bestanden
Alleen instructies
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door Gabson0x op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Code Sleuth in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/Gabson0x/bountyforge/tree/main/skills/code-sleuth
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die 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 na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Code Sleuth in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Code Sleuth automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Code Sleuth niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

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

Veelgestelde vragen

Wat doet de AI-skill Code Sleuth?

Analyseer EVM-smart contracts op kwetsbaarheden in de opslagveiligheid die ertoe kunnen leiden dat persistente statusupdates verloren gaan, worden overschreven, verkeerd worden doorverwezen of met elkaar botsen over proxy- of upgradegrenzen heen.

Waarom Code Sleuth gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Code Sleuth bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Code Sleuth in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/Gabson0x/bountyforge/tree/main/skills/code-sleuth. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Code Sleuth gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Code Sleuth gebruiken?

Zoveel als je wilt. Je kunt Code Sleuth gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Code Sleuth gratis?

Deze skill is door Gabson0x op GitHub gepubliceerd. Bekijk de repository voor de licentievoorwaarden. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇