How to Create a SPL Token on SOON
This guide demonstrates how to create Solana Program Library (SPL) tokens on the SOON. We’ll use the Metaplex Foundation’s UMI framework and MPL Token Metadata program to create our token.
Introduction
In this guide, you’ll learn how to create your own SPL token on SOON’s testnet.
You can find the complete code for this guide on GitHub.
Prerequisites
Before you begin, make sure you have:
- Node.js (v14 or higher)
- pnpm package manager
- Basic understanding of Solana and SPL tokens
- A wallet funded with testnet SOON tokens
Implementation
Let’s understand how to create an SPL token by breaking down the code:
Code Breakdown
-
UMI Initialization:
This creates a new UMI instance connected to SOON’s testnet. The UMI framework provides a convenient way to interact with the SOON blockchain.
-
Keypair Setup:
Here we create a keypair from your wallet’s secret key which will be used to sign transactions. The script also checks and displays your wallet balance.
-
Token Creation:
This creates the actual token with the following parameters:
mint
: A new generated signer for the tokenname
: The name of your tokenuri
: Link to your token’s metadata (usually hosted on Arweave/IPFS)sellerFeeBasisPoints
: Royalty percentage (5.5% in this case)decimals
: Number of decimal places for the token (7 in this case)
Using the Code
To create your own token:
- Set your wallet’s secret key in the
payerSecretKey
array - Modify the token parameters in the
main()
function:name
: Your token’s nameuri
: Link to your token’s metadatasellerFeeBasisPoints
: Seller fee percentagedecimals
: Number of decimal places
When you run the script, you’ll see output like:
Network Configuration
SOON provides different networks for development and testing:
- Devnet:
https://rpc.devnet.soo.network/rpc
- Testnet:
https://rpc.testnet.soo.network/rpc
To switch networks, simply update the UMI initialization URL.