Skip to content
Lattice

AccessControlInit

Git Source

Title: AccessControlInit

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

One-shot initializer for an AccessControl role diamond — grants the DEFAULT_ADMIN_ROLE to admin and registers the IAccessControl interface (ERC-165). Delegatecalled by Diamond.initialize inside the initializing window (so it must NOT open its own pre/postInitializer; the __AccessControl_init guard passes because the window is already open). Companion to the ERC20Init/ERC2981Init patterns — a first-class production deploy artifact.

Functions

init

Seeds the AccessControl module. MUST be invoked via the diamond's initialize _init delegatecall.

function init(address admin) external;

Parameters

NameTypeDescription
adminaddressThe address granted DEFAULT_ADMIN_ROLE.