Fix review followup: XChaCha20, vault decimals, dead code#143
Merged
Conversation
Replaced custom XOR-mask scheme with AEAD encryption. The previous approach had no authentication (bit-flip attacks undetected) and deterministic keystream (two-time-pad on same recipient). Now uses random 24-byte nonce per message, prepended to ciphertext.
Previous code assumed 9 decimals for all non-USDC/USDT tokens. Now batch-fetches mint account data (decimals at offset 44) via getMultipleAccountsInfo. Also adds balanceStatus field so frontend can distinguish zero balance from RPC unavailability.
Always returned true — no consumers after private-swap pre-flight removal. Added clarifying comment to getSupportedTokens (label lookup, not a whitelist).
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.
Summary
Addresses 3 Important issues flagged during self-audit of #142.
getMultipleAccountsInfoinstead of assuming 9 decimals. AddedbalanceStatus: 'ok' | 'unavailable'field for RPC failure transparency.isTokenSupported— always returnedtrue, zero consumers after Tech Debt Zero: ship real or remove — 15 issues fixed #142.Test plan
pnpm test -- --run— 497 tests passingcd app && pnpm build— clean