From 9b9db2475eac8e1724c0d620bad7a6a7a774cb44 Mon Sep 17 00:00:00 2001 From: g1ntoki <99907941+g1nt0ki@users.noreply.github.com> Date: Wed, 18 Sep 2024 18:38:24 +0200 Subject: [PATCH] vfat: hack to reduce #event log calls --- fees/vfat/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fees/vfat/index.ts b/fees/vfat/index.ts index 184e1322bb..716314a5ff 100644 --- a/fees/vfat/index.ts +++ b/fees/vfat/index.ts @@ -54,25 +54,27 @@ const chainSettings: any = { const settings = chainSettings[chain]; - // Fetch Deploy events to get all Sickle contract addresses +/* // Fetch Deploy events to get all Sickle contract addresses const deployLogs = await getLogs({ target: settings.factory, fromBlock: settings.fromBlock, eventAbi: 'event Deploy(address indexed admin, address sickle)', + cacheInCloud: true, }); - const sickleContracts = deployLogs.map((log: any) => log.sickle); + const sickleContracts = deployLogs.map((log: any) => log.sickle); */ const logs = await getLogs({ - targets: sickleContracts, + // targets: sickleContracts, eventAbi: 'event FeeCharged(bytes32 feesHash, uint256 amount, address token)', }); const logs2 = await getLogs({ - targets: sickleContracts, + // targets: sickleContracts, eventAbi: 'event FeeCharged(address strategy, bytes4 feeDescriptor, uint256 amount, address token)', }); + logs.forEach((log: any) => { dailyFees.add(log.token, log.amount); });