Smart Contract Audit Checks and Scope
What does a smart contract audit actually check? It reviews a fixed code version for security bugs and specification errors, then reports findings by severity.
The Y News Editors4 min read
A smart contract audit reviews a fixed version of a contract’s code for security bugs and logic that departs from its specification, then reports findings by severity.
For a protocol user, the key is whether the report covers the code and contracts they are actually relying on.
An audit is a review of code, not a permanent safety label. Contracts can hold funds and may be difficult or impossible to change after deployment, so auditors look for flaws before release. For Fraxswap users, match the report’s commit and deployed contract addresses before relying on it; this what to check before swapping on Fraxswap is part of assessing the protocol in practice.
Which checks does a smart contract audit include?
Auditors trace how the contract behaves against its specification and look for known weakness patterns. Common references include the SWC Registry, a catalogue of smart contract weaknesses, and the OWASP Smart Contract Top 10, which groups common vulnerability categories.
- Access control: Can only intended roles call administrative functions, such as changing fees or the owner?
- Reentrancy: Can an external call re-enter a function before the contract has finished updating its state?
- Arithmetic and rounding: Can integer precision, rounding direction or boundary values create an unintended result?
- Price and oracle manipulation: Can an attacker distort a price input, including through a flash loan, and use it to trigger a profitable action?
- Business logic against spec: Do the implemented rules match the stated design across ordinary and unusual transaction sequences?
Solidity’s security considerations describe reentrancy as a risk around external calls: if a contract transfers control before updating relevant state, another call may exploit that gap. Auditors inspect call ordering and whether state changes happen before external transfers.
Think of an audit like checking a building’s plans against its wiring and doors: the specification is the plan, and the code is what was built. The analogy stops at inspection; a software audit reasons about many possible transaction sequences, not just a physical structure.
What would an audit check in an AMM pair?
In an automated market maker pair, auditors examine how swaps update reserves and enforce the pool’s trading rules. In a Uniswap V2-style design, that includes a lock against reentrancy, the order of token transfers and a fee-adjusted constant-product invariant checked after each swap.
For a large trade, the review follows the balances through the swap: which tokens leave, which arrive, when reserves update, and whether the invariant still holds after accounting for fees. A lock can prevent a second swap from entering during a sensitive operation, while the invariant check guards against taking out more value than the trade rules allow. Auditors also compare those mechanics with the specification; a technically valid invariant can still implement the wrong intended fee or behavior.
How do I read the severity levels in an audit report?
Severity levels rank reported findings by their assessed impact and exploitability, so read each finding’s description and conditions alongside its label. A high-severity issue may indicate a direct path to loss under stated conditions; a lower rating still needs context about affected functions and required access.
Then check the report’s scope: the reviewed commit hash, included contracts, exclusions and findings marked fixed or unresolved. Compare that commit with the release and the deployed addresses. If the deployed code differs, the report may not describe what users are interacting with.
What is a bug bounty, and how does it differ from an audit?
A bug bounty invites researchers to report qualifying vulnerabilities, often under stated reward and disclosure rules; an audit is a review of a defined code version and scope. Both can find bugs, but neither makes later code changes part of the earlier review.
Front ends, off-chain signing keys, later upgrades and market risk sit outside an audit’s code scope unless the report explicitly includes them. Treat an audit as evidence about specified code at a specified time, then verify that scope against the contracts you use.