Skip to content
Lattice

UniswapV3AdapterLib Constants

Git Source

UNISWAP_V3_ADAPTER_STORAGE_SLOT

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

bytes32 constant UNISWAP_V3_ADAPTER_STORAGE_SLOT = 0x6f3c1f877b0bf340477364a294f77f49bff3a5479f70012a0fb5cb2803b61e00;

UNISWAP_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 UNISWAP_V3_ADAPTER_ERC165_STORAGE_LOCATION =
    0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200;

ERC165_MAP_IPROTOCOLADAPTER_SLOT

0x8f7783e6 is type(IProtocolAdapter).interfaceId (same value the Aave/Compound/Curve/Lido 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_IUNISWAPV3ADAPTER_SLOT

0xf723aa17 is type(IUniswapV3Adapter).interfaceId. keccak256(abi.encode(bytes4(0xf723aa17), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_IUNISWAPV3ADAPTER_SLOT = 0x18cf2bfdc937c75408cba5cf015af2a2f8d21a881c553ac382a288bcae5dc1c8;

UNISWAP_V3_BPS_DENOMINATOR

Basis-point denominator for the slippage tolerance.

uint256 constant UNISWAP_V3_BPS_DENOMINATOR = 10_000;