Update getPairsInfo.js
This commit is contained in:
7
packages/react-app/src/utils/getPairsInfo.js
vendored
7
packages/react-app/src/utils/getPairsInfo.js
vendored
@@ -9,6 +9,13 @@ export async function getPairsInfo(pairAddresses, web3) {
|
||||
const pairAddress = pairAddresses[i];
|
||||
const pair = new web3.eth.Contract(pairABI, pairAddresses[i]);
|
||||
|
||||
const token0Address = await pair.methods.token0().call(); //get contract
|
||||
const token1Address = await pair.methods.token1().call();
|
||||
const token0Contract = new web3.eth.Contract(tokenABI, token0Address); //get contract address
|
||||
const token1Contract = new web3.eth.Contract(tokenABI, token1Address);
|
||||
const token0Name = await token0Contract.methods.name().call(); //get contract address name
|
||||
const token1Name = await token1Contract.methods.name().call();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user