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.

Detailed ABI

IERC7786GatewaySource

import "@openzeppelin/community-contracts/interfaces/IERC7786.sol";

Interface for ERC-7786 source gateways.

See ERC-7786 for more details

Functions
  • supportsAttribute(selector)

  • sendMessage(recipient, payload, attributes)

Events
  • MessageSent(sendId, sender, receiver, payload, value, attributes)

Errors
  • 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.

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.

UnsupportedAttribute(bytes4 selector) error

This error is thrown when a message creation fails because of an unsupported attribute being specified.

IERC7786Receiver

import "@openzeppelin/community-contracts/interfaces/IERC7786.sol";

Interface for the ERC-7786 client contract (receiver).

See ERC-7786 for more details

Functions
  • executeMessage(receiveId, sender, payload, attributes)

executeMessage(bytes32 receiveId, bytes sender, bytes payload, bytes[] attributes) → bytes4 external

Endpoint for receiving cross-chain message.

This function may be called directly by the gateway.

IERC7802

import "@openzeppelin/community-contracts/interfaces/IERC7802.sol";
Functions
  • crosschainMint(_to, _amount)

  • crosschainBurn(_from, _amount)

IERC165
  • supportsInterface(interfaceId)

Events
  • CrosschainMint(to, amount, sender)

  • CrosschainBurn(from, amount, sender)

crosschainMint(address _to, uint256 _amount) external

crosschainBurn(address _from, uint256 _amount) external

CrosschainMint(address indexed to, uint256 amount, address indexed sender) event

CrosschainBurn(address indexed from, uint256 amount, address indexed sender) event

IERC7821

import "@openzeppelin/community-contracts/interfaces/IERC7821.sol";

Interface for minimal batch executor.

Functions
  • 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:

Supported modes:

  • bytes32(0x01000000000000000000…​): does not support optional opData.

  • bytes32(0x01000000000078210001…​): supports optional opData.

Authorization checks:

  • If opData is empty, the implementation SHOULD require that msg.sender == address(this).

  • If opData is not empty, the implementation SHOULD use the signature encoded in opData to determine if the caller can perform the execution.

opData may be used to store additional data for authentication, paymaster data, gas limits, etc.

supportsExecutionMode(bytes32 mode) → bool external

This function is provided for frontends to detect support. Only returns true for:

  • bytes32(0x01000000000000000000…​): does not support optional opData.

  • bytes32(0x01000000000078210001…​): supports optional opData.

IERC7943

import "@openzeppelin/community-contracts/interfaces/IERC7943.sol";
Functions
  • forceTransfer(from, to, tokenId, amount)

  • setFrozen(user, tokenId, amount)

  • getFrozen(user, tokenId)

  • isTransferAllowed(from, to, tokenId, amount)

  • isUserAllowed(user)

IERC165
  • supportsInterface(interfaceId)

Events
  • ForcedTransfer(from, to, tokenId, amount)

  • Frozen(user, tokenId, amount)

Errors
  • 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.

getFrozen(address user, uint256 tokenId) → uint256 amount external

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.

isUserAllowed(address user) → bool allowed external

This is often used for allowlist/KYC/KYB/AML checks.

ForcedTransfer(address indexed from, address indexed to, uint256 tokenId, uint256 amount) event

Frozen(address indexed user, uint256 indexed tokenId, uint256 amount) event

ERC7943NotAllowedUser(address account) error

ERC7943NotAllowedTransfer(address from, address to, uint256 tokenId, uint256 amount) error

ERC7943InsufficientUnfrozenBalance(address user, uint256 tokenId, uint256 amount, uint256 unfrozen) error