Creating & Minting Tokens
Not every dapp needs minting support - you might want to only interact with existing tokens. However, if you want to create new assets, you'll need to understand token creation and minting in Yours Protocol.
Token Creation
To create a new token, you'll need to define its specifications and attach any modules you want it to support.
To do this, first let's import ft4 to the module
Then the create token operation
Note, in this example we did not check the authentication of the account.
Minting Tokens
After creating a token definition, you can mint instances of it to specific accounts:
Understanding Token Types
In Yours Protocol, the distinction between fungible and non-fungible tokens is determined by how you use them:
Non-Fungible: Create unique tokens by minting only one instance
Semi-Fungible: Create multiple instances of the same token
For example, a unique piece of art would be minted with amount=1, while a game item might have multiple copies.
Best Practices
When creating tokens:
Always authenticate operations
Validate input parameters
Consider which modules to attach
Plan your token distribution strategy
Last updated
Was this helpful?