Skip to content

Commit

Permalink
update gas fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrowan authored and ilijabojanovic committed Dec 4, 2024
1 parent f88a370 commit 78650d4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libs/model/src/services/commonProtocol/contestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 78650d4

Please sign in to comment.