-
Notifications
You must be signed in to change notification settings - Fork 517
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
Token metadata v1.3 #459
Merged
Merged
Token metadata v1.3 #459
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…n_authority_record delegate model
…ept CollectionDetails option
…metaplex-program-library into token-metadata-v1.3
roederw
reviewed
Jun 7, 2022
…ndation/metaplex-program-library into token-metadata-v1.3
samuelvanderwaal
requested review from
thlorenz,
austbot,
blockiosaurus,
lorisleiva,
danenbm and
stranzhay
as code owners
June 13, 2022 22:30
austbot
approved these changes
Jun 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Token Metadata V1.3
Dependency Updates
Solana dependencies updated to latest:
New Features
Metadata Update
A new field has been added to the Metadata struct to better support the collections standard.
Current Metadata struct:
CollectionDetails enum:
The goal with using enums is to try to make it more forward compatible but it may not be worth the extra effort to do so.
Burn NFT
There's now a Burn NFT handler that allows the owner of the NFT to completely burn it:
This handler checks if the NFT is a member of a verified collection, and if it is, requires the collection metadata account be passed in so the size can be decremented.
Concerns:
Possible Mitigation:
Create a PDA burn record for each NFT burned.
Implementation:
Create a new program:
mpl_burn_record
.The
burn_nft
handler CPIs into this program and creates a new data-less PDA every time an NFT is successfully burned. PDA Seeds: ["burned_nft", mint_account].This allows:
mpl_burn_record
program.Verify, Unverify and SetAndVerify Handlers for Sized Collections
The new handlers are:
These handlers require the collection metadata account passed in mutably so they can modify the
size
. The other approach would have been to add optional accounts to the current verify handlers but this would have significantly complicated the logic in the accounts without providing much of an improved user experience. (The naming of the new handlers clearly indicates they handle a specific type of collection.)Concerns:
Create Metadata V3
This handler needs a new version because it needs an additional argument
collection_details
for the user to indicate whether the NFT being created is a collection parent or not. This handler accepts anOption<CollectionDetails>
where theNone
variant indicates it is not a collection parent NFT andSome(CollectionDetails)
indicates it is a collection parent. This handler always creates a new metadata account with a size of 0.Set Collection Size
Initially this was written to require a Metaplex signer key in order to update a collection size. However, it has been refactored to use the delegate model so that Metaplex can build a tool to let people correctly calculate the collection size and then delegate authority to Metaplex to set it, but no longer requires a Metaplex sign off to do so.
Concerns:
Set Token Standard
This handler allows an update authority to pass in a metadata account with an optional edition account and then it determines what the correct TokenStandard type is and writes it to the metadata.
Concerns: