π this project contains solutions for openzeppelin's ethernaut wargames. leveraging foundry, each level has a test set (test/*.t.sol
), a script set (script/*.s.sol
), and a write-up. some levels also have an exploit at src/*.sol
.
π to read the full notes about this work, check out my mirror publication: on hacking systematically with foundry. you are welcome to submit solutions and pull requests.
π by the way, do you remember overthewire? here is my WeChall profile from playing it in 2014.
-
install foundry
-
create a test wallet (e.g., with metamask)
-
create a
.env
(copying from.env.example
) and add keys and the addresses of each instance. -
add a sepolia rpc url to
foundry.toml
(e.g., from alchemy or infura)
- you will find detailed instructions in each write-up, but as a general rule:
- run tests with, for example,
forge test -vvvv
, or, for example,forge test -vvvv --match-path ./test/01/Fallback.t.sol
- submit scripts with, for example,
forge script ./script/01/Fallback.s.sol --broadcast -vvvv --rpc-url sepolia