# Shared Scan Rules ## Bundle contents Your bundle is five concatenated files: all in-scope source code, the SOP (HOW to think), your specialty agent (WHAT to look for), these shared rules (output format, dedup tags), and the report language rules (HOW to word a finding). Read the whole bundle once at the start. The bundle contains all in-scope source. Use Read/Grep only for cross-file searches or out-of-scope context (interfaces/, lib/, mocks/, test/) — do not re-read in-scope files for the initial scan. When matching function names, check both `functionName` and `_functionName` (Solidity convention). ## Cross-contract patterns When you find a bug in one contract, **weaponize that pattern across every other contract in the bundle.** Search by function name AND by code pattern. Finding native/ERC20 confusion in `ContractA.onRevert` means you check every other contract's `onRevert` — missing a repeat instance is an audit failure. After scanning: escalate every finding to its worst exploitable variant (DoS may hide fund theft). Then revisit every function where you found something and attack the other branches. ## Do not report Admin-only functions doing admin things. Standard DeFi tradeoffs (MEV, rounding dust, first-depositor with MINIMUM_LIQUIDITY). Self-harm-only bugs. "Admin can rug" without a concrete mechanism. ## Output Return findings as structured blocks: FINDINGs have concrete, unguarded, exploitable attack paths. LEADs have real code smells with partial paths — default to LEAD over dropping. **Every FINDING must have a `proof:` field** — concrete values, traces, or state sequences from the actual code. No proof = LEAD, no exceptions. **One vulnerability per item.** Same root cause = one item. Different fixes needed = separate items. ``` FINDING | contract: Name | function: func | bug_class: kebab-tag | group_key: Contract | function | bug-class path: caller → function → state change → impact proof: concrete values/trace demonstrating the bug description: one sentence fix: one-sentence suggestion LEAD | contract: Name | function: func | bug_class: kebab-tag | group_key: Contract | function | bug-class code_smells: what you found description: one sentence explaining trail and what remains unverified ``` The `group_key` enables deduplication: `ContractName | functionName | bug_class`. Agents may add custom fields. ## Language — MANDATORY **Your `description:` and your `fix:` sentence are written in Simplified Technical English.** The rules follow these ones in your bundle, under the heading "Report language". Read them, and obey them in every finding and every lead you emit. Your `description:` is what the report prints. Nothing downstream rewrites it into plain English for you — the orchestrator pastes it into the report and the report goes to the developer who must fix the code. One sentence, twenty-five words or fewer, active voice, no `-ing` clause, no metaphor. Name who acts and what they get. The rule reaches the wording and never the data. Your `bug_class` label, your `group_key`, the contract and function names, and every line of code you quote are written exactly as the source and the dedup rules require. `report-language.md` says which is which. Your `path:` and `proof:` fields are working notes, not report text. Keep them concrete; concrete is already plain.