Skip to content
Lattice

CompoundV3AdapterLib Constants

Git Source

COMPOUND_V3_ADAPTER_STORAGE_SLOT

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

bytes32 constant COMPOUND_V3_ADAPTER_STORAGE_SLOT = 0x96f5f0ff446cccea8e0037b1046912f9609bac8e9b25707c9fadf78bc2d9fe00;

COMPOUND_V3_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 COMPOUND_V3_ADAPTER_ERC165_STORAGE_LOCATION =
    0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200;

ERC165_MAP_IPROTOCOLADAPTER_SLOT

0x8f7783e6 is type(IProtocolAdapter).interfaceId (same value the Aave adapter registers; 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_ICOMPOUNDV3ADAPTER_SLOT

0xa01f1203 is type(ICompoundV3Adapter).interfaceId. keccak256(abi.encode(bytes4(0xa01f1203), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_ICOMPOUNDV3ADAPTER_SLOT =
    0x02c9afc8b129398c559418de4825ac6d2670e884630d5a02557a9dcecd0b40e1;