Skip to content
Lattice

SafeHarborAdopterLib Constants

Git Source

SAFE_HARBOR_ADOPTER_STORAGE_SLOT

keccak256(abi.encode(uint256(keccak256("lattice.storage.SafeHarborAdopter")) - 1)) & ~bytes32(uint256(0xff)). Verify with: cast index-erc7201 "lattice.storage.SafeHarborAdopter".

bytes32 constant SAFE_HARBOR_ADOPTER_STORAGE_SLOT = 0xaaf15994f2af30ab6b279714cd625e3af0592976549136cf56b423f8b1439400;

SAFE_HARBOR_ADOPTER_ERC165_STORAGE_LOCATION

ERC-165 storage location (same across all Lattice modules). keccak256(abi.encode(uint256(keccak256("diamond.lib.storage.ERC165")) - 1)) & ~bytes32(uint256(0xff)).

bytes32 constant SAFE_HARBOR_ADOPTER_ERC165_STORAGE_LOCATION =
    0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200;

ERC165_MAP_ISAFEHARBORADOPTER_SLOT

0x2a3e8e12 is type(ISafeHarborAdopter).interfaceId. keccak256(abi.encode(bytes4(0x2a3e8e12), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_ISAFEHARBORADOPTER_SLOT =
    0xc27d89bdc7ce502086d0749a1bda2c210ca866065fa49ea19147ad53e8e018ad;

SAFE_HARBOR_ADMIN_ROLE

Role allowed to adopt / update the diamond's Safe Harbor agreement. Distinct, high-stakes permission because the agreement designates the asset-recovery address(es) for rescued funds. Administered by DEFAULT_ADMIN_ROLE BY DESIGN (it is not self-administered, since no holder is granted at init — self-administration would render it permanently un-grantable). The recovery-address trust boundary therefore equals the diamond's root admin.

bytes32 constant SAFE_HARBOR_ADMIN_ROLE = keccak256("SAFE_HARBOR_ADMIN_ROLE");