In this repository, you'll find my answers to the puzzles presented in OpenZeppelin's Ethernaut wargames. With the help of Foundry, every puzzle comes with its own test suite (found in test/.t.sol), related scripts (in script/.s.sol), and a descriptive guide. Additionally, certain puzzles highlight an exploit available in src/*.sol.
- Download and set up Foundry.
- Set up a testing wallet, for instance using MetaMask.
- Create a .env file by duplicating .env.example and then input the necessary keys and instance addresses.
- Integrate a Sepolia RPC URL in foundry.toml. You can obtain this from sources like Alchemy or Infura.
Here's a general workflow:
forge test -vvvv
# or for a specific challenge
forge test -vvvv --match-path ./test/01/Fallback.t.sol
forge script ./script/01/Fallback.s.sol --broadcast -vvvv --rpc-url sepolia