# IERC2771Recipient

The ERC-2771 Recipient Base Abstract Class - Declarations

A contract must implement this interface in order to support relayed transaction.

It is recommended that your contract inherits from the ERC2771Recipient contract.

# Functions

# isTrustedForwarder(address forwarder)

→ bool (public)

⚠️ Warning ⚠️ The Forwarder can have a full control over your Recipient. Only trust verified Forwarder.

forwarder: The address of the Forwarder contract that is being used.

# Return values

true if the Forwarder is trusted to forward relayed transactions by this Recipient.


# _msgSender()

→ address (internal)

Use this method the contract anywhere instead of msg.sender to support relayed transactions.

# Return values

The real sender of this call. For a call that came through the Forwarder the real sender is extracted from the last 20 bytes of the msg.data. Otherwise simply returns msg.sender.


# _msgData()

→ bytes (internal)

Use this method in the contract instead of msg.data when difference matters (hashing, signature, etc.)

# Return values

The real msg.data of this call. For a call that came through the Forwarder, the real sender address was appended as the last 20 bytes of the msg.data - so this method will strip those 20 bytes off. Otherwise (if the call was made directly and not through the forwarder) simply returns msg.data.