Token Factory
Creating native tokens using the LumiWave Token Factory module
What is Token Factory?
Token Factory is a module that allows anyone to create native Cosmos SDK tokens without writing smart contracts. Unlike CW-20 tokens which manage balances inside a smart contract, Token Factory tokens are managed directly by the chain's bank module. This means IBC transfers are natively supported, gas fees are lower, and tokens can be queried using standard commands like lumiwave-protocold query bank.
The created token's denom follows the format factory/<creator_address>/<subdenom>, and only the creator has mint and burn authority.
CW-20 vs Token Factory
Use the comparison table below when choosing how to create your token. Token Factory is suitable for simple utility tokens or when IBC transfers are needed, while CW-20 is better when complex business logic (tax rates, whitelists, etc.) is required.
| Feature | CW-20 | Token Factory |
|---|---|---|
| Storage | Smart contract | Native bank module |
| IBC Transfer | Requires additional adapter | Natively supported |
| Gas Fees | High (contract execution) | Low (native transaction) |
| Query Method | Contract query | Bank module query (query bank) |
| Custom Logic | Freely implementable | Limited (mint/burn only) |
| Denom Format | Contract address | factory/<CREATOR>/<SUBDENOM> |
Creating a Token
Token creation follows 3 steps: Create Denom → Mint → (Optional) Set Metadata. Create Denom registers the token's identifier, and Mint actually issues the tokens.
1. Create Denom
Register a new token identifier (denom). <SUBDENOM> is the token's name, composed of lowercase letters and numbers. At this stage, no tokens are issued yet — only the denom is reserved.
lumiwave-protocold tx tokenfactory create-denom <SUBDENOM> \
--from=<WALLET> \
--gas=auto \
--gas-adjustment=1.5 \
--fees=10000ulwp \
--chain-id=lumiwaveprotocolThe full denom of the created token follows the format factory/<CREATOR_ADDRESS>/<SUBDENOM>. For example, if the address is lumi1abc... and the subdenom is mytoken, the full denom becomes factory/lumi1abc.../mytoken.
2. Mint Tokens
Actually issue tokens for the registered denom. Minted tokens are deposited to the wallet that sent the transaction. There is no limit on the number of mints, and additional tokens can be issued whenever needed.
lumiwave-protocold tx tokenfactory mint \
1000000factory/<CREATOR_ADDRESS>/<SUBDENOM> \
--from=<WALLET> \
--gas=auto \
--fees=5000ulwp3. Burn Tokens
Permanently remove held tokens to reduce the total supply. Only tokens in your own wallet can be burned.
lumiwave-protocold tx tokenfactory burn \
500000factory/<CREATOR_ADDRESS>/<SUBDENOM> \
--from=<WALLET> \
--gas=auto \
--fees=5000ulwpSetting Token Metadata
Setting metadata allows tokens to be displayed nicely in wallets and explorers. --exponent is the number of decimal places — setting it to 6 means 1 MTK = 1,000,000 minimum units (same relationship as LWP and ulwp).
lumiwave-protocold tx tokenfactory modify-metadata \
factory/<CREATOR_ADDRESS>/<SUBDENOM> \
--name="My Token" \
--symbol="MTK" \
--description="A token on LumiWave" \
--display="mtk" \
--exponent=6 \
--from=<WALLET> \
--gas=auto \
--fees=5000ulwpChanging the Admin
Transfer the token's admin authority (mint/burn permissions) to a different address. This is used when the project operator changes or when delegating token management to a DAO.
lumiwave-protocold tx tokenfactory change-admin \
factory/<CREATOR_ADDRESS>/<SUBDENOM> \
<NEW_ADMIN_ADDRESS> \
--from=<WALLET> \
--gas=auto \
--fees=5000ulwpChanging the admin to an empty address will permanently prevent any further minting or burning. This can be used to permanently fix the token supply.
Queries
Token Factory tokens are managed by the native bank module, so they are queried the same way as regular tokens. Apart from the denom format being factory/..., it's identical to querying LWP.
CLI Queries
# All token balances for an address — shows both LWP and Token Factory tokens
lumiwave-protocold query bank balances <ADDRESS>
# Balance for a specific denom — specify the exact Token Factory denom
lumiwave-protocold query bank balance <ADDRESS> factory/<CREATOR>/<SUBDENOM>
# Total supply of a token — total issued amount excluding burned tokens
lumiwave-protocold query bank total --denom factory/<CREATOR>/<SUBDENOM>
# Token metadata — name, symbol, decimal places, etc.
lumiwave-protocold query bank denom-metadata --denom factory/<CREATOR>/<SUBDENOM>
# All denoms created by a creator — view all tokens created by the address
lumiwave-protocold query tokenfactory denoms-from-creator <CREATOR_ADDRESS>REST API Queries
Used when fetching token information from web frontends. Since the denom contains / characters, they must be URL-encoded as %2F.
# Balance query — includes both LWP and Token Factory tokens
curl http://localhost:1317/cosmos/bank/v1beta1/balances/<ADDRESS>
# Token supply — encode / as %2F in the denom
curl "http://localhost:1317/cosmos/bank/v1beta1/supply/by_denom?denom=factory%2F<CREATOR>%2F<SUBDENOM>"IBC Transfer
Since Token Factory tokens are managed by the native bank module, they support IBC transfers without any additional adapters, unlike CW-20. The same command used for regular LWP transfers is used when sending tokens to other Cosmos chains.
lumiwave-protocold tx ibc-transfer transfer \
transfer \
channel-0 \
<RECIPIENT_ADDRESS> \
1000000factory/<CREATOR>/<SUBDENOM> \
--from=<WALLET> \
--fees=2500ulwpIntegration with CosmWasm
By transferring Token Factory admin authority to a CosmWasm contract address, the smart contract can manage tokens programmatically. This enables various use cases:
- Automatic Mint/Burn: Contract automatically mints or burns tokens when specific conditions are met
- Conditional Minting Logic: Token issuance based on business logic such as staking rewards, airdrops, etc.
- DeFi Protocols: Issue LP tokens, governance tokens, etc. as native tokens for IBC compatibility
Related Docs
- CosmWasm — Smart contract development
- API Reference — REST/gRPC API
- IBC Cross-Chain — IBC transfers