Implement full manual registration solana#1621
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements full manual registration functionality for Solana, enabling manual registration of tokens and token pools on Solana chains. The implementation adds initialization and ownership transfer operations for both BurnMint and LockRelease token pool types.
Changes:
- Implemented token pool initialization (global config and per-token) for both BurnMint and LockRelease pools
- Added ownership transfer operations for both pool types
- Refactored code organization by moving shared utilities and LockRelease-specific operations to separate files
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| chains/solana/deployment/v1_6_0/sequences/tokens.go | Completed the ManualRegistration sequence by implementing token pool initialization and ownership transfer logic |
| chains/solana/deployment/v1_6_0/operations/token_pools/utils.go | Moved shared token pool types and utilities (Params, RemoteChainConfig, initGlobalConfigTokenPool) from burnmint.go |
| chains/solana/deployment/v1_6_0/operations/token_pools/lockrelease.go | Added LockRelease-specific operations (Initialize, InitGlobalConfig, TransferOwnership, GetAuthority) |
| chains/solana/deployment/v1_6_0/operations/token_pools/burnmint.go | Removed LockRelease operations and moved shared code to utils.go, renamed TransferOwnership to TransferOwnershipBurnMint |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RMNRemote: solana.PublicKeyFromBytes(rmnRemoteAddr), | ||
| }) | ||
| if err != nil { | ||
| return sequences.OnChainOutput{}, fmt.Errorf("failed to deploy token: %w", err) |
There was a problem hiding this comment.
The error message 'failed to deploy token' is misleading - this operation is initializing a token pool, not deploying a token. The message should be 'failed to initialize token pool' to accurately reflect the operation.
| return sequences.OnChainOutput{}, nil | ||
| } | ||
| configPDA, _, _ := state.FindConfigPDA(input.TokenPool) | ||
| ixn, err := lockrelease_token_pool.NewInitializeInstruction( |
There was a problem hiding this comment.
This instruction uses lockrelease_token_pool.NewInitializeInstruction but should use the correct instruction builder for LockRelease pools. The current implementation appears to be copied from BurnMint initialization (line 32 in burnmint.go uses burnmint_token_pool.NewInitializeInstruction), and this line is likely incorrect for LockRelease pools.
| ixn, err := lockrelease_token_pool.NewInitializeInstruction( | |
| ixn, err := lockrelease_token_pool.NewInitializeLockReleaseInstruction( |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
No description provided.