diff --git a/app/scripts/controllers/swaps.js b/app/scripts/controllers/swaps.js index 406743237..5e8fb6990 100644 --- a/app/scripts/controllers/swaps.js +++ b/app/scripts/controllers/swaps.js @@ -51,10 +51,12 @@ function calculateGasEstimateWithRefund( estimatedRefund, 10, ); + const isMaxGasMinusRefundNegative = maxGasMinusRefund.lt(0); - const gasEstimateWithRefund = maxGasMinusRefund.lt(estimatedGas, 16) - ? maxGasMinusRefund.toString(16) - : estimatedGas; + const gasEstimateWithRefund = + !isMaxGasMinusRefundNegative && maxGasMinusRefund.lt(estimatedGas, 16) + ? maxGasMinusRefund.toString(16) + : estimatedGas; return gasEstimateWithRefund; }