Token Operations
XYZ Chain supports CW20 tokens - the CosmWasm standard for fungible tokens, similar to ERC-20 on Ethereum or SPL tokens on Solana.What is CW20?
CW20 is a specification for fungible tokens on CosmWasm chains. It defines:- Token metadata (name, symbol, decimals)
- Balance tracking
- Transfer operations
- Minting and burning
- Allowances (approve/transferFrom)
Token Commands
| Command | Description |
|---|---|
xyz token create | Deploy a new CW20 token |
xyz token mint | Mint tokens to an address |
xyz token transfer | Send tokens to a recipient |
xyz token burn | Burn tokens from your balance |
xyz token balance | Check token balance |
xyz token info | View token metadata |
xyz token list | List all tokens you hold |
Quick Start
1. Deploy the CW20 Base Contract
First, ensure the CW20 base contract is deployed on the chain:2. Create a Token
3. Check Balance
4. Transfer Tokens
Token Properties
When creating a token, you define:| Property | Description | Example |
|---|---|---|
name | Human-readable name | ”My Token” |
symbol | Trading symbol | ”MTK” |
decimals | Decimal places | 6 |
initial_supply | Starting supply | 1000000000000 |
minter | Who can mint more | Your address |
CW20 vs Native Tokens
| Feature | CW20 Tokens | Native (uxyz) |
|---|---|---|
| Creation | Anyone can create | Fixed at genesis |
| Inflation | Configurable | Zero |
| Query | Contract query | Bank module |
| Transfer | Contract execute | Bank send |
| Gas Cost | Higher | Lower |
Prerequisites
Before creating tokens:- CW20 Code ID - The base contract must be deployed
- Sufficient Balance - Gas fees in uxyz
- Key Setup - A keypair in your keyring
Architecture
- Contract address
- Name and symbol
- Balances
- Minter configuration
Use Cases
Governance Tokens
Create tokens for DAO voting and governance
Stablecoins
Issue wrapped stablecoins on XYZ Chain
Reward Tokens
Distribute rewards to users
Utility Tokens
Power in-app economies