Why use _msgSender() rather than msg.sender?

I’ve seen many contracts that instead of using msg.sender directly, they use a function that returns the msg.sender, why is this?

1 Like

Hi @franco_villa_santana,

_msgSender() is a replacement for msg.sender. For regular transactions it returns msg.sender and for meta transactions it can be used to return the end user (rather than the relayer).

1 Like