Skip to content

fix: support FA2 token swaps (LIVE-36514) - #30

Closed
dbaranov-hoodies wants to merge 6 commits into
developfrom
36514-failed-usdt-tezos-fail
Closed

fix: support FA2 token swaps (LIVE-36514)#30
dbaranov-hoodies wants to merge 6 commits into
developfrom
36514-failed-usdt-tezos-fail

Conversation

@dbaranov-hoodies

Copy link
Copy Markdown

Checklist

  • [ x] App update process has been followed
  • [ x] Target branch is develop
  • [ x] Application version has been bumped

Swapping USDT (Tezos) failed: the app answered 0x6985 to the final signature
and Ledger Live showed "Operation denied on device".

swap_check_validity() only understood a native XTZ transfer. A token swap
signs an FA2 transfer call, so the operation carries 0 mutez and its
destination is the token contract, while the recipient and the amount live in
the Michelson parameters — both comparisons could never match.

The check now branches on whether Exchange passed a coin configuration:

  • native XTZ: unchanged
  • token: requires 0 mutez, exactly one fully decoded transfer, the called
    contract and token id to resolve in the FA2 registry, that entry's symbol
    and decimals to match the Ledger-signed coin configuration, and the
    Michelson to_ and amount to match the swap's destination and amount

swap_handle_get_printable_amount() now uses the token's ticker and decimals
instead of hardcoded XTZ/6, so the Exchange screen no longer labels a USDt
amount as XTZ.

The parser keeps the decoded recipient, token id and amount in the operation
state, since the emit steps reuse both the CAPTURE and decimal buffers and the
frame holding the token id is popped before validation runs. Anything it
cannot represent leaves the transfer unvalidated, so the swap refuses while
the display path is untouched.

Unit tests now build with -DHAVE_SWAP; two new ones pin the captured operation
and check that a Micheline fallback leaves the swap fields unset.

Version bumped to 3.2.4 (3.2.3 is released but its tags are not ancestors of
develop, so that number is taken).

Needs the app-exchange tests in LedgerHQ/app-exchange#382, and a CAL entry
publishing ticker + decimals for FA2 tokens on Tezos — Exchange forwards only
the sub-coin config to the coin app, so without it the app is never told which
token the operation moves and keeps refusing, by design.

@dbaranov-hoodies
dbaranov-hoodies requested a review from a team August 27, 2026 11:38
Comment thread .github/workflows/build_and_functional_tests.yml Fixed
dbaranov-hoodies and others added 2 commits August 31, 2026 16:38
…issions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Code coverage report

Code Coverage

Per-file coverage
Package Line Rate Branch Rate Health
app.src.parser 85% 61%
Summary 85% (1501 / 1770) 61% (758 / 1244)

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.

2 participants