Skip to content

Commit

Permalink
vfat: hack to reduce #event log calls
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Sep 18, 2024
1 parent f1de16d commit 9b9db24
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fees/vfat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 9b9db24

Please sign in to comment.