Closed Ligengxin96 closed 3 months ago
Thanks this guy. Copy his reply to here. I think Pool.getAddress is not quite what you need. Try doing the folowing
import { computePoolAddress } from "@uniswap/v3-sdk";
const POOL_FACTORY_CONTRACT_ADDRESS_SEPOLIA = "0x0227628f3F023bb0B980b67D528571c95c6DaC1c";
const address = computePoolAddress({
factoryAddress: POOL_FACTORY_CONTRACT_ADDRESS_SEPOLIA,
tokenA,
tokenB,
fee: FeeApount.MEDIUM,
});
I didn't include boilerplate code like main() and so on, hope you'll get where to put this. And I'm also not claiming that this is 100% correct way to do stuff, it just worked for me so give it a try upd: now I can tell this is the recommended way check the docs here: https://docs.uniswap.org/sdk/v3/guides/swaps/quoting#computing-the-pools-deployment-address
Get wrong address: 0xef3304094A3dd8AB2E748a9f6a87238F1eDD720b https://sepolia.etherscan.io/address/0xef3304094A3dd8AB2E748a9f6a87238F1eDD720b