Solana programs Part 1: understanding SPL Token Mint

sec3 (formerly Soteria)
Coinmonks

--

Solana token program (source code) is among the most frequently executed Solana smart contracts. Its program id: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA

  • Most user-deployed Solana smart contracts (directly or transitively) use the token program to mint/transfer/burn tokens (i.e., SPL tokens). For example, if your Solana project is a decentralised exchange, a stable coin, an ICO, or a cross-chain bridge, you are likely relying on the token program.
  • SPL tokens are similar to ERC20/ERC721 tokens, but with tricky differences.

In this article, we elaborate on the SPL tokens and introduce the internals of those most commonly used instructions in the token program:

  • InitializeMint — spl_token::instruction::initialize_mint
  • InitializeAccount — spl_token::instruction::initialize_account
  • MintTo — spl_token::instruction::mint_to
  • Burn — spl_token::instruction::burn
  • Transfer — spl_token::instruction::transfer
  • SyncNative — spl_token::instruction::sync_native
  • Approve— spl_token::instruction::approve
  • Revoke— spl_token::instruction::revoke
  • FreezeAccount — spl_token::instruction::freeze_account
  • ThawAccount — spl_token::instruction::thaw_account
  • CloseAccount — spl_token::instruction::close_account

--

--