Tx Doctor / Solana error library / Invalid mint account
Solana error: Invalid mint account (0x2)
The mint account passed to a token instruction does not exist or is not a valid mint, so the token program rejected the instruction before anything moved.
Why it happens
- Every token operation pairs accounts with a mint. If the mint address was typoed, renamed, or the token's mint was closed after creation, the pairing check fails.
- Common around token launches where copycat contracts circulate several mint addresses that look identical.
- Also fires when a mint address is pasted where a token account address is expected — the two look similar in base58.
How to fix it
- Verify the mint address against the token's official page (project site, CoinGecko, or the issuer's announcement) — not against what a random link told you.
- Refresh the page and re-run the transaction; a just-created mint sometimes reaches wallets before their cache updates.
- Developers: fetch the account and confirm its owner is a token program before using it as a mint.
What it looks like in the logs
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x2 RPC simulation: Transaction simulation failed: Error processing Instruction: custom program error: 0x2 Wallet UI: "Transaction failed" — custom program error 0x2 (2)
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.
The same number means something else on another program
Anchor assigns custom error codes by enum order starting at 6000, so this number is local to this program. The rows below show what the very same number means on the other programs.
| Program | 0x2 = 2 |
|---|---|
| Raydium AMM v4 | Expected mint |
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