Skip to content
Lattice

ERC4626AdapterLib Constants

Git Source

ERC4626_ADAPTER_STORAGE_SLOT

keccak256(abi.encode(uint256(keccak256("lattice.storage.ERC4626Adapter")) - 1)) & ~bytes32(uint256(0xff)). Precomputed: 0x8e54862d9117c02647004a257ec52ba4f4c6ce02a01e23235ed8d34a2127c500

bytes32 constant ERC4626_ADAPTER_STORAGE_SLOT = 0x8e54862d9117c02647004a257ec52ba4f4c6ce02a01e23235ed8d34a2127c500;

ERC4626_ADAPTER_ERC165_STORAGE_LOCATION

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

bytes32 constant ERC4626_ADAPTER_ERC165_STORAGE_LOCATION =
    0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200;

ERC165_MAP_IPROTOCOLADAPTER_SLOT

0x8f7783e6 is type(IProtocolAdapter).interfaceId (same value the Aave/Compound adapters register; the ERC-165 map slot is shared because the interface ID is identical). keccak256(abi.encode(bytes4(0x8f7783e6), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_IPROTOCOLADAPTER_SLOT = 0x789387b95720f4aa713e912bc377a2f999f1310b69003727d9c01b7ea1494c77;

ERC165_MAP_IERC4626ADAPTER_SLOT

0x6189942b is type(IERC4626Adapter).interfaceId. keccak256(abi.encode(bytes4(0x6189942b), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_IERC4626ADAPTER_SLOT = 0x84ec7ed953664aca1f16de58454031d5ee56bdfdc133c3183893a830a7b1c08b;