Ethernaut Puzzle 04 Telephone
This puzzle asks us to claim the ownership of this given smart contract. From the codes, we can see, the way for us to get the ownership is to let tx.origin
and msg.sender
different.
Here we list the defination of tx.origin
and msg.sender
:
- tx.origin (address): sender of the transaction (full call chain)
- msg.sender (address): sender of the message (current call)
If contract A
calls B
, and B
calls C
, in C
, msg.sender
is B
and tx.origin
is A
.
So for this problem, we need to write a smart contract to invoke the changeOwner
of smart contract Telephone
.
1 | // SPDX-License-Identifier: MIT |