The msg variable provides the information related to the transaction sender and some transaction data:
- msg.data: This provides the full call data, represented as bytes, which is sent by the transaction initiator. The data includes the first 4 bytes of method-hash to be executed, followed by the arguments of the method.
- msg.sender: This provides the sender of the message's current call as the address. When an external contract call is initiated from a contract, msg.sender will return the contract address of the caller contract.
- msg.sig: This provides the first 4 bytes of the function signature, to be executed as bytes4.
- msg.value: This provides the amount of wei sent along with the transaction, ...