diff --git a/lib/plugins/wallet/geth/base.js b/lib/plugins/wallet/geth/base.js index c3d82f1b..9d4bb660 100644 --- a/lib/plugins/wallet/geth/base.js +++ b/lib/plugins/wallet/geth/base.js @@ -159,6 +159,10 @@ function generateErc20Tx (_toAddress, wallet, amount, includesFee, cryptoCode) { const maxPriorityFeePerGas = new BN(web3.utils.toWei('2.5', 'gwei')) // web3 default value const maxFeePerGas = new BN(2).times(baseFeePerGas).plus(maxPriorityFeePerGas) + if (includesFee && (toSend.isNegative() || toSend.isZero())) { + throw new Error(`Trying to send a nil or negative amount. This is probably caused due to the estimated fee being higher than the address' balance. Value provided: ${toSend.toNumber()}`) + } + const rawTx = { chainId: 1, nonce: txCount,