-
Notifications
You must be signed in to change notification settings - Fork 325
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-2022: Show all extensions #315
Conversation
@joncinque is attempting to deploy a commit to the Solana Labs Team on Vercel. A member of the Team first needs to authorize it. |
wen merge |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I think longer term we might want to change how these are displayed because I think this is pushing the limits of the table really. Maybe an extensions tab or something?
I don't think any of my comments are blockers, they're mostly just nitpicks about how we're displaying certain values
I would flag the 'Additional Metadata' though because I think there's a real risk there of malicious tokens abusing it. Maybe the easiest fix for now is to make metadata the last extension displayed, and add a header above Additional Metadata?
#### Problem Although the explorer has some support of token-2022, it doesn't show any mint or account extensions, which leads to a lot of confusion for people who create mints. #### Solution Everything is provided with JSON-parsed encoding, so: * create types for all of the JSON-parsed returns * show each extension For the most part, each commit corresponds to an extension, except otherwise noted. I wasn't sure about the best way to display all of these, especially those with many fields, so I went with a little header line before showing each field. Let me know what you think of that. Here are some screenshots of a mint with every extension (minus token group, group member, group pointer, and member pointer):    And an account with all extensions:   And in case you care, here's how you can create your own mega-token: ``` set -ex solana-keygen -o mint.json --no-passphrase mint=$(solana-keygen pubkey mint.json) solana-keygen -o source.json --no-passphrase source_pubkey=$(solana-keygen pubkey source.json) spl-token -ul \ create-token \ --enable-close \ --enable-freeze \ --enable-metadata \ --enable-non-transferable \ --enable-permanent-delegate \ --enable-confidential-transfers auto \ --default-account-state initialized \ --interest-rate 5 \ --transfer-fee 10 11 \ --transfer-hook $mint \ --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \ mint.json spl-token -ul initialize-metadata $mint MegaToken MT https://spl.solana.com/token-2022 spl-token -ul update-metadata $mint Mega Token spl-token -ul create-account --immutable $mint source.json spl-token -ul enable-required-transfer-memos "$source_pubkey" spl-token -ul enable-cpi-guard "$source_pubkey" spl-token -ul configure-confidential-transfer-account --address "$source_pubkey" ```
Problem
Although the explorer has some support of token-2022, it doesn't show any mint or account extensions, which leads to a lot of confusion for people who create mints.
Solution
Everything is provided with JSON-parsed encoding, so:
For the most part, each commit corresponds to an extension, except otherwise noted. I wasn't sure about the best way to display all of these, especially those with many fields, so I went with a little header line before showing each field. Let me know what you think of that.
Here are some screenshots of a mint with every extension (minus token group, group member, group pointer, and member pointer):
And an account with all extensions:
And in case you care, here's how you can create your own mega-token: