The tx variable provides transaction-related information:
- tx.gasprice: This provides the gas price of the transaction set by transaction initiator, as a uint256 value.
- tx.origin: This provides the original sender of the transaction from the full call chain as an address. As all of the transactions are always initiated from an EOA, we can say that tx.origin will always return an address of an EOA. Therefore, the use of tx.origin is not recommended. Refer Chapter 14, Tips, Tricks, and Security Best Practices for more details.