From 78650d49b9a1c919cbfd2d750ff1aedba6fd336d Mon Sep 17 00:00:00 2001 From: ianrowan Date: Tue, 3 Dec 2024 13:49:03 -0600 Subject: [PATCH] update gas fallback --- .../src/services/commonProtocol/contestHelper.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/model/src/services/commonProtocol/contestHelper.ts b/libs/model/src/services/commonProtocol/contestHelper.ts index 0c3227a3d2a..8bd2dc4f106 100644 --- a/libs/model/src/services/commonProtocol/contestHelper.ts +++ b/libs/model/src/services/commonProtocol/contestHelper.ts @@ -347,15 +347,19 @@ export const rollOverContest = async ( ? contestInstance.methods.endContest() : contestInstance.methods.newContest(); - let gasResult; + let gasResult = BigInt(300000); try { gasResult = await contractCall.estimateGas({ from: web3.eth.defaultAccount, }); - } catch { - return false; - } + } catch {} + const maxFeePerGasEst = await estimateGas(web3); + + if (gasResult < BigInt(100000)) { + gasResult = BigInt(300000); + } + await contractCall.send({ from: web3.eth.defaultAccount, gas: gasResult.toString(),