Solve OpenZeppelin's Ethernaut challenges using Foundry.
This project provides structured smart contract solutions with automated tests for every level.
- Smart contract solutions for each Ethernaut level
- Automated tests for every solution
- Organized and easy-to-follow project structure
- Built entirely with Foundry tools
Follow these steps to set up the project on your local machine.
Install the following:
Clone the repository:
git clone https://github.com/fobabs/oz-ethernaut-foundry.git
cd oz-ethernaut-foundry
forge install
Run all tests with:
forge test
You can also run tests for a specific level by targeting the test file:
forge test --match-path test/LEVEL_NAME.t.sol
Replace LEVEL_NAME
with the actual level test filename.
oz-ethernaut-foundry/
│
├── src/ # Solution contracts
│
├── test/ # Test files for each level
│
├── foundry.toml # Foundry configuration
│
└── README.md # Project documentation
Each level has a solution in src/
and a matching test in test/
.
Contributions are welcome.
You can create issues for bugs or missing levels and open pull requests with improvements.
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request
Please follow clean coding practices and write tests for any new levels or improvements.
This project is licensed under the MIT License.