Update getFactoryInfo.js
This commit is contained in:
@@ -5,11 +5,14 @@ export const getFactoryInfo = async (factoryAddress, web3) => {
|
|||||||
const factory = new web3.eth.Contract(abis.factory, factoryAddress);
|
const factory = new web3.eth.Contract(abis.factory, factoryAddress);
|
||||||
|
|
||||||
const factoryInfo = {
|
const factoryInfo = {
|
||||||
feeTo: null,
|
feeTo: await factory.methods.feeTo().call(),
|
||||||
feeToSetter: null,
|
feeToSetter: await factory.methods.feeToSetter().call(),
|
||||||
allPairsLength: null,
|
allPairsLength: await factory.methods.allPairsLength().call(),
|
||||||
allPairs: [],
|
allPairs: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
for (let i = 0; i < factoryInfo.allPairsLength; i++) {
|
||||||
|
factoryInfo.allPairs[i] = await factory.methods.allPairs(i).call();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user