Skip to content

A customized foundry environment for solving challenges from the ethernaut ctf

Notifications You must be signed in to change notification settings

irreverent-eth/ethernaut-foundry

 
 

Repository files navigation

Ethernaut Reforged 👩‍🚀🔨

This repo is a customized Foundry environment where devs can create/solve/submit ethernaut challenges without the need for interaction with the Ethernaut CTF webiste.

Setup

  • Have Foundry downloaded
  • Clone this repo
  • Copy the items in .env.example with your own credentials
  • Open /script/setup/EthernautHelper.sol and edit the HERO variable to your own address
  • Get some testnet eth (Sepolia is recommended as ether is easier to comeby)

Completing A Challenge

While the challenge contracts are part of the repo (challenge-contracts), it's recommended that you use interfaces when interacting with the challenge contracts to avoid issues compiling when requiring old solidity versions and older versions of OpenZeppelin contracts for some of the challenges.

When you think you've created the script that solves the challenge call the following:

source .env
forge script script/solutions/SCRIPT_FILE_NAME.s.sol:SCRIPT_CONTRACT_NAME --rpc-url $SEPOLIA_RPC

This will run a local simulation of your transaction off chain, if your script passes the challenge, run the same forge script ... command again but add --broadcast to broadcast the transaction(s) on chain.

Further Updates

This repo is still a work in progress, and eventually all 29 of the Ethernaut challenges will be added. The description and hints from the ethernaut site for each challenge will be bought over as well as adding some extra resources based on the specific vulnerability the challenge highlights including educational content and real world examples.

About

A customized foundry environment for solving challenges from the ethernaut ctf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 100.0%