🪙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

Name
Description
Contains

InstantiateMsg

This struct holds parameters used to instantiate a token contract.

  • name - The name of the new token

  • symbol - The token symbol

  • decimals - The amount of decimals the token has

  • initial_balances - The initial accounts that have token balances

  • mint - 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

Name
Description

InstantiateMsg

Defines logic used to validate a token's name, symbol and decimals

Functions

Name
Params
Description

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?