_msgSender() returns the same address as msg.sender


In my app I have such flow:

User -> contract A -> contract B

On contract B I'd like to get address of User (the original caller).
I've tested both _msgSender() and msg.sender and both return the same value = contract A address.

Is there other safe way to achieve what I'm looking for with _msgSender() or do I have to use tx.origin?

You can use delegate call

You have to use tx.origin

And of course - in the words of Vitalik himself - never use tx.origin.

1 Like

That is really great batch of data :wink:

switched to eip2535 after getting familiar with delegate call.
Thank you!

You are welcome. If you need any help, then please let me know.