Skip to content

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

@HashWarlock

Description

@HashWarlock

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions