Interfaces
This document is better viewed at https://docs.openzeppelin.com/contracts/api/interfaces |
List of standardized interfaces
These interfaces are available as .sol
files. These are useful to interact with third party contracts that implement them.
-
{IERC7913SignatureVerifier}
Detailed ABI
IERC7786GatewaySource
import "@openzeppelin/community-contracts/interfaces/IERC7786.sol";
Interface for ERC-7786 source gateways.
See ERC-7786 for more details
-
supportsAttribute(selector)
-
sendMessage(recipient, payload, attributes)
-
MessageSent(sendId, sender, receiver, payload, value, attributes)
-
UnsupportedAttribute(selector)
supportsAttribute(bytes4 selector) → bool
external
Getter to check whether an attribute is supported or not.
sendMessage(bytes recipient, bytes payload, bytes[] attributes) → bytes32 sendId
external
Endpoint for creating a new message. If the message requires further (gateway specific) processing before
it can be sent to the destination chain, then a non-zero outboxId
must be returned. Otherwise, the
message MUST be sent and this function must return 0.
-
MUST emit a
MessageSent
event.
If any of the attributes
is not supported, this function SHOULD revert with an UnsupportedAttribute
error.
Other errors SHOULD revert with errors not specified in ERC-7786.
MessageSent(bytes32 indexed sendId, bytes sender, bytes receiver, bytes payload, uint256 value, bytes[] attributes)
event
Event emitted when a message is created. If outboxId
is zero, no further processing is necessary. If
outboxId
is not zero, then further (gateway specific, and non-standardized) action is required.
IERC7786Receiver
import "@openzeppelin/community-contracts/interfaces/IERC7786.sol";
Interface for the ERC-7786 client contract (receiver).
See ERC-7786 for more details
-
executeMessage(receiveId, sender, payload, attributes)
IERC7802
import "@openzeppelin/community-contracts/interfaces/IERC7802.sol";
-
crosschainMint(_to, _amount)
-
crosschainBurn(_from, _amount)
-
supportsInterface(interfaceId)
-
CrosschainMint(to, amount, sender)
-
CrosschainBurn(from, amount, sender)
IERC7821
import "@openzeppelin/community-contracts/interfaces/IERC7821.sol";
Interface for minimal batch executor.
-
execute(mode, executionData)
-
supportsExecutionMode(mode)
execute(bytes32 mode, bytes executionData)
external
Executes the calls in executionData
.
Reverts and bubbles up error if any call fails.
executionData
encoding:
-
If
opData
is empty,executionData
is simplyabi.encode(calls)
. -
Else,
executionData
isabi.encode(calls, opData)
. See: https://eips.ethereum.org/EIPS/eip-7579
Supported modes:
-
bytes32(0x01000000000000000000…)
: does not support optionalopData
. -
bytes32(0x01000000000078210001…)
: supports optionalopData
.
Authorization checks:
-
If
opData
is empty, the implementation SHOULD require thatmsg.sender == address(this)
. -
If
opData
is not empty, the implementation SHOULD use the signature encoded inopData
to determine if the caller can perform the execution.
opData
may be used to store additional data for authentication,
paymaster data, gas limits, etc.
IERC7943
import "@openzeppelin/community-contracts/interfaces/IERC7943.sol";
-
forceTransfer(from, to, tokenId, amount)
-
setFrozen(user, tokenId, amount)
-
getFrozen(user, tokenId)
-
isTransferAllowed(from, to, tokenId, amount)
-
isUserAllowed(user)
-
supportsInterface(interfaceId)
-
ForcedTransfer(from, to, tokenId, amount)
-
Frozen(user, tokenId, amount)
-
ERC7943NotAllowedUser(account)
-
ERC7943NotAllowedTransfer(from, to, tokenId, amount)
-
ERC7943InsufficientUnfrozenBalance(user, tokenId, amount, unfrozen)
forceTransfer(address from, address to, uint256 tokenId, uint256 amount)
external
Requires specific authorization. Used for regulatory compliance or recovery scenarios.
setFrozen(address user, uint256 tokenId, uint256 amount)
external
Requires specific authorization. Frozen tokens cannot be transferred by the user.
isTransferAllowed(address from, address to, uint256 tokenId, uint256 amount) → bool allowed
external
This may involve checks like allowlists, blocklists, transfer limits and other policy-defined restrictions.