Ethernaut Challenge 2 Walkthrough w Code
Challenge 2
The key knowledge for this challenge is to know that Constructors are declared using the constructor
keyword or a function with the same name as the contract, in this case Fallout, as the contract name is Fallout.sol.
However, in the image above, there is an error in constructor function naming which is misnamed Fal1out
instead of Fal1out. This caused the function to be a public function instead of a constructor function.
Therefore all we need to do to exploit is to call await contract.Fal1out()
Solutions :
Hope that this short and sweet tutorial helped!
Previous Walkthroughs
Challenge 1: https://extremelysunnyyk.medium.com/ethernaut-challenge-1-walkthrough-w-code-2b96cecb99fa