ERC7802Init
Title: ERC7802Init
Author: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80)
One-shot initializer for a crosschain-native ERC-20 diamond (ERC-7802): seeds AccessControl,
the base ERC20 (name/symbol + ERC-165), and registers the IERC7802 interface, then grants the
CROSSCHAIN_BRIDGE_ROLE to the trusted bridge. 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 + ERC-20 + ERC-7802 module initializers and grants the bridge role.
MUST be invoked via the diamond's initialize _init delegatecall.
function init(address admin, address bridge, string memory name_, string memory symbol_) external;Parameters
| Name | Type | Description |
|---|---|---|
| admin | address | The address granted DEFAULT_ADMIN_ROLE. |
| bridge | address | The trusted bridge granted CROSSCHAIN_BRIDGE_ROLE (mints/burns crosschain supply). |
| name_ | string | Token name. |
| symbol_ | string | Token symbol. |