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 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();
}
} }