diff --git a/src/logic/safe/transactions/gas.ts b/src/logic/safe/transactions/gas.ts index 37f12655..e808860c 100644 --- a/src/logic/safe/transactions/gas.ts +++ b/src/logic/safe/transactions/gas.ts @@ -131,6 +131,7 @@ const calculateMinimumGasForTransaction = async ( ): Promise => { for (const additionalGas of additionalGasBatches) { const amountOfGasToTryTx = txGasEstimation + dataGasEstimation + additionalGas + console.info(`Estimating transaction creation with gas amount: ${amountOfGasToTryTx}`) try { await getGasEstimationTxResponse({ to: safeAddress, @@ -139,7 +140,8 @@ const calculateMinimumGasForTransaction = async ( gasPrice: 0, gas: amountOfGasToTryTx, }) - return txGasEstimation + additionalGas + console.info(`Gas estimation successfully finished with gas amount: ${amountOfGasToTryTx}`) + return amountOfGasToTryTx } catch (error) { console.log(`Error trying to estimate gas with amount: ${amountOfGasToTryTx}`) } @@ -165,8 +167,6 @@ export const estimateGasForTransactionCreation = async ( data: estimateData, }) - const txGasEstimation = gasEstimationResponse + 10000 - // 21000 - additional gas costs (e.g. base tx costs, transfer costs) const dataGasEstimation = parseRequiredTxGasResponse(estimateData) + 21000 const additionalGasBatches = [0, 10000, 20000, 40000, 80000, 160000, 320000, 640000, 1280000, 2560000, 5120000] @@ -175,7 +175,7 @@ export const estimateGasForTransactionCreation = async ( additionalGasBatches, safeAddress, estimateData, - txGasEstimation, + gasEstimationResponse, dataGasEstimation, ) } catch (error) {