Skip to content
Lattice

BridgeERC20Init

Git Source

Title: BridgeERC20Init

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

One-shot initializer for a custody-bridge diamond over a legacy ERC-20 — seeds AccessControl, the reentrancy guard (the lock/release 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 legacy ERC-20 token custodied by the bridge.