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

What's the difference between set_and_verify_collection and verify_collection? #111

Open
vitordhers opened this issue Mar 26, 2024 · 0 comments

Comments

@vitordhers
Copy link

Hello, folks, I've been struggling a bit in order to understand what's the difference between set_and_verify_collection and verify_collection. As per what I (believe I could) understand, the first one sets a regular NFT as a MPL collection, while the second one only verifies it.

I've noticed a few things, though.

In both methods, I've seen that the instruction needs both metadata and collection_metadata (which takes *ctx.accounts.collection_metadata.key ) accounts. So, probably the collection_metadata refers to the NFT created with by create_metadata_accounts_v3, whose details parameter is Some(CollectionDetails::V1 { size: 10 }), for instance. Now, the metadata refers to what, specifically? Should I create a new metadata account in order to provide that data? If so, should it be mutable? Should it also provide a details Option other than None? And, the most important, how do I derive it's address? Rn, I'm passing the collection metadata derived access like that:

 const collectionMetadataAddress = findMetadataPda(umi, {
      mint: publicKey(collectionMintKeypair.publicKey)
    })[0];

Last but not least, I've noticed that both set_and_verify_collection and verify_collection both accept collection_authority_record, should I derive another PDA just for that, or setting Some(ctx.accounts.signer.key()) will suffice?

I'm using anchor_spl 0.28, which depends on mpl-token-metadata ^1.11

Thanks in advance

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

1 participant