Update getPairsInfo.js
This commit is contained in:
9
packages/react-app/src/utils/getPairsInfo.js
vendored
9
packages/react-app/src/utils/getPairsInfo.js
vendored
@@ -8,7 +8,14 @@ export async function getPairsInfo(pairAddresses, web3) {
|
||||
for (let i = 0; i < pairAddresses.length; ++i) {
|
||||
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