From 2acd39fac256bed21e57a01e542e8473d596cec3 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Tue, 11 Mar 2025 10:49:39 +0000 Subject: [PATCH] fix: update math for eth sends --- lib/plugins/wallet/geth/base.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/plugins/wallet/geth/base.js b/lib/plugins/wallet/geth/base.js index 8b9fa9dc..cb6a6fcb 100644 --- a/lib/plugins/wallet/geth/base.js +++ b/lib/plugins/wallet/geth/base.js @@ -161,7 +161,7 @@ function generateErc20Tx (_toAddress, wallet, amount, includesFee, cryptoCode) { .then(([gas, txCount, baseFeePerGas]) => { lastUsedNonces[fromAddress] = txCount - const maxPriorityFeePerGas = new BN(web3.utils.toWei('2.5', 'gwei')) // web3 default value + const maxPriorityFeePerGas = new BN(web3.utils.toWei('1.0', 'gwei')) // web3 default value const maxFeePerGas = new BN(2).times(baseFeePerGas).plus(maxPriorityFeePerGas) if (includesFee && (toSend.isNegative() || toSend.isZero())) { @@ -219,9 +219,8 @@ function generateTx (_toAddress, wallet, amount, includesFee, cryptoCode, txId) .then(([gas, gasPrice, txCount, baseFeePerGas]) => { lastUsedNonces[fromAddress] = txCount - const maxPriorityFeePerGas = new BN(web3.utils.toWei('2.5', 'gwei')) // web3 default value - const neededPriority = new BN(web3.utils.toWei('2.0', 'gwei')) - const maxFeePerGas = baseFeePerGas.plus(neededPriority) + const maxPriorityFeePerGas = new BN(web3.utils.toWei('1.0', 'gwei')) // web3 default value + const maxFeePerGas = baseFeePerGas.times(2).plus(maxPriorityFeePerGas) const newGasPrice = BN.minimum(maxFeePerGas, baseFeePerGas.plus(maxPriorityFeePerGas)) const toSend = includesFee