Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving a wallet address vs contract address using V3Pool #711

Open
Luca-Blight opened this issue Jun 2, 2024 · 1 comment
Open

Receiving a wallet address vs contract address using V3Pool #711

Luca-Blight opened this issue Jun 2, 2024 · 1 comment

Comments

@Luca-Blight
Copy link

Luca-Blight commented Jun 2, 2024

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'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Luca-Blight and others