Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Unable to fetch pair data using uniswap V2. Error in getReserves() #100

Open
Rajwanshi opened this issue Jul 13, 2022 · 3 comments
Open

Comments

@Rajwanshi
Copy link

Hi Team,

I am getting error while calling fetchPairData().

Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="getReserves()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.6.4)

Tried calling this on ropsten and hardhat local network(mainnet forked). From the local hosted test net, I can see that the target address is not a contract address and hence the call is failing.

Logs from the local testnet console:

WARNING: Calling an account which is not a contract
From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
To: 0x80e8c5d88743c4e77259d2be6442190af366d723

Could you please help me with resolving the above issue. Any help would be very much appreciated :)

Thanks!

@hoanghiep
Copy link

@Rajwanshi Did you resolve this problem?

@LuiisFernando
Copy link

not solved yet ?

@Florian-S-A-W
Copy link

Hi @Rajwanshi ,

What version of the sdk are you using? The Fetcher class was removed in version 1.0.2. of the v2-sdk so I suppose you are using the deprecated uniswap-sdk package.
The Factory address and Init code hash were changed in version 2.0.0 of the uniswap-sdk package, if you are using an older version the getCreate2Address function would return a different address.

In any case, I would suggest not using the Fetcher class and using the v2-sdk package instead of uniswap-sdk:
https://www.npmjs.com/package/@uniswap/v2-sdk
Please let me know if you also experience this issue (getting the wrong contract address) with the current V2 SDK.

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

No branches or pull requests

4 participants