gaslimitreached / ethernaut-x-foundry

Ethernaut puzzles solved with foundry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Ethernaut puzzles solved & tested with foundry.




@0xEval has written an excellent run through of how the repo is configured and how to get setup on it.


This repo is setup to enable you to run the ethernaut levels locally rather than on Rinkeby. As a result you will see some contracts that are not related to individual level but instead to ethernaut's core contracts which determine if you have passed the level.

These are the Ethernaut.sol & BaseLevel.sol contracts in the root of ./src and the factory contracts which have a naming convention of [LEVEL_NAME]Factory.sol in each levels repo. Have a read through if interested in what they do otherwise they can be ignored.

Make sure you're on the latest version of forge, what is your forge —version output? If it doesn’t show a date, try rm -rf ~/.cargo/bin/cast && rm -rf ~/.cargo/bin/forge

At the root of the repo run

forge install 
forge test

File Locations

Individual Levels can be found in their respective folders in the ./src folder.

Eg Fallback is located in ./src/Fallback/Fallback.sol

Tests for each level can be found in the ./src/test folder and have the naming convention [LEVEL_NAME].t.sol

Eg Fallback test are located in ./src/test/Fallback.t.sol


1. Fallback
2. Fallout
3. CoinFlip
4. Telephone
5. Token
6. Delegation
7. Force
8. Vault
9. King
10. Re-Entrancy
11. Elevator
12. Privacy
13. GatekeeperOne
14. GatekeeperTwo
15. NaughtCoin
16. Preservation
17. Recovery
18. Magic Number
19. AlienCodex
20. Denial
21. Shop
22. Dex
23. Dex Two
24. PuzzleWallet
25. Motorbike


@cmichelio for his hardhat x ethernaut repo

@0xSage for his great ethernaut tutorials - breaking down how each level can be defeated

@gakonst for his help on the foundry support channels and the tool itself

@the_ethernaut for the puzzles to solve & learn from


Ethernaut puzzles solved with foundry

License:MIT License


Language:Solidity 99.7%Language:Makefile 0.2%Language:Nix 0.1%