๐ก๏ธ Pre-deploy security checklist
A practical checklist for Solidity protocols before mainnet. Free โ from the questions I ask on every review.
By
Nawel
ยท print it, share it, tick it off.
Vaults & share accounting (ERC-4626)
First-depositor inflation
โ virtual shares/offset or a minimum initial deposit is in place.
Rounding direction
โ deposit/mint & convertToShares round DOWN; previewMint/previewWithdraw round UP (in the vault's favor).
totalAssets not manipulable
โ not derived from a spot balance an attacker can donate to.
Fee accounting
โ
lastTotalAssets
updated on every op that touches fees.
Access control
Every privileged function is gated
โ mint, pause, upgrade, setters behind a role/owner.
Ownership is two-step
โ no lock-out from a typo'd transfer (Ownable2Step).
initialize() protected
โ
initializer
modifier + deployed atomically (no front-run).
Admin behind multisig/timelock
โ not a single hot EOA.
Oracles
Staleness checked
โ
updatedAt
vs a max-age; revert on stale.
Round validity
โ
answeredInRound >= roundId
, price > 0.
Manipulation-resistant
โ TWAP/redundant sources, not raw spot.
Reentrancy & external calls
Checks-Effects-Interactions
โ state updated before external calls.
Reentrancy guards
โ on functions moving funds or calling out; read-only reentrancy considered.
Hooks use call, not delegatecall
โ return values checked; extensions isolated.
Tokens & math
Fee-on-transfer / rebasing
โ accounting uses balance-diff, not the input amount.
Precision
โ multiply before divide; no silent truncation on core paths.
SafeERC20
โ for non-standard tokens (missing bool return, USDT-style).
Upgrades & testing
Storage layout safe
โ no collisions across upgrades; gap variables if needed.
Upgrade gated
โ behind governance/timelock;
_authorizeUpgrade
restricted.
Invariant/fuzz tests
โ on the economic invariants (solvency, conservation of funds).
Continuous review
โ re-audited on every change/deploy, not just once (your code keeps changing).
Want this checked for real โ on every change?
Fast, affordable security review + continuous monitoring for small protocols.
See the service โ
Free scanner + GitHub Action