Security · Intermediate
Smart contract security checklist: 20 checks before you deploy
A practical pre-deployment security checklist for Solidity smart contracts covering reentrancy, access control, external calls, arithmetic, upgrades, and operational safety.
Deployed code cannot be patched. This list is the minimum to walk through before pressing Deploy on anything that holds value. Monsmith's audit automates the mechanical items; the judgement items are yours.
External calls
- Every function follows checks, effects, interactions: validate, update state, then call out.
- Functions that transfer value use a reentrancy guard or are provably safe without one.
- Return values of low-level
callare checked;transferandsendare not relied on for gas semantics. - The contract never assumes a callee is not a contract.
Access control
- Every state-changing function has an explicit permission model, even if it is "anyone".
- Ownership transfer is two-step or otherwise protected against typos.
- Privileged functions are minimal, and a compromised key's blast radius is understood.
tx.originis never used for authorisation.
Arithmetic and data
- Solidity 0.8 checked arithmetic is on; any
uncheckedblock is justified in a comment. - Division happens after multiplication to limit precision loss.
- Timestamps and block numbers are used only where miner influence does not matter, and block-based durations are avoided on fast chains.
- Randomness never comes from block data.
Design
- Every state change emits an event.
- Loops over unbounded arrays cannot be forced to run out of gas by a user.
- Front-running is considered for any function whose outcome depends on ordering.
- External price or data sources are validated; a single oracle is not a single point of failure.
Upgrades and operations
- If upgradeable: storage layout is append-only and the upgrade authority is a multisig or timelock.
- A pause or circuit breaker exists for contracts holding significant value.
- Private keys never appear in source, config, or a browser tab. Deploy through a wallet.
- The exact deployed bytecode is verified on the explorer against the audited source.
Running the mechanical checks
Paste the contract into monsmith.com/studio and run the audit. It flags reentrancy, missing access control, unchecked calls, dangerous patterns, and gives a risk score with specific suggestions. Treat a clean automated result as the beginning of the review, not the end.
Frequently asked questions
- What is the most common smart contract vulnerability?
- Access control mistakes and reentrancy account for a large share of losses. Both are mechanical to detect and cheap to fix before deployment.
- Is an automated audit enough?
- No. Automated tools catch known patterns. Business logic errors, economic attacks, and novel issues need human review. Use automation to clear the floor so reviewers spend time on judgement.
Try it in Monsmith
Free, in the browser, no account. Compile, audit, profile, and deploy to Monad.
Open the studio