Skip to content
Lattice

BridgeERC7802Init

Git Source

Title: BridgeERC7802Init

Author: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80)

One-shot initializer for a mint/burn-bridge diamond over an ERC-7802 token — seeds AccessControl, the reentrancy guard (the burn/mint path is nonReentrant), the CrosschainLink messaging registry, and configures the bridged token. Delegatecalled by Diamond.initialize inside the initializing window (so it must NOT open its own pre/postInitializer; each __*_init guard passes because the window is already open). Reverts BridgeZeroToken if token is the zero address.

Functions

init

Runs the access-control + reentrancy-guard + crosschain-link + bridge initializers. MUST be invoked via the diamond's initialize _init delegatecall.

function init(address admin, address token) external;

Parameters

NameTypeDescription
adminaddressThe address granted DEFAULT_ADMIN_ROLE (controls the link/handler registry).
tokenaddressThe ERC-7802 token minted/burned by the bridge.