From 1a43443a615424c58fb9ca9ca67d86b37500493c Mon Sep 17 00:00:00 2001 From: Nikolay Dorofeev Date: Sun, 12 Nov 2023 11:35:53 +0400 Subject: [PATCH] Add requireEnoughTonForMinting function to NftCollection trait --- contracts/contracts/lib/trait_nft_collection.tact | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/contracts/lib/trait_nft_collection.tact b/contracts/contracts/lib/trait_nft_collection.tact index db6a5a91..cb50f55a 100644 --- a/contracts/contracts/lib/trait_nft_collection.tact +++ b/contracts/contracts/lib/trait_nft_collection.tact @@ -21,6 +21,9 @@ trait NftCollection with Deployable, Accounting { require(false, "Not implemented"); } + virtual fun requireEnoughTonForMinting() { + } + virtual fun calculateNftItemInitalBalance(): Int { return self.calculateFullAmountForSending() } @@ -54,8 +57,9 @@ trait NftCollection with Deployable, Accounting { // ===== Recievers ===== // receive("Mint"){ - let ctx: Context = context(); require(self.next_item_index >= 0, "non-sequential NFTs"); + self.requireEnoughTonForMinting(); + let ctx: Context = context(); let nft_init: StateInit = self.getNftItemInit(self.next_item_index); send(SendParameters{ to: contractAddress(nft_init),