-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[stake-pool] instruction to add metadata for pool token #3335
[stake-pool] instruction to add metadata for pool token #3335
Conversation
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.
Lots of really great work! This is absolutely on the right track, and I'm looking forward to integrating this soon.
/// 1. `[]` Manager | ||
/// 2. `[]` Stake pool withdraw authority | ||
/// 3. `[]` Pool token mint account | ||
/// 4. `[]` Payer for creation of token metadata account |
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.
nit: Since it's paying, it needs to be writable and signer:
/// 4. `[]` Payer for creation of token metadata account | |
/// 4. `[s, w]` Payer for creation of token metadata account |
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.
The tests pass locally without making payer
a writable AccountMeta though. What could be reason behind it?
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.
That's a good question. It may be because the specified payer
is the same as the fee payer in your test transactions. You can try a test with a different fee payer and see what happens! I'm surprised that it lets this through though 🤔
@joncinque I have addressed all the comments highlighted above. Please re-review whenever possible :D |
This looks good to me, you'll need to run |
assert_eq!(metadata.data.name.to_string(), puffed_name); | ||
assert_eq!(metadata.data.symbol.to_string(), puffed_symbol); | ||
assert_eq!(metadata.data.uri.to_string(), puffed_uri); | ||
} |
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.
Oh sorry, I'm just noticing at the end of this pass, but can you also add a test to make sure that the correct manager must sign? Same as with fail_manager_did_not_sign
but for this instruction
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.
Will do.
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.
I just skimmed through the changes, and it looks all good to me (other than adding those tests and resolving the CI as @joncinque has mentioned). I'm looking forward to seeing this get merged soon!
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 great! I'll give one more day for any external reviews, and merge tomorrow
@betterclever can you look at the CI test failure and fix the issues? Looks like an unused import that needs to be removed |
8adcb8b
to
1d45690
Compare
1d45690
to
088ecdd
Compare
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.
Sorry for the late addition, but with this I'll feel a little more comfortable and ready to merge!
Thanks so much for all of your work! |
Problem
The ecosystem has abandoned the token-list and encourages using the Metaplex Metadata standard for tokens. This requires a signature from the mint authority, which means that it's currently impossible to create token metadata for stake pools.
Solution
Add new
create_metadata
andupdate_metadata
instructions to the stake pool program to allow working with metaplex metadata accounts. This provides a signature from the stake pool withdraw authority, which is the mint authority. The instruction must be signed by the stake pool manager.