Skip to content
Lattice

ERC20CrosschainInit

Git Source

Title: ERC20CrosschainInit

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

One-shot initializer for a self-bridging ERC-20 diamond: seeds AccessControl (the crosschain-link admin setters), the ReentrancyGuard used by the crosschain transfer path, the base ERC20 (name/symbol + ERC-165), the CrosschainLink receive/send registry, and the ERC20Crosschain self-bridge (registers IBridgeFungible). 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). Runs the exact __*_init sequence the legacy inheritance mock performed, but on a REAL diamond. Companion to the ERC20Init/ERC2981Init patterns.

Functions

init

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

function init(address admin, string memory name_, string memory symbol_) external;

Parameters

NameTypeDescription
adminaddressThe address granted DEFAULT_ADMIN_ROLE (controls setLink/setHandler).
name_stringToken name.
symbol_stringToken symbol.