From 32cfbcfe6dfddf64d3d7dd3ac118222859cdea99 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Wed, 28 Jun 2023 19:06:54 +0300 Subject: [PATCH] Checking if publishMarketFeeAddress exists --- src/mappings/fixedRateExchange.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mappings/fixedRateExchange.ts b/src/mappings/fixedRateExchange.ts index df2e84f..aed3bb4 100644 --- a/src/mappings/fixedRateExchange.ts +++ b/src/mappings/fixedRateExchange.ts @@ -259,11 +259,14 @@ export function handlePublishMarketFeeChanged( const fixedRateExchange = getFixedRateExchange(fixedRateId) if (fixedRateExchange) { - const feeToken = getToken( - Address.fromString(fixedRateExchange!.publishMarketFeeAddress!), - false - ) - const feeDecimals = BigInt.fromI32(feeToken.decimals).toI32() + let feeDecimals = BigInt.fromI32(18).toI32() + if (fixedRateExchange.publishMarketFeeAddress) { + const feeToken = getToken( + Address.fromString(fixedRateExchange!.publishMarketFeeAddress!), + false + ) + feeDecimals = BigInt.fromI32(feeToken.decimals).toI32() + } fixedRateExchange.publishMarketFeeAddress = event.params.newMarketCollector.toHexString()