Ethernaut CTF challenges solutions using Solidity and Foundry.
Clone the repo and install dependencies:
git clone https://github.com/gabr1sr/ethernaut-foundry-solutions.git
forge install
Copy .env.example
file to .env
, open and set environment variables:
cp .env.example .env
Compile contracts:
forge build
Choose a challenge, change the address and run the respective challenge script:
source .env
forge script script/HelloEthernaut.s.sol:HelloEthernautScript --private-key $PRIVATE_KEY --broadcast --rpc-url $SEPOLIA_RPC_URL
You can simply run all tests using:
forge test -vvvv