Solana SOL链发币教程——代币数量最大限制与精度之间的平衡策略【pdf+视频SOL发币教程下载】

  • A+
所属分类:Solana(SOL)

chatGPT账号

Solana SOL链发币教程——代币数量最大限制与精度之间的平衡策略【pdf+视频SOL发币教程下载】

一、说明
solana链代币数量最大限制为 uint64 数据类型的最大值:18446744073709551615,因此代币数量包括精度最大为 18446744073709551615,超过了该值默认设置代币数量为 18446744073709551615。因此需要在代币数量和精度之间设置合适的平衡策略,既可以保证代币数量不超过最大值,又可以设置合理的精度值。
  1. 代币数量(含精度)最大不能超过 18446744073709551615值
  1. 如果代币总量超过了 18446744073709551615 值,则代币总量默认设置为 18446744073709551615 
  1. 控制solana链代币数量变量的数据类型为 uint64,因此代币数量的最大值即为 uint64数量类型的最大值:18446744073709551615 
  1. 代币数量位数+精度(默认9)总位数不能超过 20位(18446744073709551615的总位数)
二、详细说明及故障处理
1、故障还原:
When trying to mint tokens using spl-token mint, and trying to mint 1,000,000,000,000 tokens, it only mints 18446744073.709551615 tokens
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?
2、故障原因:
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.

3、故障解决:

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!

至此,完成代币数量最大限制与精度之间的平衡策略所有操作流程。

pdf+视频Solana链SOL发币教程及多模式组合合约源代码下载:

Solana链SOL发币(合约部署、开源、锁仓、LP、参数配置、开发、故障处理、工具使用)教程下载:

Solana SOL链发币教程——代币数量最大限制与精度之间的平衡策略【pdf+视频SOL发币教程下载】

多模式(燃烧、回流指定营销地址、分红本币及任意币种,邀请推广八代收益,LP加池分红、交易分红、复利分红、NFT分红、自动筑池、动态手续费、定时开盘、回购)组合合约源代码下载:

Solana SOL链发币教程——代币数量最大限制与精度之间的平衡策略【pdf+视频SOL发币教程下载】Solana SOL链发币教程——代币数量最大限制与精度之间的平衡策略【pdf+视频SOL发币教程下载】

pdf+视频Solana链SOL发币教程及多模式组合合约源代码下载地址:

此处为隐藏的内容!
登录后才能查看!

添加VX或者telegram获取全程线上免费指导

Solana SOL链发币教程——代币数量最大限制与精度之间的平衡策略【pdf+视频SOL发币教程下载】

免责声明

免责声明:

本文不代表知点网立场,且不构成投资建议,请谨慎对待。用户由此造成的损失由用户自行承担,与知点网没有任何关系;

知点网不对网站所发布内容的准确性,真实性等任何方面做任何形式的承诺和保障;

网站内所有涉及到的区块链(衍生)项目,知点网对项目的真实性,准确性等任何方面均不做任何形式的承诺和保障;

网站内所有涉及到的区块链(衍生)项目,知点网不对其构成任何投资建议,用户由此造成的损失由用户自行承担,与知点网没有任何关系;

知点区块链研究院声明:知点区块链研究院内容由知点网发布,部分来源于互联网和行业分析师投稿收录,内容为知点区块链研究院加盟专职分析师独立观点,不代表知点网立场。

本文是全系列中第190 / 237篇:通证发行

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的电报
  • 这是我的电报扫一扫
  • weinxin
chatGPT账号
知点

发表评论

您必须登录才能发表评论!