Ethernaut Puzzle 02 Fallout
This problem requires us to become the owner of this smart contract.
This may be the easiest problem in this series. All you need is careful observation.
1 | contract Fallout { |
The constructor function is misspelt… It should be Fallout
instead of Fal1out()
. See the difference between the number 1
and the letter l
.
In this currect situation, anyone can claim the ownership of this smart contract. All we need to do is just invoke Fal1out function then we become the owner of this smart contract. Then this problem is resolved !
By the way, now the correct way of writing the constructor function is just:
1 | contract Fallout { |
I would say this way is much safier. Even if you spell wrong, the compiler will definitely raise the error as this function is quite different with other functions. (no function
flag)