Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locked Collections Allow Mint of New NFT if NFT is Burned #208

Closed
HashWarlock opened this issue Aug 29, 2022 · 2 comments
Closed

Locked Collections Allow Mint of New NFT if NFT is Burned #208

HashWarlock opened this issue Aug 29, 2022 · 2 comments

Comments

@HashWarlock
Copy link
Contributor

When calling lock_collection the function will get the CollectionInfo for the specified collection_id and will set the max field to the field nfts_count. Since the max is now set to nfts_count the issuer can no longer mint anymore NFTs within the collection. However, if an NFT owner were to call burn_nft then the Collection issuer can now call mint_nft and be able to mint an NFT is a locked Collection.

Possible solutions:

  • When locking a collection, the issuer of the collection is set to a burner address that is inaccessible. This prevents anyone from minting new NFTs.
  • Instead of setting the max field to nfts_count, set max to 0. This prevents a new mint no matter the case as the check here should prevent a new mint:

// Prevent minting when nfts_count is greater than the collection max.
if let Some(max) = collection.max {
ensure!(collection.nfts_count < max, Error::<T>::CollectionFullOrLocked);
}

if let Some(max) = collection.max {
ensure!(collection.nfts_count < max, Error::<T>::CollectionFullOrLocked);
}

@bmacer
Copy link
Contributor

bmacer commented Sep 12, 2022

#215 implements the second proposed solution, which is much simpler than the first. unless there's some other use/value for the max variable, i thinking setting it to 0 is the ideal solution for this issue.

@bmacer
Copy link
Contributor

bmacer commented Oct 27, 2022

Pretty sure this can be closed

@ilionic ilionic closed this as completed Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants