Skip to content
Lattice

GovernedDiamondCutInit

Git Source

Title: GovernedDiamondCutInit

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

One-shot initializer for a governed diamond-cut diamond — seeds AccessControl (so guardian management + emergencyResume are DEFAULT_ADMIN_ROLE-gated), EmergencyStop, registers the IERC165 + IDiamondCut + IDiamondLoupe ERC-165 flags, and pins UPGRADE_EXECUTOR_ROLE to itself (granted to address(this)). 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). Mirrors exactly what the old MockGovernedDiamond.initialize did, minus the redundant pre/postInitializer. Companion to the ERC2981Init pattern — a first-class production deploy artifact.

Functions

init

Runs the access-control + emergency-stop + governed-cut 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 (manages guardians and resumes operation).