From 75765dd7cba5e582237b4b51df77258605d62be3 Mon Sep 17 00:00:00 2001 From: Pedro Antonio <37405304+prodesert22@users.noreply.github.com> Date: Tue, 4 Jul 2023 12:09:36 -0400 Subject: [PATCH] fix: gas limit for flare (#467) --- src/state/pmulticall/updater.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/state/pmulticall/updater.tsx b/src/state/pmulticall/updater.tsx index b6a1543e7..36771fd41 100644 --- a/src/state/pmulticall/updater.tsx +++ b/src/state/pmulticall/updater.tsx @@ -29,15 +29,18 @@ async function fetchChunk( chainId: ChainId, ): Promise<{ results: string[]; blockNumber: number }> { console.debug('Fetching chunk', multicallContract, chunk, minBlockNumber); + const chain = getChainByNumber(chainId); + const args: any = [chunk.map((obj) => [obj.address, obj.callData])]; + if (chain?.network_type === NetworkType.HEDERA) { + args.push({ + gasLimit: 15_000_000, + }); + } + let resultsBlockNumber, returnData; try { - [resultsBlockNumber, returnData] = await multicallContract.aggregate( - chunk.map((obj) => [obj.address, obj.callData]), - { - gasLimit: chain?.network_type === NetworkType.HEDERA ? 15_000_000 : 8_000_000, - }, - ); + [resultsBlockNumber, returnData] = await multicallContract.aggregate(...args); } catch (error) { console.debug('Failed to fetch chunk inside retry', error); throw error;