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

Unable to Mint a Master Edition NFT with supply of 0 #184

Open
Kenny4444 opened this issue Feb 25, 2022 · 0 comments
Open

Unable to Mint a Master Edition NFT with supply of 0 #184

Kenny4444 opened this issue Feb 25, 2022 · 0 comments
Labels

Comments

@Kenny4444
Copy link

In trying to create an NFT from mintNFT I found that there is not way to create a NFT with a supply of 0.

Steps to Repro:
Call Mint Nft with a supply of 0.
Notice that the maxSupply is set to Null or Undefined

Expected Behavior:
The nft is created with maxSupply of 0 so that there cannot be any limited edition prints on it.

There seems to be an issue on line 98 of mintNFT.ts in the creation of a new CreateMasterEdition:

const masterEditionTx = new CreateMasterEdition(
{ feePayer: wallet.publicKey },
{
edition: editionPDA,
metadata: metadataPDA,
updateAuthority: wallet.publicKey,
mint: mint.publicKey,
mintAuthority: wallet.publicKey,
maxSupply: maxSupply || maxSupply === 0 ? new BN(maxSupply) : null,
},
);
the line:
maxSupply: maxSupply || maxSupply === 0 ? new BN(maxSupply) : null,
will not allow you to set the maxSupply to 0.

should probably be

maxSupply: maxSupply || maxSupply >= 0 ? new BN(maxSupply) : null,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant