We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
When I call following getPair under uniswapFactory contract I created via ethers.Contract in my javascript it doesn´t return any pair address.
const UniswapV2Factory = require("./build/contracts/IUniswapV2Factory.json"); uniswapFactory = new ethers.Contract( '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f', // uniswap v2 factory address in Etherscan mainnet UniswapV2Factory.abi, wallet ); const pairAddress = await uniswapFactory.getPair(wethAddress, otherAddress); const pair = new Contract(pairAddress, UniswapV2Pair.abi, wallet); console.log("yeah2!");
Strange thing is if I removed await keywork it returns Promise { }.
await
However, if I run await uniswapFactory.getPair(wethAddress, otherAddress); directly under Truffle console it resolves the pair address correctly.
await uniswapFactory.getPair(wethAddress, otherAddress);
Any suggestions would be greatly appreciated as it´s been bugging me also for a very long time.
Thank you
The text was updated successfully, but these errors were encountered:
Depends on the wallet provider ( or an object ) that you are connecting with.
Make sure to check if the provider node could be connected, and using the right network.
Also, await keyword is essential since it resolves promise object ( since it is a remote call that uses node ).
Sorry, something went wrong.
No branches or pull requests
Hi,
When I call following getPair under uniswapFactory contract I created via ethers.Contract in my javascript it doesn´t return any pair address.
Strange thing is if I removed
await
keywork it returns Promise { }.However, if I run
await uniswapFactory.getPair(wethAddress, otherAddress);
directly under Truffle console it resolves the pair address correctly.Any suggestions would be greatly appreciated as it´s been bugging me also for a very long time.
Thank you
The text was updated successfully, but these errors were encountered: