My solutions to the Ethernaut challenges using Hardhat.
-
Clone this repository:
git clone https://github.com/Autosaida/ethernaut-x-hardhat.git
-
Install the dependencies:
cd ethernaut-x-hardhat npm install
-
Create a new
.env
file with your own private key and RPC endpoint, following the example provided in.env.example
. -
Optional: Modify the
hardhat.config.ts
file to use a different node provider or testnet. By default, it uses the Infura node and Sepolia testnet.
The contracts
directory contains all the contract files, and the scripts
directory contains the scripts used to interact with the contracts.
To test the solutions locally on a forked network, use the following command:
npx hardhat run ./scripts/01-Fallback.ts
To run on the testnet, specify the network as follows:
npx hardhat run ./scripts/01-Fallback.ts --network sepolia
Please note that you should set the instance_address
in the scripts to the address of the specific challenge contract you want to interact with.
Happy hacking!