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(destinationChain, receiver, payload, attributes)

Events
  • MessagePosted(outboxId, sender, receiver, payload, attributes)

Errors
  • UnsupportedAttribute(selector)

supportsAttribute(bytes4 selector) → bool external

Getter to check whether an attribute is supported or not.

sendMessage(string destinationChain, string receiver, bytes payload, bytes[] attributes) → bytes32 outboxId 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.

MessagePosted(bytes32 indexed outboxId, string sender, string receiver, bytes payload, 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(messageId, sourceChain, sender, payload, attributes)

executeMessage(string messageId, string sourceChain, string sender, bytes payload, bytes[] attributes) → bytes4 external

Endpoint for receiving cross-chain message.

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.

IERC7913SignatureVerifier

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

Signature verifier interface.

Functions
  • verify(key, hash, signature)

verify(bytes key, bytes32 hash, bytes signature) → bytes4 external

Verifies signature as a valid signature of hash by key.

MUST return the bytes4 magic value IERC7913SignatureVerifier.verify.selector if the signature is valid. SHOULD return 0xffffffff or revert if the signature is not valid. SHOULD return 0xffffffff or revert if the key is empty