Skip to content
Lattice

ERC7802

Git Source

Inherits: IERC7802

Title: ERC7802

Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Modified from ERC-7802 (https://eips.ethereum.org/EIPS/eip-7802)

ERC-7802 crosschain-native ERC-20 extension facet: a trusted bridge (holder of CROSSCHAIN_BRIDGE_ROLE) mints on the destination chain and burns on the source. Mount alongside the ERC20 facet; pairs with a BridgeERC7802 that holds the role.

Stateless delegator — logic in ERC7802Lib, balances/roles reuse the ERC20 + AccessControl storage.

Note:

  • lattice-version: 0.1.0

Functions

crosschainMint

Mint tokens through a crosschain transfer.

function crosschainMint(address _to, uint256 _amount) external virtual override;

Parameters

NameTypeDescription
_toaddress
_amountuint256

crosschainBurn

Burn tokens through a crosschain transfer.

function crosschainBurn(address _from, uint256 _amount) external virtual override;

Parameters

NameTypeDescription
_fromaddress
_amountuint256

exportSelectors

ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).

Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches forge inspect ERC7802 methodIdentifiers (alphabetical by signature); kept in exact parity by ExportSelectorsParityTest. Chunks: crosschainBurn(address,uint256) 0x2b8c49e3 crosschainMint(address,uint256) 0x18bf5077

function exportSelectors() external pure virtual returns (bytes memory selectors);

Returns

NameTypeDescription
selectorsbytes