GovernedDiamondCutLib Constants
GOVERNED_DIAMOND_CUT_STORAGE_SLOT
keccak256(abi.encode(uint256(keccak256("lattice.storage.GovernedDiamondCut")) - 1)) & ~bytes32(uint256(0xff)).
Verify with: cast index-erc7201 "lattice.storage.GovernedDiamondCut".
bytes32 constant GOVERNED_DIAMOND_CUT_STORAGE_SLOT = 0x9a46da229426897da8e8df190858c430564a988584235445fd229e2bef8a8700;GOVERNED_DIAMOND_CUT_ERC165_STORAGE_LOCATION
ERC-165 storage location (same across all Lattice/diamond-lib modules).
keccak256(abi.encode(uint256(keccak256("diamond.lib.storage.ERC165")) - 1)) & ~bytes32(uint256(0xff)).
bytes32 constant GOVERNED_DIAMOND_CUT_ERC165_STORAGE_LOCATION =
0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200;ERC165_MAP_ICUT_SLOT
type(IGovernedDiamondCut).interfaceId == 0x1f931c1c, identical to IDiamondCut (the
interface exposes only diamondCut). Its ERC-165 map slot is therefore
keccak256(abi.encode(bytes4(0x1f931c1c), ERC165_STORAGE_LOCATION))
= 0xa0f80413692945aab97c6ef0328381ebb94e4b17a84d11ebf6b61f73435b6d7e, which is exactly
DiamondLib's ERC165_MAP_ICUT_SLOT. We do NOT mint a separate constant or register a
second time: DiamondLib.registerInterface() already sets this flag in any 2535 deployment.
bytes32 constant ERC165_MAP_ICUT_SLOT = 0xa0f80413692945aab97c6ef0328381ebb94e4b17a84d11ebf6b61f73435b6d7e;UPGRADE_EXECUTOR_ROLE
Role required to execute a governed cut. Granted ONLY to address(this) at init AND pinned to
administer ITSELF (__GovernedDiamondCut_init calls _setRoleAdmin(role, role)), so the
intended caller is a timelock relaying a passed governance proposal back into the diamond.
Self-administration is essential: it removes DEFAULT_ADMIN_ROLE (0x00, the unset default) as
the role's admin, so a live DEFAULT_ADMIN_ROLE holder can NOT grantRole it to an attacker
and skip the Governor/Timelock path. Only an existing holder — address(this) — can grant a new
executor. CO-CUT CAVEAT: the holder is the diamond itself, so ANY co-cut facet that lets an
outsider make the diamond call itself also holds this role, with no vote and no delay. A co-cut
AccessManager is one: its ADMIN_ROLE can execute(address(this), diamondCut(...)) (#240).
The vote-and-delay guarantee holds only if no such facet is cut, or if it answers to governance
(see "Composition hazards" in docs/guides/compose-your-own-diamond.md).
keccak256("UPGRADE_EXECUTOR_ROLE").
bytes32 constant UPGRADE_EXECUTOR_ROLE = keccak256("UPGRADE_EXECUTOR_ROLE");