Skip to content
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

solana: Add SPL multisig support #568

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

solana: Add SPL multisig support #568

wants to merge 7 commits into from

Conversation

nvsriram
Copy link
Collaborator

@nvsriram nvsriram commented Dec 3, 2024

This PR adds:

  • initialize_multisig and release_inbound_multisig_mint to act as multisig variants of initialize and release_inbound_mint respectively
  • Update test to verify independent minting capability after transferring authority to multisig
  • Update IDL

@nvsriram nvsriram linked an issue Dec 3, 2024 that may be closed by this pull request
@nvsriram nvsriram marked this pull request as ready for review December 3, 2024 19:27
Copy link
Contributor

@kcsongor kcsongor left a comment

Choose a reason for hiding this comment

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

overall looks good, but most of the code is duplication from the original versions. I wonder if we could refactor to share the logic?

@nvsriram
Copy link
Collaborator Author

overall looks good, but most of the code is duplication from the original versions. I wonder if we could refactor to share the logic?

I tried refactoring out the common structs and code logic to form a "clean" solution (the latest WIP commit). However, with this, we break the ABI as the accounts are now passed in differently for the original initialize and release_inbound_mint instructions.

If I were to preserve the ABI, there is minimal/no refactoring possible for the structs. This makes it difficult to use refactored code logic as there is no common shared struct that can be used; instead every required account has to be passed explicitly. Although I prefer the "clean" solution as it reduces code duplication and makes the -multisig variants/ any future variants easy to follow, its downside of breaking ABI makes it not super viable.

Ideally, we'd want to refactor code without breaking the ABI.

@nik-suri nik-suri requested a review from kcsongor December 11, 2024 23:45
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.

Solana: adding support for minting via SPL multisig program
2 participants