Code sleuth

From Gabson0x/bountyforge · View interactive version

Code sleuth is an AI agent skill from the GitHub repository Gabson0x/bountyforge. Analyze EVM smart contracts for storage-safety vulnerabilities that can cause persistent state updates to be lost, overwritten, misdirected, or to collide across proxy or upgrade boundaries.

How to use this skill

Skill file

Code Sleuth — Storage Safety

Analyze EVM smart contracts for storage-safety vulnerabilities.

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

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.).
  1. At least one of the following storage-risk signals is present:

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.

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:

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

Indicators that persistence is expected:

Do not report if:


3) Attacker-influenced storage slot writes

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

This usually occurs in:

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

Examples of realistic overwrite targets:

Do not report if:


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:

Report layout issues carefully:

Do not report if:


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

Look for storage behaviors that can corrupt or desynchronize state.

Examples include:

Only report issues where the result could cause:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.