From fdc35ab80064cab6063b19519f51a4820aa24697 Mon Sep 17 00:00:00 2001 From: paulo-ocean Date: Fri, 13 Sep 2024 09:21:04 +0100 Subject: [PATCH] fix create erc params --- src/contracts/NFTFactory.ts | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/contracts/NFTFactory.ts b/src/contracts/NFTFactory.ts index 731f4008..036b8c1c 100644 --- a/src/contracts/NFTFactory.ts +++ b/src/contracts/NFTFactory.ts @@ -570,19 +570,32 @@ export class NftFactory extends SmartContractWithAddress { } } + // common stuff for other templates + const addresses = [ + dtParams.minter, + dtParams.paymentCollector, + dtParams.mpFeeAddress, + dtParams.feeToken + ] + + if (dtParams.filesObject) { + // template 4 only, ignored for others + if (dtParams.accessListFactory) { + addresses.push(dtParams.accessListFactory) + } + if (dtParams.allowAccessList) { + addresses.push(dtParams.allowAccessList) + } + + if (dtParams.denyAccessList) { + addresses.push(dtParams.denyAccessList) + } + } + return { templateIndex: dtParams.templateIndex, strings: [dtParams.name || name, dtParams.symbol || symbol], - addresses: [ - dtParams.minter, - dtParams.paymentCollector, - dtParams.mpFeeAddress, - dtParams.feeToken, - // template 4 only, ignored for others - dtParams.accessListFactory, - dtParams.allowAccessList, - dtParams.denyAccessList - ], + addresses, uints: [ await this.amountToUnits(null, dtParams.cap, 18), await this.amountToUnits(null, dtParams.feeAmount, feeTokenDecimals)