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
-
supportsAttribute(selector)
-
sendMessage(destinationChain, receiver, payload, attributes)
-
MessagePosted(outboxId, sender, receiver, payload, attributes)
-
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.
IERC7786Receiver
import "@openzeppelin/community-contracts/interfaces/IERC7786.sol";
Interface for the ERC-7786 client contract (receiver).
See ERC-7786 for more details
-
executeMessage(messageId, sourceChain, 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.
IERC7913SignatureVerifier
import "@openzeppelin/community-contracts/interfaces/IERC7913.sol";
Signature verifier interface.
-
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