metaplex-foundation / js

A JavaScript SDK for interacting with Metaplex's programs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error Printing Edition

myyellowshoe opened this issue · comments

commented

Seeing this fun error when printing an edition:

Token Metadata Program Instruction

Program logged: "IX: Mint New Edition from Master Edition Via Token"
Program logged: "Already initialized"
Program consumed: 23601 of 1169142 compute units
Program returned error: "custom program error: 0x3"

My Code

      await metaplex
        .nfts()
        .builders()
        .printNewEdition({
          originalSupply: (nftToMint.edition as NftOriginalEdition).supply,
          newOwner: payerPublicKey,
          originalMint: new PublicKey(masterMintAddress),
        })

Whats odd is that this has been printing editions for quite some time without issue, and other similar editions are printing fine.

Some questions:

  • I'm wondering if an account somehow initialized partially and now when trying to print the next edition it can't because it already exists?
  • Is there way to clean up the prior metadata account?
  • Maybe the edition number is incorrect in this case?
commented

Also here's a tx that is failing on chain for reference, skipped preflight.
https://solscan.io/tx/4x9pEjaAveGzuxLh3cWvwwjJemfzmLFbgan48agmNx4rJ4T9voYpw79pdBt6o5DdRXxEvp76Tj3PP978S2GwYBFQ

commented

Alrighty after a lot of research and digging through code, It appears this is a bug that shows up when a print edition gets burned. The print edition script can't figure out the correct supply and fails. :(

I did figure the answer though! Thanks to @samuelvanderwaal he provided some logic in metaboss to figure out the new supply taking into account burned nfts. https://github.com/samuelvanderwaal/metaboss/blob/b662001ee929f5b34f3660c227136aab9697de27/src/mint.rs#L366

The FIX
I ported the rust code to a TS snippet folks can use here:
https://gist.github.com/myyellowshoe/f4df7963431a95fe208b5ee6dcf07373

Recomendations
I think bringing this logic into the printNewEdition function would solve the burned nft example and simplifying printing overhead. I think adding this logic around this line, would work:

const edition = toBigNumber(params.originalSupply.addn(1));

  1. Developers wouldn't have to calculate the supply themselves.
    Something like const supplyFromNFT = (nftToMint.edition as NftOriginalEdition).supply is what I was using before but this gets out of sync quickly as we've seen.
  2. Enables print editions to be printed more quickly,
  3. Fixes burned editions issue and the confusing errors that surround it.

I am getting a similar error I have a master edition that is already minted with a maxSupply of 1 and supply of 1 but I am getting this error : Edition Number greater than max supply I tried setting the originalSupply in the reprint but same error

I am getting a similar error I have a master edition that is already minted with a maxSupply of 1 and supply of 1 but I am getting this error : Edition Number greater than max supply I tried setting the originalSupply in the reprint but same error

In your case, the issue is that a max_supply of 1 means you can only ever have one print edition minted from that Master Edition. So if the supply is 1 you've already minted all the prints possible from that Master Edition. You need to mint a Master Edition with a max_supply of n where n is the number of print editions you want, or set the max supply to none/null which means unlimited print editions.

I am getting a similar error I have a master edition that is already minted with a maxSupply of 1 and supply of 1 but I am getting this error : Edition Number greater than max supply I tried setting the originalSupply in the reprint but same error

In your case, the issue is that a max_supply of 1 means you can only ever have one print edition minted from that Master Edition. So if the supply is 1 you've already minted all the prints possible from that Master Edition. You need to mint a Master Edition with a max_supply of n where n is the number of print editions you want, or set the max supply to none/null which means unlimited print editions.

The edition from the master edition was never printed, only the master edition was done. But still will not allow printing of that single edition.

I am getting a similar error I have a master edition that is already minted with a maxSupply of 1 and supply of 1 but I am getting this error : Edition Number greater than max supply I tried setting the originalSupply in the reprint but same error

In your case, the issue is that a max_supply of 1 means you can only ever have one print edition minted from that Master Edition. So if the supply is 1 you've already minted all the prints possible from that Master Edition. You need to mint a Master Edition with a max_supply of n where n is the number of print editions you want, or set the max supply to none/null which means unlimited print editions.

The edition from the master edition was never printed, only the master edition was done. But still will not allow printing of that single edition.

If the supply is 1 then the edition was printed, unless you've discovered a bug. Post the Master Edition mint account here and I can take a look.

I am getting a similar error I have a master edition that is already minted with a maxSupply of 1 and supply of 1 but I am getting this error : Edition Number greater than max supply I tried setting the originalSupply in the reprint but same error

In your case, the issue is that a max_supply of 1 means you can only ever have one print edition minted from that Master Edition. So if the supply is 1 you've already minted all the prints possible from that Master Edition. You need to mint a Master Edition with a max_supply of n where n is the number of print editions you want, or set the max supply to none/null which means unlimited print editions.

The edition from the master edition was never printed, only the master edition was done. But still will not allow printing of that single edition.

If the supply is 1 then the edition was printed, unless you've discovered a bug. Post the Master Edition mint account here and I can take a look.

master_edition_address : FCjg1xYvG31GnhqYZ7JqKxqXut5RSzgVq7oiKq2jpbze , I am getting this error when I am trying to print edition 1/1 on my server : Error: Error printing new edition >> [ParsedProgramError] The program [TokenMetadataProgram] at address [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s] raised an error of code [122] that translates to "Edition Number greater than max supply". Source: Program > TokenMetadataProgram [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s] Caused By: EditionNumberGreaterThanMaxSupply: Edition Number greater than max supply

FCjg1xYvG31GnhqYZ7JqKxqXut5RSzgVq7oiKq2jpbze

Here's the edition minted from this Master Edition. You cannot mint any more because the max_supply is 1 and there's already one edition minted.

FCjg1xYvG31GnhqYZ7JqKxqXut5RSzgVq7oiKq2jpbze

Here's the edition minted from this Master Edition. You cannot mint any more because the max_supply is 1 and there's already one edition minted.

okay, Thank you for your help.