From d5df12309873419b02461655faa37650efbb7afe Mon Sep 17 00:00:00 2001 From: dekanbro Date: Mon, 18 Sep 2023 12:59:56 -0600 Subject: [PATCH] increase gas buffer multiplier and add constant --- libs/tx-builder/src/utils/constants.ts | 1 + libs/tx-builder/src/utils/multicall.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/tx-builder/src/utils/constants.ts b/libs/tx-builder/src/utils/constants.ts index 5defa4d1..bef71f99 100644 --- a/libs/tx-builder/src/utils/constants.ts +++ b/libs/tx-builder/src/utils/constants.ts @@ -4,6 +4,7 @@ import { LOCAL_ABI } from '@daohaus/abis'; export const EXPIRY = '.proposalExpiry'; export const FORM = '.formValues'; export const CURRENT_DAO = '.daoId'; +export const gasBufferMultiplier = 3; export const BaalContractBase = { type: 'local', contractName: 'Baal', diff --git a/libs/tx-builder/src/utils/multicall.ts b/libs/tx-builder/src/utils/multicall.ts index c50384d4..e0cfc4b7 100644 --- a/libs/tx-builder/src/utils/multicall.ts +++ b/libs/tx-builder/src/utils/multicall.ts @@ -32,6 +32,7 @@ import { CURRENT_DAO, EXPIRY, FORM, + gasBufferMultiplier, } from './constants'; import { processContractLego } from './contractHelpers'; import { createViemClient } from '@daohaus/utils'; @@ -391,7 +392,7 @@ export const handleGasEstimate = async ({ }); if (gasEstimate) { - const buffer = arg.bufferPercentage || 2; + const buffer = arg.bufferPercentage || gasBufferMultiplier; return Math.round(Number(gasEstimate) * Number(buffer)); } else { // This happens when the safe vault takes longer to be indexed by the Gnosis API