Thanks for the update and the good work. I’m repeating the challenges and I’ve already raised what I believe is an issue with level 10 advice on using transfer.
Just some context - I shared this on the OpenZeppelin telegram group but was directed by Andrew to share this here instead. Not sure if this is the right place to do this but didn’t want to make a new thread.
TL;DR: Validation logic of level 4 (telephone) might be slightly wrong.
iirc, the goal of this level is to simply change the owner of the contract to another owner so it doesn't matter who I set owner to (whether it's player aka tx.origin or my AttackTelephone address).
your changeBadOwner changes the owner to the contract instance address of AttackTelephone instead of player .
I'm not quite sure I understand this. The logic in changeBadOwner changes the owner to the address that badOwner is pointing to no?
@STYJ, the Telephone level's mission statement is "Claim ownership of the contract below to complete this level"1.
So I think the validation code containing rqeuire instance.owner() == _player is reasonable2.
The logic in changeBadOwner changes the owner to the address that badOwner is pointing to no?
I meant that your AttackTelephone.changeBadOwner code should call Telephone.changeOwner with tx.origin instead of address(this). The former would be the address of _player while the latter would be the address of the AttackTelephone instance.
Oh... I understand now. I thought you were referring to this which is why I was wondering why you talked about msg.sender and tx.origin. Got it! Thank you for clarifying