Welcome! It is going to be a long but immensely educational road. This level prepares you on how to use the console. Start by typing help()
! Get comfortable with the commands you see there. You will need some test ether too, so please do visit the faucets linked there and get some ether!
To start, click on the big blue button to get a new level instance. This will be your target contract on all puzzles. You will be doing stuff to it, hijacking it's ownership, draining its balance and whatever!
The rest of the level starts by calling
contract.info()
. In Chrome v62 (or Brave browser), you can useawait
in the console. That makes things a lot easier; callawait contract.info()
. Note that once you get tocontract.
the console will show you the properties of the contract object, and there are a bunch of functions there!It tells us that we have what we need in
info1()
. So naturally, we will callawait contract.info1()
.We are told to call
info2()
with"hello"
parameter! We do so withawait contract.info2("hello")
.We are told to check the
infoNum()
property. When we do so withawait contract.infoNum()
we get some weird stuff back in our console. What the hell is this?? Fret not, tis a mere BigNumber object. You can convert it to a number or string viatoNumber()
ortoString()
. Once we do so, we see that it denotes the number 42.
{
negative: 0,
words: [
42,
// empty
],
length: 1,
red: null
}
We know what to do already, let's call
await contract.info42()
. We see that we should have calledtheMethodName
instead.So we do:
await contract.theMethodName
. Oh, we need to callmethod7123949
instead!Once we call
await contract.method7123949()
, we see the following message: "If you know the password, submit it toauthenticate()
". Do we know the password? There certainly seems to be apassword()
function as a property of ourcontract
object, so let's call it!After
await contract.password()
we get the password asethernaut0
. Submitting this toawait contract.authenticate("ethernaut0")
prompts us to confirm a transaction!
Once that is mined, we seem to have nothing more to do. As the next natural thing to do, we may as well submit our instance (the orange button). Indeed, that is the end of the level! Congratulations, you are now ready for the real deal.
Top comments (0)