0

I wanted to know how to distinguish between a function call from an externally owned user account and a function call from another smart contract in solidity. Can anyone help me with this?

MikhilMC
  • 133
  • 4

1 Answers1

0

Yes, check if tx.origin == msg.sender. In this case msg.sender must be an externally owned account. Otherwise msg.sender can't be an externally owned account.

Check What's the difference between 'msg.sender' and 'tx.origin'?