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

Uniswap query lookup #22

Open
mtangular opened this issue Aug 22, 2021 · 2 comments
Open

Uniswap query lookup #22

mtangular opened this issue Aug 22, 2021 · 2 comments

Comments

@mtangular
Copy link

When the code reaches getPairsByIndexRange, I am getting the following error:
Error: Transaction reverted: function call to a non-contract account

I tried copying the same UniswapQuery code from Etherscan and pasting into my VSCode and running it as a separate contract and test with Hardhat but still getting the same error. But when I enter the 3 parameters in the Read Contract section on Etherscan I successfully get all the pairs.

Does this code from the repo only work on Mainnet or Mainnet-fork? Or should it still work on localhost (for example npx hardhat node)?

With the environment variable what does the Readme note below mean:
ETHEREUM_RPC_URL - Ethereum RPC endpoint. Can not be the same as FLASHBOTS_RPC_URL

I am using localhost:8545 as the ETHEREUM_RPC_URL (through npx hardhat node). But what is FLASHBOTS_RPC_URL? There is no such environment variable inside the code.

@TenzinCHW
Copy link

I found the answer. Only the Uniswap factory address exists on the goerli testnet, so when you try to access pair data from any of the other market factory addresses, the contract will fail. No clue what a workaround would be as I'm fairly new to this myself.

@dhensen
Copy link

dhensen commented Jan 6, 2022

You need to find that deployed contract address on Goerli. I am currently in the process of making this run on Goerli, just to understand this whole process and make all most mistakes on testnet before going to mainnet with this.
Check out my fork, I already fixed this issue there.

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

3 participants