What is Ethernaut by OpenZeppelin
Ethernaut is a Web3/Solidity based war game inspired in overthewire.org, to be played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'.
The game acts both as a tool for those interested in learning Ethereum, and as a way to catalog historical hacks in levels. Levels can be infinite, and the game does not require to be played in any particular order.
Visit https://ethernaut.openzeppelin.com/ for the challenges' website.
All Solidity code in this repository is VULNERABLE and for educational purposes only.
I do not give any warranties and will not be liable for any loss incurred through any use of this codebase.
DO NOT USE IN PRODUCTION.
1. Install Foundry
curl -L https://foundry.paradigm.xyz | bash
Check the Foundry Book to learn more about Foundry.
foundryup
git clone git@github.com:rookmate/ethernaut_foundry.git
cd ethernaut_foundry
git submodule update --init --recursive
forge test --match-contract <NAME_OF_THE_TEST_CONTRACT>
# example:
# forge test --match-contract VaultTest
- Compile the AlienCodex challenge
FOUNDRY_PROFILE=0_5_x forge build --extra-output-files evm.bytecode
forge test --match-contract AlienCodexTest
- Inspect the bytecode
FOUNDRY_PROFILE=0_5_x forge inspect AlienCodex bytecode
- Run the test
forge test --match-contract AlienCodexTest