From 1e0c75f4a2c6b61e70dd874c33636e1864ff01eb Mon Sep 17 00:00:00 2001 From: mariacarmina Date: Tue, 24 Sep 2024 16:12:45 +0300 Subject: [PATCH] Added additional check for NFT tx. --- src/contracts/NFTFactory.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/contracts/NFTFactory.ts b/src/contracts/NFTFactory.ts index 5b37e28b0..dc095158a 100644 --- a/src/contracts/NFTFactory.ts +++ b/src/contracts/NFTFactory.ts @@ -82,11 +82,17 @@ export class NftFactory extends SmartContractWithAddress { nftData.transferable, nftData.owner ) + if (!tx) { + const e = + 'Tx for deploying new NFT contract does not exist or status is not successful.' + console.error(e) + throw e + } const trxReceipt = await tx.wait() const events = getEventFromTx(trxReceipt, 'NFTCreated') return events.args[0] } catch (e) { - console.error(`Creation of AccessList failed: ${e}`) + console.error(`Creation of NFT failed: ${e}`) } }