Anchor Pre-Audit Sweep
Finds the account-validation bugs an auditor bills you to find, before you commission the audit
What it does
Audit findings cluster. A large share of what a Solana audit returns is the same handful of missing checks: an authority typed AccountInfo instead of Signer, a token account whose owner is never constrained, PDA seeds that scope to a constant instead of a user, arithmetic running unchecked because nobody set overflow-checks in the release profile.
Those are mechanical to look for and expensive to be told. This sweeps the whole programs tree for them and returns a table with severity, file:line, and — the part that decides whether anything gets fixed — what a caller actually gains from each one. "Missing signer check" is a category. "Any caller can set the fee recipient to their own account" is a finding.
It enumerates the full surface first and refuses to sample, because a missing check is invisible in the file you did not open. Two sections are mandatory in the output: what could not be reached, and what is out of scope by design. A sweep that quietly skipped the CPI review reads identical to one that found nothing there.
This does not replace an audit. It clears the floor so the audit spends its time on your design instead of your boilerplate. Ships with the check catalogue as CSV for CI, and a shell script that enumerates the surface.
The file itself
--- name: anchor-preaudit-sweep description: Sweeps a Solana Anchor program for the account-validation bugs auditors find first — missing signer checks, unverified ownership, colliding PDA seeds, unchecked token math — and returns a findings table with severity and file:line. --- # Anchor pre-audit sweep ## When to use this skill The operator is about to commission an audit of a Solana program, has just finished a feature and wants a second pass, or asks what an auditor will find. Run it against the whole `programs/` tree, not a file the operator picked — the bugs below live in the instructions nobody thought were interesting. ## What this is not This does not replace an audit. It finds the class of bug that is mechanical to look for: the check that is absent. It will not find a flaw in your economic design, a bug that needs two instructions composed in an unusual order, or anything that depends on how a client sequences calls. Say that in the summary so nobody treats a clean run as a clean bill of health. ## 0. Establish the surface Before reading any logic, enumerate: [ ... REMAINDER SEALED — 125 LINES WITHHELD ... ]
| SKILL.md | md | 6.5 KB |
| references/checks.csv | csv | 2.1 KB |
| references/collect-surface.sh | sh | 1.7 KB |
Try it first
Read, Grep, Glob, Bash are not available in the sandbox — the run says where it would use them instead of pretending to.
Connect a wallet to claim your free evaluation run.
One run per wallet per skill. No charge, no transaction.Compatibility
- CLAUDE-CODE
- AGENT-SDK
- Read
- Grep
- Glob
- Bash
- An Anchor workspace checked out locally
- Rust toolchain, to confirm the release profile