Skip to content

Solana MintToChecked and BurnChecked prompts ignore signed decimals #560

Description

@BitHighlander

Summary

MintToChecked and BurnChecked include a signed decimals byte, and the parser stores it in pi->extra_u8, but their confirmation screens render the base-unit integer directly as N tokens. The adjacent TransferChecked path correctly uses solana_formatTokenAmount(..., pi->extra_u8).

Example: an instruction encoding amount = 1000000000 and decimals = 9 represents 1 token, but the current device prompt says 1000000000 tokens.

This remains on current alpha; PR #557 adds MintTo mint/recipient identities but still renders the raw amount and does not fix BurnChecked.

Security / signing impact

The prompt does not faithfully represent the signed checked instruction's amount semantics. This can cause users to approve or reject based on a value off by up to the signed decimal exponent and makes the reviewed value inconsistent across otherwise analogous SPL checked instructions.

Code evidence

lib/firmware/solana.c assigns the checked instruction's byte 9 to pi->extra_u8 for MintToChecked/BurnChecked. lib/firmware/fsm_msg_solana.h ignores it in SOL_INSTR_TOKEN_MINT_TO and SOL_INSTR_TOKEN_BURN, while SOL_INSTR_TOKEN_TRANSFER already formats with it.

Acceptance criteria

  • Format MintToChecked and BurnChecked with the signed decimals byte, using the same bounded formatter behavior as TransferChecked.
  • Keep the unchecked MintTo/Burn encoding distinguishable (no fabricated decimals).
  • Add boundary tests for 0, normal, and greater-than-supported decimal values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions