Pair Addresses
Last updated
import { FACTORY_ADDRESS, INIT_CODE_HASH } from '@whiteswap/sdk'
import { pack, keccak256 } from '@ethersproject/solidity'
import { getCreate2Address } from '@ethersproject/address'
const token0 = '0xCAFE000000000000000000000000000000000000' // change me!
const token1 = '0xF00D000000000000000000000000000000000000' // change me!
const pair = getCreate2Address(
FACTORY_ADDRESS,
keccak256(['bytes'], [pack(['address', 'address'], [token0, token1])]),
INIT_CODE_HASH'
)