Checking if publishMarketFeeAddress exists

This commit is contained in:
Jamie Hewitt 2023-06-28 19:06:54 +03:00
parent a34d6875c7
commit 32cfbcfe6d
1 changed files with 8 additions and 5 deletions

View File

@ -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()