1

Fungible tokens

The createAndMint(...) function accepts the parameter amount. This is an amount of tokens to be minted immediately, right? Then how to specify the total supply?

1 Answer 1

2

The total supply is defined as the total number of tokens currently minted, so if amount is the amount of tokens to be minted immediately, then total supply will be that amount.

If you decide to mint more tokens, then the supply will increase.

You can learn more about SPL Token at https://spl.solana.com/token

6
  • what if I wanted to specify the total supply greater than the amount of the tokens I wanted to mint right away?
    – barugaggi
    Commented Apr 14 at 15:28
  • and it's different from how it's in Ethereum, right? 2 distinct numbers
    – barugaggi
    Commented Apr 14 at 19:14
  • 1
    Tokens have to exist in some account, and there's no ability to set a max supply. If you want to mimic that kind of functionality, you can "pre-mint" tokens into some other account, and distribute from there, rather than minting new tokens
    – Jon C
    Commented Apr 14 at 19:27
  • and this is different from how it's in Ethereum, right?
    – barugaggi
    Commented Apr 17 at 21:04
  • Yes, ERC-20 is an interface, whereas SPL Token is a specific implementation. So your Ethereum contract can do whatever it wants, but your SPL Token is constrained by how the SPL Token program operates
    – Jon C
    Commented Apr 18 at 8:55

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.