10

My token sending program has met an issue about sending transaction, throwing an error below.

Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1

It is related with SOL balance. I want to know the reason behind this problem. Is it because there is less SOL on the sending side? Or I wonder if it's because the recipient has less sol

2 Answers 2

15

The error for the token program is defined here: https://github.com/solana-labs/solana-program-library/blob/ea354ab358021aa08f774e2d4028b33ec56d4180/token/program/src/error.rs#L16

0x1 = InsufficientFunds, so in this case means that the sending token account does not have enough funds to send to the recipient.

4
  • 3
    What do I do if the sending token account actually does have enough funds?
    – Ozymandias
    Commented Oct 21, 2021 at 6:35
  • 1
    I got the same issue. I have enough fund but having that error. Anyone knows why?
    – Danny
    Commented Nov 25, 2021 at 18:26
  • 4
    it only contain 19 error, i got custom program error: 0x26 where do i see error explanation for 26?
    – kafinsalim
    Commented Jan 4, 2022 at 6:57
  • @kafinsalim check my answer for error 0x26 and any other error that you cannot find in the link provided in this answer.
    – cprcrack
    Commented Mar 12, 2022 at 14:01
5

This kind of errors are usually listed in error definition files in the public Github repository of the Solana Programs that generate them. If you can't find the error in the Solana Program Library Token program errors, you may be getting an error from the Metaplex Program Library's Token Metadata program, which is also extensively used by different Solana ecosystem tools such as Metaboss.

Remember that you will first need to convert the hex value (that's what the 0x prefix signald). For example, to find Error processing Instruction 4: custom program error: 0x26, I first converted 0x26 to decimal, which is 38, and I then used Chrome's search functionality to find the 39th appearance of the text error(, which resulted in this line:

    #[error("If using a creators array, you must be one of the creators listed")]
    MustBeOneOfCreators,

Now at least you have a more descriptive error to work with.

3
  • 1
    what if the error I'm getting is 2003 (0x7d3) [SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 2: custom program error: 0x7d3 ]
    – BennoDev
    Commented May 24, 2022 at 15:40
  • 1
    If the error code is below 20, how do you know which error file to look in?
    – Alaska
    Commented Jun 23, 2022 at 14:47
  • I tried using this but my error code is 0x1772 which results in 6002. Now I particularly don't know where to look this for. I'm trying to execute swap using JITO Commented Jun 21 at 9:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.