Skip to content

Conversation

grod220
Copy link
Member

@grod220 grod220 commented Sep 8, 2025

Introduces new CLI helper that corresponds to new instruction: #229

Copy link

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take it or leave it on the Metaplex shorthand arg!

@grod220 grod220 force-pushed the sync-token-2022-cli branch from e5ba9a0 to 0ddc7c7 Compare September 10, 2025 09:23
@grod220 grod220 force-pushed the sync-token-2022-cli branch from f10e537 to 04f83d0 Compare September 10, 2025 09:30
@grod220 grod220 enabled auto-merge (squash) September 10, 2025 09:37
@grod220 grod220 merged commit 0ed80b6 into main Sep 10, 2025
17 of 18 checks passed
@grod220 grod220 deleted the sync-token-2022-cli branch September 10, 2025 10:29
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just a couple of nits

Comment on lines +44 to +47
/// Optional owner program for the source metadata account, when owned by a
/// third-party program
#[clap(long, value_parser = parse_pubkey)]
pub program_id: Option<Pubkey>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Typically the --program-id arg is to specify the address of the program to target, ie the token-wrap program in this case.

I'd go with something like --metadata-program-id so that we can eventually specify --program-id globally in the CLI

Comment on lines +34 to +37
/// Specify that the source metadata is from a `Metaplex` Token Metadata
/// account. The CLI will derive the PDA automatically.
#[clap(long)]
pub metaplex: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than forcing people to specify this, it would be better to figure it out dynamically.

  • If metadata_account is specified, use that.
  • If the unwrapped mint is SPL-Token, then use metaplex.
  • If the unwrapped mint is SPL-Token-2022, then check for the metadata pointer, and fall back to metaplex.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the unwrapped mint is SPL-Token-2022, then check for the metadata pointer, and fall back to metaplex.

Oh, wait a sec. Are you saying that having a Metaplex PDA for a token-2022 is authoritative if it doesn't have a metadata pointer? If so the program also needs to be updated to handle this case. At the moment, it's treating the pointer as the only authoritative source.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's up to us to decide! It's probably the best fallback -- if someone didn't specify anything during their token-2022 mint creation, and later created metaplex metadata, it would be nice to use that.

I don't know how common this is though -- it's possible that no mints like this exist. What do you think?

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

Successfully merging this pull request may close these issues.

3 participants