31 - Contract check
Checking if a call was made from an Externally Owned Account (EOA) or a contract account is typically done using extcodesize
check which may be circumvented by a contract during construction when it does not have source code available. Checking if tx.origin == msg.sender
is another option. Both have implications that need to be considered. (see here)
- Contract vs EOA
- excodesize > 0
- msg.sender == tx.origin
- Pros & Cons -> Applications
- Risk Awareness -> Implications