How to audit a smart contract
A guide on auditing a smart contract, including what tools you can use
Table of Contents for How to audit a smart contract
Iβll write a proper guide soon on how to audit a Solidity smart contract, but until I write that up here are some good introduction guides to auditing Solidity.
-
for a very high level overview, Binance have a good intro guide https://academy.binance.com/en/articles/what-is-a-smart-contract-security-audit
-
https://www.devteam.space/blog/how-to-audit-a-smart-contract-a-guide/
-
You should be able to easily complete every ethernaut challenge: https://ethernaut.openzeppelin.com/
-
You should also easily be able to complete https://www.smartcontract.engineer/challenges
-
Read existing audits. For example:
- https://github.com/ConsenSys/Uniswap-audit-report-2018-12/blob/master/Uniswap-final.md
- https://omniscia.io/reports/alliance-block-multitoken-bridge/
- https://omniscia.io/
- https://certificate.quantstamp.com/full/aavegotchi-ghst-staking
- https://github.com/pie-dao/audits/blob/main/Mixbytes - ExperiPie_Smart_Contrac 2020-12-11.pdf
- https://github.com/trailofbits/publications#security-reviews
-
https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/edit
-
https://blog.openzeppelin.com/solidity-compiler-audit-8cfc0316a420/ https://blog.openzeppelin.com/security-audits/
-
https://docs.arcadia.agency/audits-and-code-reviews/directory
-
https://github.com/immunefi-team/Web3-Security-Library?utm_source=immunefi
-
https://github.com/peckshield/publications/tree/master/audit_reports
-
https://github.com/trailofbits/publications/tree/master/reviews
-
https://medium.com/immunefi/a-poc-of-the-hundred-finance-heist-4121f23a098
-
https://web3sec.notion.site/Web3-security-ddaa8bf9a985494dbaf70d698345b899/
Types of issues audits can find
Denial of service
For example, allowing an array to grow to an unbounded size and allowing a function to return this (ever growing) array.
TODO - more coming soon
This post is incomplete and a work-in-progress
I'll update it soon and flesh it out with
more
info!
Spotted a typo or have a suggestion to make this crypto dev article better? Please let me know!
Next post
Previous post
π Solidity Auditing online quiz
Learn how to audit smart contracts by looking at some example code and trying to find the bugs
β½ Solidity Gas Optimizations Guide
How to optimize and reduce gas usage in your smart contracts in Solidity
π§ͺ Guide to testing with Foundry
Guide to adding testing for your Solidity contracts, using the Foundry and Forge tools
π Guide to UTXO
UTXO and the UTXO set (used by blockchains such as Bitcoin) explained
π Solidity Assembly Guide
Introduction guide to using assembly in your Solidity smart contracts
π¦ Ethereum EOF format explained
Information explaining what the upcoming Ethereum EOF format is all about