When creating a spl-token mint, we pass in the number for supply. What is the value of MINT_SIZE? Is there a way to create a spl-token mint with infinite supply? If not, What is the maximum number of the underlying unsigned datatype?
1 Answer
MINT_SIZE
= 82, its the size (in bytes) of the account data for a Mint Account.
A standard Mint Account has the following layout:
pub struct Mint {
/// Optional authority used to mint new tokens. The mint authority may only
/// be provided during mint creation. If no mint authority is present
/// then the mint has a fixed supply and no further tokens may be
/// minted.
pub mint_authority: COption<Pubkey>,
/// Total supply of tokens.
pub supply: u64,
/// Number of base 10 digits to the right of the decimal place.
pub decimals: u8,
/// Is `true` if this structure has been initialized
pub is_initialized: bool,
/// Optional authority to freeze token accounts.
pub freeze_authority: COption<Pubkey>,
}
The supply
is u64
type, so that would be the limit for the maximum supply.