custom program error: 0x1
A program-specific error with code 0x1 (decimal 1). The meaning depends on which program emitted it. In the SPL Token program, 0x1 is InsufficientFunds — the source token account does not have enough tokens for the transfer.
Common meanings by program
| Program | Error 0x1 meaning |
|---|---|
| SPL Token / Token-2022 | InsufficientFunds — not enough tokens |
| System Program | ResultWithNegativeLamports |
| Anchor programs | Custom — check the program’s IDL |
How to fix (SPL Token)
- Check the source token account balance with getTokenAccountBalance.
- Verify you are using the correct token account (not the mint or wallet address).
- Account for token decimals —
amountis in the smallest unit (e.g., for a 6-decimal token, 1.0 token = 1,000,000 in amount).
How to fix (other programs)
- Find the program ID in the transaction’s error logs.
- Look up error code 1 in that program’s source code or IDL.
- The transaction logs from getTransaction show which instruction failed and the log messages leading to the error.
FAQ
How do I decode custom program errors?
Check the program’s error definitions: Rust source code (the Error enum), the Anchor IDL (errors array), or the program’s documentation. Error 0x1 is always index 1 in the enum.
Is 0x1 always InsufficientFunds? Only for SPL Token. Each program defines its own error codes. The same hex code means different things in different programs.
Error text variants
-
custom program error: 0x1 -
Program returned error: 0x1
Updated: