Token Operations

bwickchain 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 bwickchain’s standard for fungible tokens (a CosmWasm specification). It defines:
  • Token metadata (name, symbol, decimals)
  • Balance tracking
  • Transfer operations
  • Minting and burning
  • Allowances (approve/transferFrom)

Token Commands

CommandDescription
bwick token createDeploy a new CW20 token
bwick token mintMint tokens to an address
bwick token transferSend tokens to a recipient
bwick token burnBurn tokens from your balance
bwick token balanceCheck token balance
bwick token infoView token metadata
bwick token listList all tokens you hold

Quick Start

1. Deploy the CW20 Base Contract

First, ensure the CW20 base contract is deployed on the chain:
# Run the deployment script
./scripts/deploy-cw20.sh

# Save the code ID
bwick config set cw20-code-id 1

2. Create a Token

bwick token create \
  --name "My Token" \
  --symbol "MTK" \
  --decimals 6 \
  --initial-supply 1000000000000 \
  --from mykey

3. Check Balance

bwick token balance bwick1tokencontract... --key mykey

4. Transfer Tokens

bwick token transfer bwick1tokencontract... bwick1recipient... 1000000 --from mykey

Token Properties

When creating a token, you define:
PropertyDescriptionExample
nameHuman-readable name”My Token”
symbolTrading symbol”MTK”
decimalsDecimal places6
initial_supplyStarting supply1000000000000
minterWho can mint moreYour address

CW20 vs Native Tokens

FeatureCW20 TokensNative (ubwick)
CreationAnyone can createFixed at genesis
InflationConfigurableZero
QueryContract queryBank module
TransferContract executeBank send
Gas CostHigherLower

Prerequisites

Before creating tokens:
  1. CW20 Code ID - The base contract must be deployed
  2. Sufficient Balance - Gas fees in ubwick
  3. Key Setup - A keypair in your keyring
Check CW20 is configured:
bwick config get cw20-code-id
# Should return a number like: 1
If not configured, see CW20 Setup.

Architecture

┌─────────────────────────────────────────────────────────┐
│                    bwickchain                            │
├─────────────────────────────────────────────────────────┤
│                                                         │
│   ┌─────────────────────────────────────────────────┐  │
│   │              x/wasm Module                       │  │
│   │                                                  │  │
│   │   ┌───────────┐  ┌───────────┐  ┌───────────┐   │  │
│   │   │  CW20     │  │  CW20     │  │  CW20     │   │  │
│   │   │  Token A  │  │  Token B  │  │  Token C  │   │  │
│   │   │ (MTK)     │  │ (USDC)    │  │ (TEST)    │   │  │
│   │   └───────────┘  └───────────┘  └───────────┘   │  │
│   │        │              │              │          │  │
│   │        └──────────────┼──────────────┘          │  │
│   │                       │                         │  │
│   │              CW20 Base Contract                 │  │
│   │                  (Code ID: 1)                   │  │
│   │                                                  │  │
│   └─────────────────────────────────────────────────┘  │
│                                                         │
└─────────────────────────────────────────────────────────┘
Each token is an instance of the CW20 base contract with unique:
  • Contract address
  • Name and symbol
  • Balances
  • Minter configuration

Use Cases

Governance Tokens

Create tokens for DAO voting and governance

Stablecoins

Issue wrapped stablecoins on bwickchain

Reward Tokens

Distribute rewards to users

Utility Tokens

Power in-app economies

Next Steps

Create Token

Deploy your first CW20 token

Mint Tokens

Mint additional supply

Transfer

Send tokens to others

Query

Check balances and info