Update getFactoryInfo.js

This commit is contained in:
Daniel
2022-11-05 11:40:51 +01:00
parent 72625511cb
commit 18782460de

View File

@@ -5,11 +5,14 @@ export const getFactoryInfo = async (factoryAddress, web3) => {
const factory = new web3.eth.Contract(abis.factory, factoryAddress);
const factoryInfo = {
feeTo: null,
feeToSetter: null,
allPairsLength: null,
feeTo: await factory.methods.feeTo().call(),
feeToSetter: await factory.methods.feeToSetter().call(),
allPairsLength: await factory.methods.allPairsLength().call(),
allPairs: [],
};
for (let i = 0; i < factoryInfo.allPairsLength; i++) {
factoryInfo.allPairs[i] = await factory.methods.allPairs(i).call();
}
}