Skip to content
Lattice

CCIPGatewayAdapterLib Constants

Git Source

CCIP_GATEWAY_ADAPTER_STORAGE_SLOT

keccak256(abi.encode(uint256(keccak256("lattice.storage.CCIPGatewayAdapter")) - 1)) & ~bytes32(uint256(0xff)).

bytes32 constant CCIP_GATEWAY_ADAPTER_STORAGE_SLOT = 0xfc37dafbf0181d0474cf94e236f0ede0d369aab52659fb134d4be3b15fbb8e00;

ERC165_MAP_IERC7786GATEWAYSOURCE_SLOT

ERC-165 map slot for IERC7786GatewaySource (0x11967553). SHARED by all gateway adapters — keccak256(abi.encode(bytes4(0x11967553), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_IERC7786GATEWAYSOURCE_SLOT =
    0x3c75b8ea75c097979221eb9302e2f0f6009b4ffe0a7198db5dc29979e09ea0e3;

ERC165_MAP_IANY2EVMMESSAGERECEIVER_SLOT

ERC-165 map slot for IAny2EVMMessageReceiver (0x85572ffb). UNIQUE to CCIP — the router calls supportsInterface(0x85572ffb) before delivery; if false it drops the message and delivers only tokens. keccak256(abi.encode(bytes4(0x85572ffb), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_IANY2EVMMESSAGERECEIVER_SLOT =
    0x800eb085c0ca5e4523c112cc053bae87b4696eb6a3bf735b4b8b0a9d09be1465;

ERC165_MAP_IANY2EVMMESSAGERECEIVERV2_SLOT

ERC-165 map slot for IAny2EVMMessageReceiverV2. UNIQUE to CCIP — CCV-enabled lanes detect support via supportsInterface(type(IAny2EVMMessageReceiverV2).interfaceId). NOTE: Solidity's type().interfaceId EXCLUDES inherited functions, so the V2 id is the getCCVsAndFinalityConfig selector 0x1bfc84d0 (NOT the full XOR with the inherited ccipReceive) — and that is exactly the value the router queries. keccak256(abi.encode(bytes4(0x1bfc84d0), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_IANY2EVMMESSAGERECEIVERV2_SLOT =
    0x9baecadb3e37f7ef6c6624a337da384f68e7fa9684795d0ccbd7f9f089dee070;