3

From the SPL code it says that the mint authority is optional and if its not provided, then the SPL token has a fixed supply. Which account is the recipient account of the fixed supply?

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>,
}

1 Answer 1

4

There is no actual supply until you mint it.

You would need to first create a token account and the mint to that account:

spl-token create-account EBF22st7gRqvKtEYW2WomsHUsNrjtPcZvpDAnh6W7Ugu
spl-token mint EBF22st7gRqvKtEYW2WomsHUsNrjtPcZvpDAnh6W7Ugu 100

You can set the mint authority to null and then you can't mint anymore. So its optional, but without it you cant mint anything.
You cant create a token without mint authority and it defaults to the client keypair that creates the token.

3
  • What is the purpose of setting the total supply as a default if nobody can mint tokens? Commented Jan 6 at 16:14
  • By default the mint authority is set to the keypair that creates the token. You can just choose later to set it to null. Then the supply will be fixed to what ever you minted before.
    – Jonas H.
    Commented Jan 7 at 15:23
  • If there is no actual supply when until mint, is there a default supply amount ? Will it be infinity if we don't have metadata that has supply restriction ?
    – WowBow
    Commented Aug 8 at 17:30

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.