This is entire contract for the ethernaut Telephone question. I created attack() function, but a youtuber suggests constructor(). Anyone knows why?

1 Answer 1


It's not important. A contracts constructor is ran at deployment time, so it would save one transaction (everything happens on deployment instead of you having to deploy then call the attack() function) but that's the only point.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.