# Token

## 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. | <p></p><p></p><ul><li><code>name</code> - The name of the new token</li><li><code>symbol</code> - The token symbol</li><li><code>decimals</code> - The amount of decimals the token has</li><li><code>initial\_balances</code> - The initial accounts that have token balances</li><li><code>mint</code> - Minting rights specified via a standard CW20 MinterResponse struct</li></ul> |
| `MigrateMsg`     | This struct holds parameters used to migrate a token contract.     | <ul><li>At the moment, the struct is empty</li></ul>                                                                                                                                                                                                                                                                                                                                    |

### 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) |
