DEV Community

hamzairshad02
hamzairshad02

Posted on

Ethernaut Level 0 Walkthrough - Hello Ethernaut

Initial Setup:

First, set up a MetaMask Wallet by giving a password of your choice and verifying your given mnemonic phrase.

After that, make sure to select the ‘Show test networks’ option ON in the Settings > Advanced tab to reveal test networks and convert your network to ‘Rinkeby Test Network’ according to the level.

Image description

Now refresh the Level 0 page and MetaMask will prompt you to connect the wallet.

Image description

After connecting the wallet, open Developer Tools on your browser and you’ll see a message from Ethernaut showing the Level, Player (You) and Ethernaut Address. Also type in the player command to verify that everything’s working fine.

Image description

Now things are pretty straightforward from here. Now as per the instructions, type in the command getBalance(player) or await getBalance(player) to see your balance. As of now, your balance must be 0 and you might not be able to run the next command that is ethernaut.owner() which requires some balance to pay for the gas price.

So for that, skip to Step 6. of the level and get some faucet first. I used this link to connect my wallet and get some faucet of 0.1ETH which is more than enough to complete the level. Now check the command ethernaut.owner() to see it working.

Image description

The Game Begins:

Now this is where your level actually begins, as per instructions click the ‘Get new Instance’ button at bottom of page to start the instance, it will again prompt your MetaMask to add the address, give it a nickname and then do a transaction and now you’ll see a ‘Submit Instance’ button beside it.

You will also start seeing an Instance Address in your console.

Image description

Now you can start playing with the contract variable. I’d advise to first run contract.abi and expand it to see all the methods that are present as all of them will be necessary for you to complete the level.

Start with contract.info() and go down the rabbit hole until you get stuck on contract.authenticate()

Image description

As you saw all the methods by using contract.abi you’ll remember that there are two more methods that are still unused. ‘password’ and ‘getCleared’. Use the contract.password() to get the password and paste it in the contract.authenticate() method as a parameter. This will prompt MetaMask again for a transaction. After that, run contract.getCleared() to see if the result comes out to be ‘true’.

Image description

Congratulations! You have cleared level 0. Now click on ‘Submit Instance’ button to finish the level. This will ask for one last transaction on MetaMask and you’ll see a confirmation on your console.

Image description

Top comments (0)