XION
DiscordGithub
  • Welcome to XION
  • XION'S Core
    • Concepts
      • Generalized Chain Abstraction
      • Intro to Account Abstraction
      • XION's Meta Accounts
      • Meta Accounts Design
      • Architecture & Tech Glossary
      • Use Cases
  • developers
    • Xion Quick Start
      • Zero to Dapp in 5 Minutes
        • Launch a User Map Dapp on XION in 5 Minutes
        • React Native Mobile Dapp on XION in 5 Minutes
      • Set Up Local Environment
        • Setting up your Local Smart Contract Development Environment for XION
          • Setting up your XION Smart Contract Development Environment on Windows (WSL2 + Ubuntu)
        • Set Up an Integrated Development Environment (IDE)
        • Interacting with Xion Chain using Xion Daemon
      • Your First Contract
        • Deploying Your First Smart Contract on XION
      • Gasless UX & Permission Grants
        • Enabling Gasless Transactions with Treasury Contracts
      • Your First DApp
        • Account Abstraction with Gasless Transactions
        • Interact with XION via your Backend Service
    • Mobile dapp Development on XION
      • Set up your XION Mobile Development Environment
      • Create Mobile Dapp and Integrate Meta Account Authentication
    • Re-using Existing Contracts
      • Deployed Contracts on XION
      • Non-Fungible Tokens (NFTs)
      • Fungible Tokens
      • Marketplace
      • Multisig
    • Web3 for Web2 Developers
      • Web2 vs Web3 App Architecture: A Comparison
      • Misconceptions and Misapplied Web2 Patterns
      • Recommended Architecture for Dapps on XION
    • Building for Mainnet
      • Xion Testnet: Your Development Playground
      • Building with Audited & Battle-Tested Contracts
      • Community Engagement: Building Support for Your dApp
      • Deploying to Xion Mainnet
        • Smart Contract Audits: Process, Costs & Support
        • Governance Process to Deploying Smart Contracts to Mainnet
    • Learn & Build
      • Token Factory
        • Creating, Minting, and Interacting with a Token Factory Token
        • Building a React dApp to Interact with Token Factory Tokens
        • Integrating a Token Factory Token in a Smart Contract
      • Websockets
        • WebSockets with Xion: Real-Time Communication
      • Mobile Development
        • Building a React Native Mobile App with Abstraxion (Xion.js)
      • Oracles
        • Creating a Smart Contract with Pyth Oracle Integration
      • Indexers: Optimized Data Retrieval
        • SubQuery
      • Use Cases
        • Building a Per-User Data Storage Dapp
    • Reference and Resources
      • Requesting XION Testnet Tokens
      • Public Endpoints & Resources
      • Block Explorers
      • Governance
        • Deploying Smart Contracts to Mainnet
      • Developer Tools: Abstract
      • IBC Denoms on XION Networks
      • Frequently Asked Questions
      • XION Token Contract Addresses on EVM Chains
  • Nodes & Validators
    • Run a Node
      • System Specifications
      • Build the Xion Daemon
      • Download the Xion Daemon
      • Configure the Xion Daemon
        • app.toml
        • client.toml
        • config.toml
      • Join the XION Network
        • xion-testnet-1
      • Confirm node is running
    • Become a Validator
      • Initial Setup
      • Obtain a XION Wallet Address
      • Obtain Funds
        • Testnet
      • Create Validator
    • IBC Relayers and Tokens
  • Others
    • Resources
Powered by GitBook
On this page
  • When to use CW20 Contracts vs Token Factory
  • Available CW20 Contract Variants

Was this helpful?

Edit on GitHub
  1. developers
  2. Re-using Existing Contracts

Fungible Tokens

PreviousNon-Fungible Tokens (NFTs)NextMarketplace

Last updated 2 hours ago

Was this helpful?

The CW20 standard defines a fungible token interface for smart contracts in the CosmWasm ecosystem, similar to Ethereum’s ERC-20. On XION, you can deploy your own CW20 contracts or use the built-in to create native tokens without writing custom logic.

This guide explains when and how to deploy CW20 token contracts using production-ready implementations from the and repositories.

Reusing these contracts without modification may reduce or eliminate the need for a security audit before deploying to XION Mainnet.

When to use CW20 Contracts vs Token Factory

Use Case
Use CW20 Contract
Use Token Factory

Need custom logic (e.g., bonding, vesting)

Yes

No

Just need a simple native token

No

Yes

Allows for transferring tokens across chain via IBC

No (Requires cw20-ics20 contract)

Yes

If you're just minting a governance or utility token with no special rules, use Token Factory. If you need full control and customization, go with CW20 contracts. See the following for more details.

Available CW20 Contract Variants

1. cw20-base

Standard CW20 implementation with all basic functionality.

Features:

  • Minting and burning

  • Transfer and allowance logic

  • Query total supply, balances

📦 Repo:

Ideal for:

  • Standalone utility tokens

  • Basic reward and governance tokens

2. cw20-ics20

Wraps a CW20 token to be compatible with IBC (Interchain Standard 20).

Features:

  • Builds on cw20-base

  • Adds IBC packet handling for token transfers across Cosmos chains

Ideal for:

  • Interchain assets

  • Dapps that rely on token bridging

3. cw20-bonding

CW20 token with bonding curve logic for dynamic token pricing.

Features:

  • Automatic pricing based on supply

  • Mint/burn tokens via bonding curve

  • Customizable curve function

Ideal for:

  • Fundraising dapps

  • Creator economy tokens

  • Algorithmic supply control

4. cw20-atomic-swap

Implements atomic swaps between native and CW20 tokens in a trust-minimized way. Features:

  • Supports atomic swaps between native tokens and CW20 tokens

  • Time-locked contracts ensure either party can claim or refund

  • Hash-based secret verification (HTLC-style)

5. cw20-staking

Provides staking derivatives by staking native tokens and issuing CW20 representations. Features:

  • Stakes native tokens on behalf of the user

  • Issues CW20 tokens as liquid staking derivatives

  • Integrates with the staking module for rewards

  • Based on cw20-base

6. cw20-escrow

A simple escrow contract compatible with both native and CW20 tokens. Features:

  • Funds are held until an arbiter approves release or refund

  • Supports multiple token types (CW20 and native)

  • Basic access control for disbursement

7. cw20-merkle-airdrop

Efficient CW20 token airdrop mechanism using Merkle proofs. Features:

  • Airdrop claim eligibility via Merkle root verification

  • Reduces gas cost for mass distribution

  • Claim tracking to prevent double claims

📦 Repo:

📦 Repo:

Ideal for: Cross-party token swaps without intermediaries, simple DEX-like functionality 📦 Repo:

Ideal for: Liquid staking solutions, DeFi integrations, enabling composability of staked assets 📦 Repo:

Ideal for: Trust-minimized payments, freelance work, over-the-counter trades 📦 Repo:

Ideal for: Token launches, community rewards, incentivized campaigns 📦 Repo:

Token Factory module
cw-plus
cw-tokens
Token Factory guide
cw20-base
cw20-ics20
cw20-bonding
cw20-atomic-swap
cw20-staking
cw20-escrow
cw20-merkle-airdrop