0
Error: Client(Error { request: Some(SendTransaction), kind: RpcError(RpcResponseError { code: -32002, message: "Transaction simulation failed: Error processing Instruction 0: custom program error: 0xe", data: SendTransactionPreflightFailure(RpcSimulateTransactionResult { err: Some(InstructionError(0, Custom(14))), logs: Some(["Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb invoke [1]", "Program log: Instruction: MintToChecked", "Program log: Error: Operation overflowed", "Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb consumed 5429 of 5429 compute units", "Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb failed: custom program error: 0xe"]), accounts: None, units_consumed: Some(5429), return_data: None, inner_instructions: None }) }) })
PS C:\Users\Keola>

To what I can make of it is, there are no more computational units left to do this task? It also seems like this is on the Solana side so, how do I work around this? I'm using the CLI interface, I can code in .js but tying in the pointers for CLI has been very difficult, so annoying in fact I gave up importing my phantom wallet in CLI and just made a new one and then merged it with my existing Phantom wallet.. lol I'm getting very close to finishing my white paper for the project and just want to make sure I don't have to keep making new coins. Cause there's some things you cant even change after the initial creation and if you want to change it you have to make a new spl-token etc. I'm utterly surprised how completely hard-to-use web3 development is. Like, As a normal game/app dev I'm just surprised how much work you gotta put in and even then, things constantly break and don't work right. lol

2 Answers 2

1

Tokens on Solana have their total supply denoted by u64::MAX, which is 18,446,744,073,709,551,615. When you set the decimals on your token to be 12, your new max tokens you can possibly mint are 18,446,744.073,709,551,615. This is why you're finding yourself with a "max amount" of 18 million tokens.

You can "increase" the max tokens that you can have with a lower decimal amount. You cannot decrease the number of decimals on a mint already created, so you'll need to create a new token.

5
  • that is correct! I found it on stack exchange on a separate issue from another guy! Thank you, yeah, I had to make a new token sadly. ETH has a huge supply and like 15 decimals so i figured Solana tokens could have the same size/placement which, sadly it can't but, I compromised and did 10 decimals,
    – Keola
    Commented Apr 23 at 4:18
  • If this was the answer, could you please accept it?
    – Jacob Creech
    Commented Apr 23 at 14:00
  • still new, I'm trying to figure out how to do that. mb.
    – Keola
    Commented Apr 23 at 23:58
  • Hi @JacobCreech, I was stuck in this problem for a while. how can I mint 390,899,205,980,111 supply with 9 decimal? When I minted it was minted the wrong supply.
    – Bobz
    Commented May 29 at 12:01
  • You can't. You're limited because of your decimal choice
    – Jacob Creech
    Commented May 30 at 14:37
0

Understanding the Overflow Error

In the context of SPL Tokens, an overflow error can occur if the total supply of tokens after minting would exceed the maximum value that can be stored in the variable holding the supply count. The SPL Token program uses a 64-bit unsigned integer to represent token amounts, which allows for a very large range of values (up to 2^64 - 1), but it's still finite.

When you attempted to mint 60,000,000 tokens, adding to the 18 million already minted, it should not inherently cause an overflow unless the mint operation was specified with an incorrect amount (e.g., a decimal place issue causing the mint amount to be orders of magnitude higher than intended) or there's an existing bug in how the amounts are processed.

The error you encountered (custom program error: 0xe, indicating an "Operation overflowed") does not relate to computational units running out but to an arithmetic overflow within the SPL Token program. This typically happens when the operation tries to process numbers larger than what's supported by the program's logic or the data types used, such as attempting to mint more tokens than the maximum supply allows or can be represented in the program's state.

Here's how to address and work around the issue, especially when using the Solana CLI:

1. Review Token Minting Command

  • Ensure the mint amount is within the valid range and accounts for the token's decimal places correctly.
  • Verify the maximum supply of the token (if set) isn't exceeded by the total after minting.

2. Correct Use of Decimals

  • Tokens can have decimals, and all amounts are in the smallest unit. Confirm you're minting the correct "physical" amount considering these decimals.

3. Recheck the Token Initialization Parameters

  • If your token has a maximum supply limit set during its creation, ensure your minting operation does not attempt to surpass this limit.

4. CLI Command Syntax

Here's a reminder on the command structure for minting tokens, ensuring correct syntax and parameters:

solana-tokens mint --mint <MINT_ADDRESS> --amount <AMOUNT> --owner <OWNER_KEYPAIR> --decimals <DECIMALS>
  • Replace <MINT_ADDRESS> with your token's mint address.
  • <AMOUNT> is the number of tokens you wish to mint, considering the decimal places.
  • <OWNER_KEYPAIR> is the file path to your keypair (wallet) that has minting authority.
  • <DECIMALS> should match the token's decimal definition.

5. Use of RPC Nodes

  • The issue is not related to computational units or the specific RPC node's capacity but can be mistakenly perceived as such due to transaction failure. Ensure your node is fully synced and operational for transaction broadcasting.

6. Solana CLI and Environment

  • Ensure your Solana CLI tool is updated to the latest version to avoid any discrepancies or bugs in command execution.
  • If using a custom RPC endpoint (like Helius), confirm its availability and operational status.

7. Advanced Troubleshooting

  • If issues persist, consider performing a dry run of the transaction using the --dry-run flag to simulate the transaction without broadcasting it, which might provide additional insights.

Web3 Development Insight

Blockchain development, including on Solana, involves unique challenges and complexities. While it might seem daunting compared to traditional app development, leveraging community resources, documentation, and continued learning can significantly ease the process.

5
  • this didn't work man. and no I didnt set a mint limit.
    – Keola
    Commented Apr 11 at 1:24
  • To clarify, I minted 60millionm but it GAVE me 18. Also, I'm trying to mint back the deficit. Also the example you game me doesnt work, I tried it as, solana-tokens mint --mint <MINT_ADDRESS> --amount <AMOUNT> --owner <OWNER_KEYPAIR> --decimals <DECIMALS> and solana-tokens mint <MINT_ADDRESS> <AMOUNT> <OWNER_KEYPAIR> <DECIMALS>
    – Keola
    Commented Apr 11 at 1:36
  • Try this Mint Command Syntax: ``` spl-token mint <MINT_ADDRESS> <AMOUNT> --owner <OWNER_KEYPAIR_PATH> ``` - <AMOUNT>: This is the number of tokens you wish to mint. Ensure this is adjusted for the token's decimal places (e.g., to mint 100 tokens with 6 decimal places, you'd input 100000000 as the amount).
    – udaysharma
    Commented Apr 11 at 9:11
  • If your token mint address is ExampleMintAddress, you want to mint 100 tokens, and your keypair is located at /home/user/mykeypair.json, the command would look like this: spl-token mint ExampleMintAddress 100000000 --owner /home/user/mykeypair.json Note: There's no need to specify decimals in the mint command as the SPL Token program uses the decimal setting defined during the token creation for all operations involving this token.
    – udaysharma
    Commented Apr 11 at 9:12
  • Hi @udaysharma, I was stuck in this problem for a while. how can I mint 390,899,205,980,111 supply with 9 decimal? When I minted it was minted the wrong supply
    – Bobz
    Commented May 29 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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