Skip to content

Receiving a wallet address vs contract address using V3Pool #711

@Luca-Blight

Description

@Luca-Blight

sample of the code that generates the address:

 const poolAddresses = validTokenPairs.map(([tokenA, tokenB]) =>
    V3Pool.getAddress(tokenA!, tokenB!, feeAmount!)
  );

  const poolInfoPromises = poolAddresses.map((poolAddress, index) => {
    const [tokenA, tokenB] = validTokenPairs[index];
    console.log(`Fetching pool data for address: ${poolAddress}`);
    console.log(`Token A: ${tokenA?.address}`);
    console.log(`Token B: ${tokenB?.address}`);
    console.log(`Fee Amount: ${feeAmount}`);

    return getPoolInfo(poolAddress, feeAmount).catch((error) => {
      console.error("🚀 ~ poolAddress, failed to fetch pool data:", poolAddress, error);
      return undefined;
    }); 

token info used and address returned:

Fetching pool data for address: 0xd1D52bCd48488104b2FdBcA23977C89c6f4Cc631
Token A: 0x408e41876cCCDC0F92210600ef50372656052a38
Token B: 0x0000000000085d4780B73119b644AE5ecd22b376
Fee Amount: 3000

Error when calling contract instance functions:

[ etchPoolData ~ error: Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="slot0()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)](error: Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ]
reason: null,
code: 'CALL_EXCEPTION',
method: 'slot0()',
data: '0x',
errorArgs: null,
errorName: null,
errorSignature: null,
address: '0xd1D52bCd48488104b2FdBcA23977C89c6f4Cc631',
args: [],
transaction: {
data: '0x3850c7bd',
to: '0xd1D52bCd48488104b2FdBcA23977C89c6f4Cc631'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions