Common Smart Contract Bugs
Smart contracts hold real value and cant be patched casually once deployed, so a small mistake could be expensiive.
Bugs I look for first
- Reentrancy: an external call lets the caller re-enter before state is updated
- Missing access control on sensitive functions
- Integer and rounding errors in math
- Unchecked return values from low-level calls
- Price or oracle manipulation
My simple audit routine
- Read the docs and work out what the contract is meant to do.
- Run a static analyzer and note anything odd.
- Read every external and public function by hand.
- Write tests that try to break the rules.
- Write up findings with a clear fix for each one.
More detail on each class is in the SWC Registry.