safely avoid zero division during execution discount calculation
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
582b22aded
commit
8b6a47d196
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ghost-dao-interface",
|
||||
"private": true,
|
||||
"version": "0.8.22",
|
||||
"version": "0.8.23",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -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))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user