Skip to content

Commit

Permalink
Add requireEnoughTonForMinting function to
Browse files Browse the repository at this point in the history
NftCollection trait
  • Loading branch information
d0rich committed Nov 12, 2023
1 parent 47cf390 commit 1a43443
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/contracts/lib/trait_nft_collection.tact
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ trait NftCollection with Deployable, Accounting {
require(false, "Not implemented");
}

virtual fun requireEnoughTonForMinting() {
}

virtual fun calculateNftItemInitalBalance(): Int {
return self.calculateFullAmountForSending()
}
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 1a43443

Please sign in to comment.