How to Prepare for a Smart Contract Audit: 2026 Checklist

Short answer: to prepare for a smart contract audit,

  1. freeze one commit;
  2. list exactly which files are in scope;
  3. write a one-page spec covering who can do what, what you trust and which rules must always hold;
  4. ship a passing test suite;
  5. clear what free tools find;
  6. put your deployment and upgrade scripts in scope.

Every hour auditors spend working out what the code is meant to do is an hour not spent finding how it breaks, and an hour you pay for.

The checklist

Copy this into your audit ticket and tick it off before the review starts.

  • Commit to be reviewed is chosen and won't change during the review
  • Files in scope are listed, with line counts; out-of-scope files are named
  • Compiler version, optimizer settings and dependency versions are pinned
  • Target chains and external contracts (oracles, bridges, DEXs) are listed
  • A one-page spec explains what the system does and where funds move
  • A role table lists every privileged function, who can call it and how it's secured
  • Rules that must always hold (invariants) are written down
  • Known issues and accepted risks are listed
  • forge build is clean and forge test passes from a fresh clone
  • Fork tests are pinned to a block number
  • Slither and compiler warnings are fixed or explained
  • Deployment and upgrade scripts are in the repository and in scope
  • One developer is available to answer questions during the review
  • Time is booked after the review to fix findings

1. Freeze the scope

An audit covers one commit. Code that changes during the review gets reviewed twice or not at all, and the report can only vouch for the commit it names.

  • Pick the commit and share its full hash. Make fixes on a separate branch.
  • List the files in scope with their line counts, not counting comments and blank lines. solidity-code-metrics or cloc will count them. Line count is the first input to any quote: see our audit cost guide.
  • Name what's out of scope. That covers tests, mocks, scripts you won't run and unmodified libraries. If you changed a library, it's in scope.
  • Pin versions. Record the compiler version and optimizer settings, and pin dependencies to an exact release, for example OpenZeppelin Contracts 5.4.0. Behaviour such as storage layout can differ between library versions, and findings depend on which version you use.

2. Write down how it is meant to work

Auditors find bugs by comparing what code does with what it should do. Without a spec they have to guess the second half. One page is enough:

  • What the system does, in a few sentences, and where funds enter, sit and leave.
  • A role table. For each privileged function, say who can call it (admin, keeper, multisig, anyone), whether a timelock delays it, and what happens if that key is compromised. State who holds each role at launch.
  • Trust assumptions. For example, the admin is a 3-of-5 multisig and can pause but can't move user funds, or the oracle is trusted to within 1%.
  • Invariants: rules that must always hold. For example, total shares never exceed total assets, a user can always withdraw their own deposit, and rewards paid never exceed rewards funded.
  • External behaviour you rely on. If your code depends on how an escrow, bridge or staking contract accounts for tokens, say how. Auditors can't verify behaviour that sits outside the scope unless you describe it.
  • Known issues you have already accepted, so nobody spends paid time rediscovering them.

3. Ship tests that run

A passing test suite shows auditors the behaviour you intended and gives them a base for their own attack tests.

  • forge build and forge test pass from a fresh clone, with no local-only setup.
  • Run forge coverage and share the result. Gaps in coverage show auditors where to look first.
  • Pin fork tests to a block number so results don't change from day to day.
  • Write invariant tests for core accounting where you can.
  • Keep mocks honest. A mock that skips a real step, such as a token transfer, can make tests pass while the real path fails.

4. Clear what free tools find

Static analysis and AI scanners are cheap. Fix or explain what they report before the audit, so the auditors' paid time goes on what tools miss.

  • Run Slither. Fix what is real and note why the rest is safe.
  • Fix compiler warnings.
  • If you run an AI scanner, share its output and your notes on it. Some subsidy programmes now require an AI review before they fund an audit; see our audit subsidies guide.

5. Put deployment and upgrades in scope

Many costly mistakes happen at deployment, not in the contract logic.

  • Deployment scripts belong in scope: a wrong constructor argument or a missed role grant can undo a clean audit.
  • Upgradeable contracts: state the proxy pattern, protect initializers (call _disableInitializers() in the implementation's constructor), and share the storage layout of the deployed version if this is an upgrade.
  • Admin handover: describe how roles move from the deployer to the multisig or timelock, and when.
  • After launch, publish the deployed addresses so anyone can check that the bytecode matches the reviewed commit.

6. Plan the review and the fixes

  • One responsive contact. Answers within hours, not days, keep the review moving. Telegram works well.
  • Booked fix time. Leave time after the report to fix findings before launch.
  • One fix per commit. Fix each finding in its own commit or pull request, and reference the finding's ID (for example M-01). This makes the mitigation review faster and the report clearer.
  • Don't change the reviewed commit. Fixes go on top, and the mitigation review checks them finding by finding.

At Bulwark every audit includes one mitigation review round: we check your fix commit against each finding and revise the report, so it matches the code you ship.

Frequently asked questions

How do I prepare for a smart contract audit?

Freeze one commit, list the files in scope with their line counts, and write a one-page spec covering roles, trust assumptions and invariants. Ship a passing Foundry test suite, fix what free tools such as Slither report, and put your deployment and upgrade scripts in scope. Then book a developer to answer questions during the review, and time afterwards to fix findings.

When should we start preparing for an audit?

Once the code is feature-complete. Writing the spec and finishing the tests usually takes days, not weeks, and it makes the audit faster and cheaper. Book the audit itself early, because many firms are booked weeks ahead.

What documentation do auditors need?

A short spec is enough: what the system does, where funds move, a table of privileged roles, your trust assumptions, the invariants that must always hold, any external contract behaviour you rely on, and known issues you have accepted.

Should we fix Slither findings before the audit?

Yes. Fix what is real and note why the rest is safe. Otherwise auditors spend paid time on issues a free tool already found.

Can we keep coding during the audit?

Yes, but not on the commit under review. Work on another branch. Changes reach the audit through the fix review, which checks each fix against the findings and reports anything new it introduces.