Auditing
Smart contract auditing requires systematic review of code, architecture, and economic incentives. This guide covers the audit process and tools.
Engagement Scope Before Anything Else
Audit Process
1. Scoping
- Define contracts in scope
- Gather documentation
- Understand business logic
- Identify trust assumptions
2. Automated Analysis
- Static analysis (Slither, Aderyn)
- Symbolic execution (Halmos)
- Fuzzing (Echidna, Medusa)
- Invariant testing (Foundry)
3. Manual Review
- Line-by-line review
- Business logic analysis
- Access control mapping
- State machine verification
4. Reporting
- Severity classification
- Proof of concept
- Remediation guidance
- Final verification
Audit Toolkit
Two caveats on tooling as it stands in 2026. Mythril, the symbolic executor most old tutorials open with, has had no release since 0.24.8 in March 2024, so it lags the compiler line by more than two years and is not a safe default against a 0.8.34 build. Truffle and Brownie are also retired; Foundry or Hardhat is the working assumption. And no analyser replaces reading the code: automated passes find the pattern-shaped bugs and miss the logic ones.
# Full audit workflow
# 1. Setup
git clone <project>
cd project && forge install
# 2. Compile
forge build
# or
npx hardhat compile
# 3. Static analysis
slither . --print human-summary
slither . --print contract-summary
slither . --detect all
aderyn .
# 4. Symbolic execution and deeper checks
# Mythril's last release is 0.24.8 (March 2024), well behind the
# compiler line; use Halmos for symbolic properties instead.
halmos --contract TokenTest
# 5. Property-based fuzzing
echidna-test contracts/Token.sol --contract Token
# 6. Invariant tests (the economic bugs live here)
forge test --match-path "test/invariants/*" -vvv
forge coverage
# 7. Gas analysis
forge test --gas-reportRead the output of step 3 as a list of places to look, not as a list of findings. A Slither hit that the client has already justified in a comment is not a finding; the invariant that nobody wrote in step 6 usually is.
Finding Classification
| Severity | Criteria |
|---|---|
| Critical | Direct fund loss, or the contract can be permanently bricked |
| High | Fund loss with conditions, privilege escalation |
| Medium | Limited impact, griefing, DoS |
| Low | Best-practice deviations with a security rationale: missing input validation, unmonitored admin events, unclear failure messages |
| Informational | No security impact: gas optimisation, naming and formatting, NatSpec gaps, dead code and readability |
The last row is the one most reports carry separately, and for good reason: gas and style findings are worth recording but they do not describe an exploitable condition. Filing them under Low inflates the bucket that a reader uses to judge how much of the code is actually at risk, which is why public reports usually split them into an Informational section or a separate gas report.
Related Topics
NFT Security
The metadata, mint and signature bugs a review of a collection contract should always cover.
Fundamentals
The local chain and toolchain install that an audit engagement assumes you already have.
Source Code Review
The sink-first manual review method to apply once the automated passes have been triaged.