Interfaces

Smart contract interfaces utilities and implementations

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

IERC7786Receiver

IERC7802

IERC7821

IERC7913SignatureVerifier

IERC7943

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

Interface for ERC-7786 source gateways.

See ERC-7786 for more details

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 IERC7786GatewaySource.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.

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

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

See ERC-7786 for more details

receiveMessage(bytes32 receiveId, bytes sender, bytes payload) → bytes4

external

#

Endpoint for receiving cross-chain message.

This function may be called directly by the gateway.

import "@openzeppelin/contracts/interfaces/IERC7802.sol";

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

#
import "@openzeppelin/contracts/interfaces/IERC7821.sol";

Interface for minimal batch executor.

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.
import "@openzeppelin/contracts/interfaces/IERC7943.sol";

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

#
import "@openzeppelin/contracts/interfaces/IERC7969.sol";

This interface provides a standard way to register and validate DKIM public key hashes onchain Domain owners can register their DKIM public key hashes and third parties can verify their validity The interface enables email-based account abstraction and secure account recovery mechanisms.

NOTE: The ERC-165 identifier for this interface is 0xdee3d600.

isKeyHashValid(bytes32 domainHash, bytes32 keyHash) → bool

external

#

Checks if a DKIM key hash is valid for a given domain

KeyHashRegistered(bytes32 domainHash, bytes32 keyHash)

event

#

Emitted when a new DKIM public key hash is registered for a domain

KeyHashRevoked(bytes32 domainHash)

event

#

Emitted when a DKIM public key hash is revoked for a domain