Skip to content

cli: Add commands to create valid SPL Multisig and set mint authority#628

Merged
nvsriram merged 13 commits intomainfrom
cli-add-spl-multisig-commands
Jun 12, 2025
Merged

cli: Add commands to create valid SPL Multisig and set mint authority#628
nvsriram merged 13 commits intomainfrom
cli-add-spl-multisig-commands

Conversation

@nvsriram
Copy link
Copy Markdown
Contributor

@nvsriram nvsriram commented May 30, 2025

This PR adds:

  • Add create_spl_multisig <multisigMemberPubkey...> command that mimics spl-token create-multisig to create valid SPL Multisig.
  • Add set-mint-authority <newAuthority> command that sets mint authority based on version:
    • If version < 3.x.x: calls spl.setAuthority directly
    • If version >= 3.x.x: calls acceptTokenAuthority
    • Also handles cases where newAuthority is a valid SPL Multisig via the --multisig flag

@nvsriram nvsriram marked this pull request as ready for review May 30, 2025 21:15
@nvsriram nvsriram requested review from dvgui, evgeniko and kcsongor May 30, 2025 21:16
@nvsriram
Copy link
Copy Markdown
Contributor Author

For local testing, I used a demo Solana devnet deployment: 8y2hh2wGnagy8wc8Fe8xsjUtLSHnzFbiPmFNrext4jHm
I tested the commands first using version 2.0.0 to ensure the correct errors were thrown. Then after upgrading to local 3.0.0 version, tested the commands again.

@tonyjin
Copy link
Copy Markdown
Contributor

tonyjin commented Jun 3, 2025

Could you separate the work for the TODO refactor from the new functionality to make this easier to review?

@nvsriram
Copy link
Copy Markdown
Contributor Author

nvsriram commented Jun 3, 2025

Could you separate the work for the TODO refactor from the new functionality to make this easier to review?

The TODO refactor refers to this commit: a385a5b. As it is very small in scope. I added it with this PR. However, if you think it makes it easier if it were moved out, I can undo that commit.

On a similar note, I've split the commits based on features so it might be easier to review the commits one-by-one.

@dvgui
Copy link
Copy Markdown
Contributor

dvgui commented Jun 3, 2025

@nvsriram similar to what @tonyjin asked. I would prefer to have a PR with specific additions for this feature, and we can open a new one for code indentation and maybe some housekeeping, like reorganising functions to more files for better readability and structure.

dvgui
dvgui previously approved these changes Jun 3, 2025
@nvsriram
Copy link
Copy Markdown
Contributor Author

nvsriram commented Jun 3, 2025

@nvsriram similar to what @tonyjin asked. I would prefer to have a PR with specific additions for this feature, and we can open a new one for code indentation and maybe some housekeeping, like reorganising functions to more files for better readability and structure.

Sounds good, will do that then.
For this PR, I'll revert all commits except 25d413c (create-spl-multisig) and 5cb032e (set-mint-authority).
I'll move the remaining commits to another follow-up PR.

evgeniko
evgeniko previously approved these changes Jun 4, 2025
Copy link
Copy Markdown
Contributor

@evgeniko evgeniko left a comment

Choose a reason for hiding this comment

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

lgtm

Comment thread cli/src/index.ts Outdated
Comment thread cli/src/index.ts
Comment thread cli/src/index.ts
Comment thread cli/src/index.ts
Co-authored-by: evgeniko <97796468+evgeniko@users.noreply.github.com>
evgeniko
evgeniko previously approved these changes Jun 4, 2025
@nik-suri nik-suri requested a review from dvgui June 5, 2025 15:08
@nvsriram nvsriram merged commit 1a2a92e into main Jun 12, 2025
9 checks passed
@nvsriram nvsriram deleted the cli-add-spl-multisig-commands branch June 12, 2025 17:26
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.

5 participants