🪙Token
Common types and utils for tokens
1. Summary
Token
defines utils used to validate token symbols and names. It also defines how an instantiation struct for a token looks like and what data it holds.
2. Variables & Functions
Structs
InstantiateMsg
This struct holds parameters used to instantiate a token contract.
name
- The name of the new tokensymbol
- The token symboldecimals
- The amount of decimals the token hasinitial_balances
- The initial accounts that have token balancesmint
- Minting rights specified via a standard CW20 MinterResponse struct
MigrateMsg
This struct holds parameters used to migrate a token contract.
At the moment, the struct is empty
Struct Logic
InstantiateMsg
Defines logic used to validate a token's name, symbol and decimals
Functions
is_valid_name
(name: &str)
->
bool
Checks if a token name is valid (checking length between 3-50 bytes)
is_valid_symbol
(symbol: &str)
->
bool
Checks if a token symbol is valid (checking length between 3-12 bytes and the characters used)
Last updated
Was this helpful?