cypherpunk-symposium
ethernaut-foundry-framework-solutions-sol
Solidity

๐Ÿ‘พ my foundry framework and detailed solutions for each ethernaut level

Last updated May 13, 2025
20
Stars
4
Forks
17
Issues
0
Stars/day
Attention Score
10
Language breakdown
No language data available.
โ–ธ Files click to expand
README

๐Ÿง‘๐Ÿปโ€๐Ÿš€ my foundry framework to solve ethernaut: write-ups + solutions


๐Ÿ”‹ 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.



levels


โœ… 01. Fallback - exploiting fallback():
โœ… 02. Fallout - exploiting constructor():
โœ… 03. Coin Flip - exploiting pseudo-randomness:
โœ… 04. Telephone - exploiting tx.origin:
โœ… 05. Token - exploiting integer overflows:
โœ… 06. Delegation - exploiting delegatecall:
โœ… 07. Force - exploiting payable contracts:
โœ… 08. Vault - exploiting private functions:
โœ… 09. King - exploiting transfer(msg.value):
โœ… 10. Reentrancy - exploiting reentrancy:
โœ… 11. Elevator - exploiting interfaces:
๐Ÿ”œ 12. Privacy:
๐Ÿ”œ 13. Gatekeeper One:
๐Ÿ”œ 14. Gatekeeper Two:
๐Ÿ”œ 15. Naught Coin:
๐Ÿ”œ 16. Preservation:
๐Ÿ”œ 17. Recovery:
๐Ÿ”œ 18. Magic Number:
๐Ÿ”œ 19. Alien Code:
๐Ÿ”œ 20. Denial:
โœ… 21. Shop - exploiting interfaces II:
๐Ÿ”œ 22. Dex:
๐Ÿ”œ 23. Dex Two:
๐Ÿ”œ 24. Puzzle Wallet:
๐Ÿ”œ 25. Motorbike:
๐Ÿ”œ 26. Doubly Entry Point:
๐Ÿ”œ 27. Good Samaritan:
๐Ÿ”œ 28. Gatekeeper Three:
๐Ÿ”œ 29. Switch:



installing


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)



running each level


  • 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





(like solving these types of problems? perhaps you are autistic cypherpunk, then?)
๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท cypherpunk-symposium/ethernaut-foundry-framework-solutions-sol ยท Updated daily from GitHub