Open
Conversation
frolvanya
reviewed
Feb 22, 2026
solana/programs/bridge_token_factory/src/instructions/user/init_transfer_sol.rs
Show resolved
Hide resolved
solana/programs/bridge_token_factory/src/instructions/user/finalize_transfer.rs
Show resolved
Hide resolved
karim-en
requested changes
Feb 23, 2026
Collaborator
There was a problem hiding this comment.
let's cover these changes by test using LiteSVM or Mollusk
https://www.anchor-lang.com/docs/testing
Collaborator
frolvanya
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
max_used_nonce not updating
When finalizing a transfer,
max_used_noncevalue must be updated in the config account. This is needed to properly calculate rent required for nonce accounts. This wasn't happening because the config instance in the common WormholeCPI struct is not marked mutable.Fix
I decided to keep the config in the shared struct immutable. It's used in 6 different methods and only two (finalize_transfer and finalize_transfer_sol) need to mutate the config. Instead, I added a separate mutable config instance, same way it is already done for finalize_transfer_sol
Wrong account passed to metaplex instruction
The program id is internally ovewritten with the correct instruction, so the code was working as intended. Still rather fix this.
Remove unwraps
Minor code quality cleanup
Remove unsafe code
unsafe block in
used_nonces.rswas unnecessary