MENU

Solidity tx.origin vs msg.sender

0
621
0

In solidity, there are two global variables that represent the previous transaction signer.

tx.origin vs msg.sender

Sometimes they are the same, but other times different from each other.

In Solidity official document, it describes like:

If your wallet had checked msg.sender for authorization, it would get the address of the attack wallet, instead of the owner address. But by checking tx.origin, it gets the original address that kicked off the transaction, which is still the owner address. The attack wallet instantly drains all your funds.

It sounds very complicated and doesn’t make sense easily.

But I made a fun game to help you understand it very easily, and yeah, this is a game you’d like to enjoy.

https://github.com/maAPPsDEV/telephone-attack

Sorry, the comment form is closed at this time.