I am starting a series of writeup of the Ethernaut challenges, this project have been initiated by OpenZeppelin team to teach basic knowledge of smart contracts auditing.
The challenges will be resolved with Foundry, the client, if needed will be written in Golang and the smart contracts will be written in Solidity.
The current list of challenges are:
- Hello Ethernaut
- Fallback
- Fallout
- CoinFlip
- Telephone
- Token
- Delegation
- Force
- Vault
- King
- Re-Entrancy
- Elevator
- Privacy
- GatekeeperOne
- GatekeeperTwo
- NaughtCoin
- Preservation
- Recovery
- Magic Number
- AlienCodex
- Denial
- Shop
- Dex
- Dex Two
- PuzzleWallet
- Motorbike
The folder structure of each challenge is:
|
|
When a smart contract is needed to resolve the challenge, foundry will be used. The environment can be created with
|
|
It will look like this
|
|
To convert easily the solidity code to go code the solidity2go.sh
script will be used:
|
|
In the same folder, the node_modules should be installed
|
|
For example for the challenge 1-Fallback, the script will be called like this:
|
|
I’m going to learn a lot during this series, so the solutions written in Go or Solidity will probably get better and better as I go through the challenges.