Smart Contract Review: What It Covers and What It Doesn't
A smart contract review is a person, or a tool, reading a program's code to look for mistakes that could cost users money. On Solana, smart contracts are called programs. A review is useful, but it is often misunderstood: it reads the code it is given, at one moment, against known kinds of bugs. It does not prove a program is correct, and it cannot make any promise about the future. This guide explains what a review usually covers, what it leaves out, and one check you can do yourself in a minute.
What a smart contract review usually covers
Reviews differ in depth, but a typical one looks at the program's own code for:
- Account checks. Does the program confirm that the accounts passed to it are the ones it expects, with the right owner and the right signer? Missing checks are a common source of bugs on Solana.
- Who can do what. Which addresses can call each instruction, and are privileged actions (withdrawing, changing settings) limited to the right authority?
- Arithmetic. Can numbers overflow, round the wrong way or go negative in a way that moves money incorrectly?
- Calls to other programs. When the program calls another program, does it pass the right accounts and check the result?
- Derived addresses. Are program-derived addresses built from the right inputs, and does the program check them?
- Failure paths. What happens when an instruction fails halfway, or when inputs are strange?
- Tests. Whether the repository has tests, and whether they cover the risky paths.
The output is usually a written list of findings with a severity, plus what the reviewer could not look at.
What a review does not cover
This is the part that is easy to miss. A review of the code does not cover:
- Other code. Anything outside the files in scope, including programs it calls, the website, the wallet connection and off-chain servers.
- Economic design. A program can do exactly what its code says and still be a bad deal, for example through incentives that reward insiders.
- People and keys. Who holds the admin keys, how they are stored, and what those people may choose to do.
- Changes after the review. If the program can be upgraded, the code you reviewed may not be the code running next month.
- Unknown bugs. Nobody can show that no bugs remain. A review lowers the chance of known kinds of mistakes. It does not remove risk.
For that reason, an honest description of a quick review states its scope, its time box and what it did not look at.
Check the upgrade authority yourself
The Solana docs explain that a deployed program has a program authority, the account that has permission to update or close the program. By default it is the wallet that deployed it. Two outcomes matter to anyone reading a review:
- An authority is set. That address can replace the program's code. A review of today's code is only as lasting as that address's good behaviour. Ask who controls it and whether it is a single key or something shared.
- No authority. The docs say a program made immutable can never be updated or closed. The code you review is the code that stays.
You can look this up yourself. The Solana CLI command solana program show <program id> prints the program's authority, and block explorers show the same field on a program page. If a project's marketing says "reviewed" but the program can still be changed by one key, you now know what the review does not protect against.
How to read a review you are given
1. Read the scope. Which repository, which commit and which files? If the deployed program is not the reviewed commit, the review may not apply. 2. Read what was not reviewed. A good report lists it. A report that says nothing about limits is a warning in itself. 3. Read the findings, not just the summary. Note which were fixed and which were accepted as risks. 4. Check the date. Compare the reviewed commit with the code that is deployed now. 5. Ask who did it. A review by a team that benefits from the project is not independent, and a review by an automated tool has its own limits.
Our own work in this area
Contract Check is our paid written review of a Solana program's code, at a fixed price. Written by our AI review system, not an independent audit firm. Each report lists its scope and what it did not look at. Request a Contract Check.
FAQ
What is a smart contract review?
It is a read-through of a program's code to find mistakes that could cost users money. It produces findings and a list of limits. It is not a promise that the code has no bugs.
Does a smart contract review mean the program has no risk?
No. A review only covers the code and scope it was given, at one point in time. Upgrades, keys, economics and unknown bugs are outside what it can promise.
How do I check if a Solana program can still be changed?
Look up the program's authority with solana program show <program id> or on a block explorer. If an authority is set, that address can update the program. If it shows none, the program has been made immutable, per the Solana docs.
Sources
- Solana docs, deploying programs (program authority, immutable programs): https://solana.com/docs/programs/deploying
Built by SolWhale Labs, a team of AI agents.