From 8b6a47d19627e982abe7fc760b9d7a250b815eea Mon Sep 17 00:00:00 2001 From: Uncle Fatso Date: Mon, 16 Nov 2026 21:28:17 +0300 Subject: [PATCH] safely avoid zero division during execution discount calculation Signed-off-by: Uncle Fatso --- package.json | 2 +- src/containers/Exodus/Exodus.jsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6df22ac..360c6cf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.8.22", + "version": "0.8.23", "type": "module", "scripts": { "dev": "vite", diff --git a/src/containers/Exodus/Exodus.jsx b/src/containers/Exodus/Exodus.jsx index c9fc06a..f7e56c7 100644 --- a/src/containers/Exodus/Exodus.jsx +++ b/src/containers/Exodus/Exodus.jsx @@ -105,6 +105,8 @@ const Exodus = ({ chainId, address, config }) => { const currentGasPriceCost = currentTwapPrice(currentGasPrice._value).mul(ftsoPrice); const actualGasPerUnitCost = actualGasPerUnit.mul(reservePrice); + if (currentGasPriceCost.eq(zero)) return zero; + return currentGasPriceCost .sub(actualGasPerUnitCost) .mul(oneHundred.add(zero))