Appearance
Solidity API
ERC2771Internal
Abstract contract implementing ERC2771 meta-transactions support. This contract extends OpenZeppelin's Context contract to provide trusted forwarder functionality for meta-transactions.
_isTrustedForwarder
solidity
function _isTrustedForwarder(address forwarder) internal view virtual returns (bool)Checks if the given address is a trusted forwarder.
Parameters
| Name | Type | Description |
|---|---|---|
| forwarder | address | The address to check. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | bool True if the address is a trusted forwarder, false otherwise. |
_msgSender
solidity
function _msgSender() internal view virtual returns (address sender)_Overrides the msgSender() function to support meta-transactions. If the message sender is a trusted forwarder, it extracts the original sender from the last 20 bytes of the calldata. Otherwise, it falls back to the default behavior.
Return Values
| Name | Type | Description |
|---|---|---|
| sender | address | The address of the original transaction sender. |
_msgData
solidity
function _msgData() internal view virtual returns (bytes)_Overrides the msgData() function to support meta-transactions. If the message sender is a trusted forwarder, it returns the calldata excluding the last 20 bytes (which contain the original sender address). Otherwise, it falls back to the default behavior.
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bytes | bytes calldata The original calldata, potentially truncated for meta-transactions. |