Skip to content

chore(add-token): surface contract address + SAC trustline disclosure - #2827

Closed
piyalbasu wants to merge 2 commits into
masterfrom
chore/addtoken-sac-disclosure
Closed

chore(add-token): surface contract address + SAC trustline disclosure#2827
piyalbasu wants to merge 2 commits into
masterfrom
chore/addtoken-sac-disclosure

Conversation

@piyalbasu

Copy link
Copy Markdown
Contributor

Draft PR backing #2826 — implementation of the proposed /add-token popup disclosure changes. Held in draft until design direction is confirmed.

Summary

  • Contract row (unconditional, both SEP-41 and SAC branches): renders truncatedPublicKey(contractId) so the user can cross-check the resolved contract address against whatever the dapp claimed.
  • SAC-only disclosure block (rendered when StrKey.isValidEd25519PublicKey(assetIssuer) === true):
    • Replacement description copy explaining that approving signs and submits a Stellar transaction, locks a reserve, and charges a network fee
    • Issuer row (truncated G… address)
    • Account reserve row (0.5 XLM, from BASE_RESERVE)
    • Network fee row (recommendedFee from useNetworkFees() — same value that flows into getManageAssetXDR)

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

Closes #2826 when merged.

🤖 Generated with Claude Code

piyalbasu added 2 commits May 29, 2026 17:09
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.
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-0646e85cc9831e993382 (SDF collaborators only — install instructions in the release description)

@piyalbasu piyalbasu closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Add Token disclosure for SAC (classic-asset) tokens

1 participant