chore(add-token): surface contract address + SAC trustline disclosure - #2827
Closed
piyalbasu wants to merge 2 commits into
Closed
chore(add-token): surface contract address + SAC trustline disclosure#2827piyalbasu wants to merge 2 commits into
piyalbasu wants to merge 2 commits into
Conversation
When the token being added is a Stellar Asset Contract (SAC) — i.e. the
resolved issuer is a classic Ed25519 account — approving the prompt
signs and submits a changeTrust op for the wrapped asset. The popup
previously rendered the same generic "allow token to be displayed and
used with this wallet address" copy used for pure-Soroban tokens, with
no indication that a Stellar transaction would be broadcast.
On the SAC branch only, swap the description for explicit language
("Approving will submit a Stellar transaction… modify your Stellar
account, lock a reserve, and charge a network fee") and add three
metadata rows: Issuer (truncated), Account reserve (0.5 XLM), and
Network fee (from useNetworkFees).
Pure-Soroban tokens (contract-id issuer, no on-chain side effect)
keep the existing copy and layout.
Both SEP-41 and SAC tokens now render a Contract row showing the truncated contract address (params.contractId) the popup is about to register. The contract address is the only un-spoofable on-screen identifier — token name and symbol come from the contract's own self-reported metadata — so surfacing it lets the user cross-check what Freighter resolved against what the calling dapp claimed. Placed below the Wallet row; rendered for every addToken request regardless of branch.
Contributor
|
PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-0646e85cc9831e993382 (SDF collaborators only — install instructions in the release description) |
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.
Draft PR backing #2826 — implementation of the proposed
/add-tokenpopup disclosure changes. Held in draft until design direction is confirmed.Summary
truncatedPublicKey(contractId)so the user can cross-check the resolved contract address against whatever the dapp claimed.StrKey.isValidEd25519PublicKey(assetIssuer) === true):0.5 XLM, fromBASE_RESERVE)recommendedFeefromuseNetworkFees()— same value that flows intogetManageAssetXDR)Pure-Soroban branch keeps the original description and only gains the Contract row.
No changes to
useSetupAddTokenFlow,useChangeTrustline, or any signing path — presentational only.Test plan
yarn jest --testPathPattern "addToken|useNetworkFees"— passscreenshot-addtoken-sac.test.tsconfirms layout (see Improve Add Token disclosure for SAC (classic-asset) tokens #2826)Closes #2826 when merged.
🤖 Generated with Claude Code