Repository navigation
Conversation
… Confirm The broker encodes the vault swap, and the app checked its vault and amount but not where the output goes. The destination chain, asset and address the quote was made for are now encoded on the device and must match the broker's EVM vault call, Solana instruction and Tron note, or the swap is stopped before it is signed.
The vault address came from the factory's get_vault_address on a TON node. It is now derived from the factory's deploy code and the asset swapped, the way the factory deploys it, for TON and every jetton, so the node is no longer asked.
The coin sent with the transaction came from the provider's response. It must now be the quoted amount for a native coin and zero for a token, or the swap is stopped before it is signed; Celo's native coin is pulled as a token, so it sends zero. Near Intents' deposit amount must match the quoted amount for every asset.
…ice on Confirm The broker encodes the refund parameters into the vault swap, and the app checked what it sent but not what came back. The refund address, retry window and minimum price are now encoded on the device and must match the broker's EVM vault call, Solana instruction and Tron note, or the swap is stopped before it is signed. Solana and Tron are read at the exact position of those parameters, and a layout the app doesn't know stops the swap too.
0xh3rman
marked this pull request as ready for review
October 30, 2026 13:02
gemcoder21
requested changes
Oct 30, 2026
gemcoder21
left a comment
Contributor
There was a problem hiding this comment.
it looks like a code smell, it does not give enough protection that's worth adding those checks
Collaborator
Author
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.
Swap transactions that a provider writes are now checked on the device against what the quote says, and stopped before signing if they differ. Each commit stands alone.
chainflip/destination.rs).cfParameterson all three source networks (chainflip/refund.rs).Behavior to review
cfParametersversion other than 1 stops Chainflip vault swaps at Confirm until the app is updated, because a layout the app can't read can't be checked. New fields after the minimum price don't affect it.Verified
cargo test -p swapper --libpasses on each commit (567, 569, 573, 575);cargo fmtis clean on each, and clippy onswapperandgem_tonat the tip.get_quoteandget_quote_data, on this branch against unmodifiedmain: 99 routes pass on both, and 17 fail on both at the quote step.Not covered
mainand this branch, so it didn't run end to end; its broker encoding was checked.cfParametersis not checked.