From f01e8f8f6cca14fc69eeab19694d43d4af03623a Mon Sep 17 00:00:00 2001 From: hichri-louay Date: Wed, 15 Nov 2023 11:23:42 +0100 Subject: [PATCH] add a default value for undefined token decimals --- controllers/campaign.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/campaign.controller.js b/controllers/campaign.controller.js index b1c59059..810364fc 100644 --- a/controllers/campaign.controller.js +++ b/controllers/campaign.controller.js @@ -2761,7 +2761,7 @@ module.exports.campaignsStatistics = async (req, res) => { const payedAmountInCryptoCurrency = new Big( link.payedAmount - ).div(decimalPower.pow(getDecimal(tokenName))) + ).div(decimalPower.pow(getDecimal(tokenName) ?? 18)) const cryptoUnitPriceInUSD = new Big( Crypto[tokenName].price )