Tx Doctor / Solana error library / Decimals mismatch
Solana error: Decimals mismatch (0x12)
A decimals value supplied to the instruction does not match the mint's actual decimals, so the program rejected it rather than guessing.
Why it happens
- Initializing a wrapped-SOL or new token account with a hardcoded decimals value that differs from the mint's real one.
- Common with UIs that assume 9 decimals when the token uses 6 (USDT-style) or vice versa — amounts then display wildly wrong.
How to fix it
- Read the decimals from the mint account instead of hardcoding — the wallet displays the correct value on the token page.
- If amounts in your app show absurd magnitudes (1000× off), this mismatch is almost certainly why.
What it looks like in the logs
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x12 RPC simulation: Transaction simulation failed: Error processing Instruction: custom program error: 0x12 Wallet UI: "Transaction failed" — custom program error 0x12 (18)
One failure, three places it shows up: the raw transaction log, the RPC simulation error, and the wallet's short message. Match on the code, never on the wording.
What this means for your funds
Solana transactions are atomic: if any instruction fails, every state change in that transaction is reverted, so token balances end exactly where they started. The network fee is still charged, because validators did the work of executing and rejecting it. A failed transaction never moves your tokens to someone else.
Seeing this error right now? Paste your transaction signature and get the exact instruction, program and code that failed.
Diagnose my transaction