Skip to content
Lattice

ERC2981Init

Git Source

Title: ERC2981Init

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

One-shot initializer for an ERC-2981 royalty diamond — registers the IERC2981 interface (ERC-165) and seeds AccessControl so the royalty setters are admin-gated. 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). Companion to the AccountInit and ERC20Init patterns — a first-class production deploy artifact.

Functions

init

Runs the royalty + access-control module initializers. MUST be invoked via the diamond's initialize _init delegatecall.

function init(address admin) external;

Parameters

NameTypeDescription
adminaddressThe address granted DEFAULT_ADMIN_ROLE (controls the royalty setters).