Skip to main content

Create Token

Deploy a new CW20 token on XYZ Chain with the xyz token create command.

Setup

Before creating tokens, ensure the CW20 base contract is deployed.

Deploy CW20 Base Contract

Configure Code ID

Verify:

Create a Token

Required Flags

Optional Flags

Examples

Basic Token

Creates a token with no initial supply. You’ll need to mint tokens afterward.

Token with Initial Supply

Creates 1,000,000 tokens (with 6 decimals) sent to the creator.

Fixed Supply Token

Creates a token with fixed 1M supply (cap equals initial supply).

Token with Different Minter

Sets a DAO contract as the minter instead of the creator.

Dry Run

Simulate token creation without broadcasting:
Output:

Output

Successful creation returns:
Save the contract address! You’ll need it for all future operations (mint, transfer, etc.).

Track Your Token

Add the token to your configuration for balance queries:

Decimals Guide

The decimals field determines the smallest unit:
Use 6 decimals to match the native uxyz denomination.

Error Handling

The CLI provides user-friendly error messages:

Under the Hood

xyz token create executes a MsgInstantiateContract:

Next Steps

Mint Tokens

Create additional supply

Transfer Tokens

Send tokens to others