This document provides a guide to making tokens compatible with the IXERC20
and IERC7802
interfaces, regardless of their deployment or upgradeability status.
The ERC-7802 introduces a minimal interface for bridges to burn and mint tokens.
/// @notice Mint tokens through a crosschain transfer.
/// @param _to Address to mint tokens to.
/// @param _amount Amount of tokens to mint.
function crosschainMint(address _to, uint256 _amount) external;
/// @notice Burn tokens through a crosschain transfer.
/// @param _from Address to burn tokens from.
/// @param _amount Amount of tokens to burn.
function crosschainBurn(address _from, uint256 _amount) external;
The goal of the ERC-7802 is to be a minimal component that other crosschain standards can build on top. In particular, the ERC-7281, also known as xERC20, uses standard mint
and burn
functions as entrypoints for the bridge. This naming discrepancy might create compatibility concerns, especially for already deployed xERC20 tokens and integrations.
This section outlines strategies to ensure tokens are compatible with both IXERC20
and IERC7802
, depending on their current deployment and upgradeability status. The flowchart below summarizes the decision-making process:
The IXERC20
and IERC7802
interfaces are fully compatible and can coexist within the same contract.
Implementing both mint/burn
and crosschainMint/crosschainBurn
introduces minor redundancy, as both are exclusively callable by bridges. However, this is not problematic since the logic can be shared. Each implementation can address the redundancy as needed without affecting functionality.
Bridges lack a standard API for interacting with tokens. Both ERC-7281 and 7802 aim to standarize this interaction. Most bridges, however, have still not implemented the required interface. For this reason, xERC20 suggests using Adapter contracts.
An Adapter: