0

Create Token: ~$ spl-token create-token Creating token 4PgB5jPM9a5Js5FT6zPJHD8rcDogcnbSSLS1d5Mny9n1 Signature: bmHzFBvFU2vq7AeLHuQuYsgDEPZRXV9mSDfK7RjPU7CwkyQoPEZLzrsCDaAJWB32bffmKsemjEshhrataAr2tQ8

Check Supply: ~$ spl-token supply 4PgB5jPM9a5Js5FT6zPJHD8rcDogcnbSSLS1d5Mny9n1 0

Mint Coins: ~$ spl-token mint 4PgB5jPM9a5Js5FT6zPJHD8rcDogcnbSSLS1d5Mny9n1 1000000000000 Minting 1000000000000 tokens Token: 4PgB5jPM9a5Js5FT6zPJHD8rcDogcnbSSLS1d5Mny9n1 Recipient: 85vRuzFU2LA2KQwpKRFF6TAwJVfJevT4GWAYVpGdfZ7U Signature: 3HDX6mRB1WBqpeSyYTwAfbobiBw8XdPa3nDTpbvSvH2cZFFMKfT8wLNV4rSHRRsWAsoDbuXULr5h94xQ8a9ZmmKk

Check Coin Supply: ~$ spl-token balance 4PgB5jPM9a5Js5FT6zPJHD8rcDogcnbSSLS1d5Mny9n1 18446744073.709551615

If I try to add coins to make up the missing coins, I get the following:

Error when adding coins:

~$ spl-token mint 4PgB5jPM9a5Js5FT6zPJHD8rcDogcnbSSLS1d5Mny9n1 100 Minting 100 tokens Token: 4PgB5jPM9a5Js5FT6zPJHD8rcDogcnbSSLS1d5Mny9n1 Recipient: 4rqoTZ2JTvdDzY5i4X73ZnGQjjPkNRpRfaByZ1anWgBD RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0xe [5 log messages]

I have been following the instructions on this page: https://spl.solana.com/token. I can't find any information on this anywhere, much less any log files to look at. I'm pretty sure I'm missing something, anybody?

hasherfer
  • 25
  • 2
  • 8

1 Answers1

1

The supply of tokens in the spl-token program is given by a u64: https://github.com/solana-labs/solana-program-library/blob/28d0aa775949869a4390dece7341fbb3daeddb5d/token/program/src/state.rs#L22, which means that the maximum possible number of tokens is 18446744073709551615. If you set 9 decimals in your token, as you have done, that means that the maximum number of possible tokens is u64::MAX / 1_000_000_000, or 18446744073.709551615.

If you need a higher number of coins, you'll have to create a new mint with fewer decimals.

Jon C
  • 7,019
  • 10
  • 17
  • Thank you so much Jon! Finally figured it out! I had to close all the accounts and create the token with the required decimals. After that, it was easy to get everything done! Thanks a million! – hasherfer Dec 21 '21 at 11:28