Skip to main content
Version: 1.0.0

Token Factory

The Token Factory module allows any account or smart contract to create new tokens in a permissionless manner, following the format:

coin.{creator_address}.{subdenom}

Tokens are namespaced by the creator's address, ensuring unique denominations without collisions.

This guarantees that:

  • Each user can create one token per subdenom directly via RPC or contract interface.
  • Each CosmWasm factory contract can create unique tokens.

Upon creation, the creator is granted both bank admin and metadata admin privileges over the token, providing full control over its behavior and metadata.

Token Fields

Token fields are divided into:

  • creation fields and
  • metadata fields.

Creation Fields

The following fields are required when creating a token:

  • subdenom: A unique identifier for the token.
  • maxSupply: The maximum supply of the token.
  • canChangeMaxSupply: A boolean indicating whether the max supply can be changed.
  • URI: (optional) A URI pointing to an on-chain or off-chain document containing additional information.
  • URIHash: (optional) A SHA-256 hash of the document referenced by URI, used to verify its integrity.

The URI and URIHash fields are part of the token metadata. The URI can be stored on IPFS or any other decentralized storage system. The URIHash ensures data integrity by verifying that the document has not been altered.

A valid URIHash is a 64-character hexadecimal SHA-256 hash (256 bits = 64 hex chars) matching the following regex:

^[a-fA-F0-9]{64}$

To generate a URIHash, you can use the following command:

echo -n "your_uri_here" | sha256sum

Output example:

97640e51184852e33837056c9cb7e8ba24d93ab73f48e13058b2c460153a5d49

or with Python

import hashlib
print(hashlib.sha256("Your string here".encode()).hexdigest())

Metadata Fields

Metadata fields define additional properties of the token:

  • Description: A textual description of the token.
  • Symbol: The token's symbol (cannot be blank).
  • Name: The token's name (cannot be blank).
  • Display: The token's display name.
  • URI: (optional) A URI pointing to an on-chain or off-chain document containing additional information.
  • URIHash: (optional) A SHA-256 hash of the document referenced by URI, used to verify its integrity.
  • DenomUnits: A list of DenomUnits objects.
  • Base: The base denom (should be the DenomUnit with exponent = 0).

Each DenomUnit consists of:

  • Denom: The denomination name.
  • Exponent: The exponent of the denomination.
  • Aliases: Alternative names (aliases) for the denomination.

Example of Metadata:

{
"description": "Panda Token",
"denom_units": [
{
"denom": "coin.zig1pvm4lt2xct387nhxynedz0zll9uw0gyh4mftlw.panda",
"exponent": 0,
"aliases": ["micropanda"]
},
{
"denom": "mpanda",
"exponent": 3,
"aliases": ["millipanda"]
},
{
"denom": "panda",
"exponent": 6,
"aliases": ["panda"]
}
],
"base": "coin.zig1pvm4lt2xct387nhxynedz0zll9uw0gyh4mftlw.panda",
"display": "panda",
"name": "panda",
"symbol": "coin.zig1pvm4lt2xct387nhxynedz0zll9uw0gyh4mftlw.panda",
"uri": "ipfs:/.panda_uri",
"uri_hash": "e777ff33ce858284a4125294fe590529d0d3fd9571a9b0bffc25b39019533e38"
}

For more details on Coin Metadata and DenomUnits, refer to Cosmos ADR-024.

Admin Privileges

The factory module provides two levels of admin control:

  • bank admin and
  • metadata admin.

Bank Admins can:

  • Mint tokens to any account
  • Manage the token's maximum supply
  • Modify token metadata
  • Change bank admin and metadata admin

Meta Admins can:

  • Modify token metadata
  • Transfer metadata admin privileges.

The token creator can update admin roles using MsgUpdateDenomAuth or MsgUpdateDenomMetadataAuth. Setting the admin to "" makes the token immutable (locks the token forever).

Denom and Subdenom Naming

Tokens follow the format: coin.{creator_address}.{subdenom}.

Subdenom requirements

  • Must be between 3 and 44 lowercase alphanumeric characters.
  • Must start with a lowercase letter.

Denoms are limited to 128 characters long.

Denom Length Constraints

The total length of a token name is limited to 128 bytes due to SDK constraints.

Breakdown of length allocation:

  • Fixed prefix coin: 4 bytes.
  • Two . delimiters: 2 bytes.
  • Creator address: Up to len(bech32(longest_addr_length, chain_addr_prefix)).
  • Subdenom: Remaining bytes within the limit.

The longest possible address is 32 bytes. Due to SDK error correction settings, the length of the Bech32-encoded address follows: len(bech32(32, chain_addr_prefix)) = len(chain_addr_prefix) + 1 + 58.

This gives the following length constraint: 128 = 7 + 2 + len(longest_subdenom) + len(longest_chain_addr_prefix) + 1 + 58. Therefore len(longest_subdenom) + len(longest_chain_addr_prefix) = 128 - (7 + 2 + 1 + 58) = 60.

Since there’s no strict rule on how to split these 60 bytes, we adopt the following limits:

  • Maximum length of longest_subdenom is 44 bytes.
  • Maximum length of longest_chain_addr_prefix is 16 bytes.

Rationale for these limits:

  • Bech32 encoding constraints: The longest possible human-readable part (HRP) for a 32-byte address ('data field') is 31 bytes (Comes from encode(data) = 59 bytes, and max length = 90 bytes) per BIP-0173.
  • Subdenom length: Must be at least 32 bytes to accommodate hashed identifiers.
  • Readability: Longer subdenoms improve human comprehension of denoms.
  • Chain addresses: Should prefer being smaller. The longest HRP in the cosmos to date is 11 byte (e.g., persistence).
  • Consistency: These values align with denom length practices in other Cosmos chains.

Important notes:

  • If the SDK increases the 128-byte limit, these values should be adjusted accordingly.
  • Avoid hardcoding these max lengths in code, as they may change in future SDK versions.

Messages

The factory module provides the following messages:

Message NamePurposeWho Can CallState Changes
CreateDenomCreate a new tokenAny Account/Smart ContractAdds new denom
MintAndSendTokensMint tokens and send to accountBank AdminUpdates supply
BurnTokensBurn tokens from admin accountAny token holderUpdates supply
SetDenomMetadataUpdate token metadataBank/Metadata AdminUpdates metadata
UpdateDenomURIUpdate metadata URI and hashBank/Metadata AdminUpdates metadata
UpdateDenomMaxSupplyUpdate max. supplyBank AdminUpdates max. supply
UpdateDenomAuthUpdate bank/metadata adminsBank AdminUpdates auth
UpdateDenomMetadataAuthUpdate metadata adminsBank/Metadata AdminUpdates auth
WithdrawModuleFeesWithdraw module feesBeneficiaryUpdates balances
UpdateParamsUpdate module parametersGovernanceChanges global settings

CreateDenom

The CreateDenom message is used to create a new token with a specified subdenom and additional metadata fields. The resulting token follows the format:coin.{creator_address}.{subdenom}

Any smart contract or account can create a new token. The creator automatically becomes the admin, with full control over the token's supply and metadata.

// MsgCreateDenom used to create new denom via factory
message MsgCreateDenom {
option (cosmos.msg.v1.signer) = "creator";
string creator = 1;
string subDenom = 2;
string maxSupply = 3 [
(cosmos_proto.scalar) = "cosmos.Uint",
(gogoproto.customtype) = "cosmossdk.io/math.Uint",
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
bool canChangeMaxSupply = 4;

// metadata
string URI = 5;

// sha256 hash of the JSON metadata file
string URIHash = 6;
string description = 7;
}

State modifications:

When processing the CreateDenom message, the following state modifications occur:

Verifications:

  1. Check for reserved subdenoms
    • Ensure that the provided subdenom is not reserved (e.g., uzig or other restricted names).
  2. Check for existing denomination
    • Verify that the denomination coin.{creator_address}.{subdenom} does not already exist in the system.
  3. Ensure valid input parameters
    • Validate that the subdenom meets naming constraints (3–44 alphanumeric characters, starts with a letter).
    • Ensure maxSupply is a valid, non-negative integer.
    • If provided, validate URIHash against the expected SHA-256 format.

State updates:

  1. Apply the denomination creation fee
    • Deduct the denom creation fee from the creator’s account.
  2. Register the new token

Once the token is successfully created, the creator gains full control over its supply, metadata, and administrative permissions.

MintAndSendTokens

The MintAndSendTokens message allows the bank admin (by default, the creator) to mint a specified amount of tokens and transfer them to a recipient.

// MsgMintAndSendTokens mints tokens and sends them to a recipient
message MsgMintAndSendTokens {
option (cosmos.msg.v1.signer) = "signer";
string signer = 1;
cosmos.base.v1beta1.Coin token = 2 [(gogoproto.nullable) = false];
string recipient = 3 ;
}

State modifications:

Verifications:

  1. Check that the denom exists and was created via the factory module
    • Ensure that the specified token denom is valid and was originally created through the factory module.
  2. Verify that the sender is the current bank admin of the denom
    • Only the bank admin (by default, the token creator) is authorized to mint new tokens.
  3. Ensure that the minting amount does not exceed the max supply
    • If the denom has a max supply limit, check that the new minting action does not cause the total supply to exceed that limit.

State updates:

  1. Mint the designated amount of tokens
    • The specified amount of tokens is created.
  2. Transfer the minted tokens to the recipient's account
    • The recipient receives the minted tokens immediately.
  3. Update the total token supply
    • The total supply of the token is adjusted to reflect the newly minted amount.

BurnTokens

The BurnTokens message allows permanently removing a specified amount of tokens from circulation.

// MsgBurnTokens burns tokens from the signer's account
message MsgBurnTokens {
option (cosmos.msg.v1.signer) = "signer";
string signer = 1;
cosmos.base.v1beta1.Coin token = 2 [(gogoproto.nullable) = false];
}

State modifications:

Verifications:

  1. Check that the denom exists
  2. Ensure that the amount to burn is available in the wallet
    • Verify that the signer has at least the specified amount of tokens in their account.

State updates:

  1. Burn the specified amount of tokens
    • The designated amount is permanently removed.
  2. Update the total token supply
    • The total supply of the token is reduced to reflect the burn.

SetDenomMetadata

The SetDenomMetadata message allows the bank admin or metadata admin to update the token’s metadata, ensuring accurate and structured information about the token.

// MsgSetDenomMetadata sets the metadata of a token
message MsgSetDenomMetadata {
option (cosmos.msg.v1.signer) = "signer";
string signer = 1;
// Uncomment me for ts-client, until better solution is found
cosmos.bank.v1beta1.Metadata metadata = 2 [(gogoproto.nullable) = false];
// Metadata metadata = 2 [(gogoproto.nullable) = false];
}

State modifications:

Verifications:

  1. Check that the denom exists
    • Ensure the specified token denom is created in the system.
  2. Verify that the sender is an authorized admin
    • The sender must be either the bank admin or metadata admin of the denom.
  3. Ensure that the provided metadata is valid
    • Validate that:
      • Name and Symbol are not empty.
      • Base and Display denominations follow valid coin denomination formats.
      • Base and Display denominations exist within the DenomUnit list.
      • Base denomination has exponent = 0.
      • Denomination units are sorted in ascending order.
      • No duplicate denomination units exist.

State updates:

  1. Store the new metadata for the token
    • Update the denom’s metadata with the provided values.

UpdateDenomURI

The UpdateDenomURI message allows the bank admin or metadata admin to update the URI and URIHash of a denom without modifying the rest of its metadata.

// MsgUpdateDenomURI updates the URI of a denom and its sha256 hash
message MsgUpdateDenomURI {
option (cosmos.msg.v1.signer) = "signer";
string signer = 1;
string denom = 2;
string URI = 3;
string URIHash = 4;
}

State modifications:

Verifications:

  1. Check that the denom exists
    • Ensure that the specified denom is valid and created in the system.
  2. Verify that the denom currently has metadata
    • The denom must already have an associated metadata entry before updating.
  3. Ensure that the sender is authorized
    • Only the bank admin or metadata admin of the denom can update its metadata URI.

State updates:

  1. Update the denom’s URI and URIHash
    • Set the new URI and URIHash for the denom.
    • The rest of the metadata remains unchanged.

UpdateDenomMaxSupply

The UpdateDenomMaxSupply message allows the bank admin to update the maximum supply of a token, with the option to lock further max supply changes.

// MsgUpdateDenomMaxSupply updates the max supply and options o lock max supply changes on a denom
message MsgUpdateDenomMaxSupply {
option (cosmos.msg.v1.signer) = "signer";
string signer = 1;
string denom = 2;
string maxSupply = 3 [(cosmos_proto.scalar) = "cosmos.Uint",
(gogoproto.customtype) = "cosmossdk.io/math.Uint", (gogoproto.nullable) = false,
(amino.dont_omitempty) = true];
bool canChangeMaxSupply = 4;
}

State modifications:

Verifications:

  1. Check that the denom exists
    • Ensure that the specified denom is valid and created.
  2. Verify that the denom allows max supply changes
    • If canChangeMaxSupply was previously set to false, prevent further modifications.
  3. Ensure that the new max supply is greater than the current total supply
    • Prevent setting a max supply lower than the currently circulating amount.

State updates:

  1. Set the new max supply for the denom
    • Update the token’s maxSupply value.
  2. Update the canChangeMaxSupply flag
    • If canChangeMaxSupply is set to false, future updates to max supply will be disabled.

UpdateDenomAuth

The UpdateDenomAuth message allows the current bank admin to reassign admin privileges for a specific denom, modifying both the bank admin and metadata admin roles.

// MsgUpdateDenomAuth updates the admins address: bank, and metadata of a denom
message MsgUpdateDenomAuth {
option (cosmos.msg.v1.signer) = "signer";
string signer = 1;
string denom = 2;
string bankAdmin = 3;
string metadataAdmin = 4;
}

State modifications:

Verifications:

  1. Check that the denom exists
    • Ensure that the specified denom is valid and created.
  2. Verify that the sender is the current bank admin
    • Only the current bank admin has permission to change admin roles.

State updates:

  1. Assign the new bank admin
    • Transfer bank-level control to the new admin.
  2. Assign the new metadata admin
    • Transfer metadata control to the new admin.

UpdateDenomMetadataAuth

The UpdateDenomMetadataAuth message allows either the bank admin or the current metadata admin to transfer metadata control to a new metadata admin.

// MsgUpdateDenomMetadataAuth updates the metadata admin of a denom, needed for case when bank admin is disabled
message MsgUpdateDenomMetadataAuth {
option (cosmos.msg.v1.signer) = "signer";
string signer = 1;
string denom = 2;
string metadataAdmin = 3;
}

State modifications:

Verifications:

  1. Check that the denom exists
    • Ensure the specified denom is valid and created in the system.
  2. Verify that the sender is an authorized admin
    • The sender must be either the current bank admin or metadata admin.

State updates:

  1. Assign the new metadata admin
    • Transfer metadata control to the new metadata admin.
  2. Preserve the bank admin role
    • The current bank admin remains unchanged.

WithdrawModuleFees

The WithdrawModuleFees message allows the beneficiary to withdraw accumulated module fees and transfer them to a specified recipient.

message MsgWithdrawModuleFees {
option (cosmos.msg.v1.signer) = "signer";
string signer = 1;
string receiver = 2;
}

State modifications:

Verifications:

  1. Check that the sender is the authorized admin
    • Ensure that the signer is permitted to withdraw module fees.
  2. Check that there are available module fees
    • Ensure that the module has sufficient fees available for withdrawal.

State updates:

  1. Deduct the withdrawn fees from the module’s fee balance
    • The requested amount is removed from the module’s accumulated fees.
  2. Transfer the fees to the specified receiver
    • The recipient’s balance is credited with the withdrawn amount.

UpdateParams

The UpdateParams message allows governance to update the module parameters, ensuring that configuration changes can be applied through a formal governance process.

// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "zigchain/x/coin.MsgUpdateParams";

// authority is the address that controls the module (defaults to x/gov unless overwritten).
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// params defines the module parameters to update.

// NOTE: All parameters must be supplied.
Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

ZIGChain CLI Commands and Examples

⚠️ Important Signing Requirement

Any POST transaction must be signed on-chain.
This means it can only be executed using the CLI, Cosmos Kit, or any tool that allows blockchain signing (e.g., frontend apps connected to a wallet).
It cannot be performed using Swagger UI or curl, as these do not support signing and broadcasting transactions.

Below are examples of how to interact with the factory module using ZIGChain's CLI.

General notes:

  • Use --help with any command to see available flags, short commands, and additional information.

Create a New Token

To create a new token, use the create-denom command.

Usage:

zigchaind tx factory create-denom [sub-denom] [max-supply] [can-change-max-supply] [uri] [uri-hash] [flags]

Example:

zigchaind tx factory create-denom panda 1000000000 true \
'https://ipfs.io/ipfs/QmYourExampleCIDHere' \
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890' \
--from zuser1 --chain-id zigchain \
--gas-prices 0.00025uzig --gas auto --gas-adjustment 1.3

This will create a new denom with the following details:

  • Token named panda
  • Max supply set to 1000000000
  • Admin can modify max supply
  • Metadata URI https://ipfs.io/ipfs/QmYourExampleCIDHere
  • URIHash abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890

Output example:

create_denom

Verify Transaction and Query Denom Information

After executing a transaction, you can verify its result and check if the newly created denom is registered.

  1. Check a transaction result

Use the transaction hash (txhash) returned from the request to verify the transaction status:

Example:

TXHASH=39CDF678827A6E4A69A18C411CC7E157AD408BE8236302AF0869A4885F54DD10
zigchaind q tx $TXHASH
  1. List all denoms

To confirm that your new denom has been created, query the list of all registered denoms:

zigchaind q factory list-denom

Output example:

list_denom

Get your Denom Information

To retrieve detailed information about a specific token, use the show-denom command.

Note --> Use the full token factory address format: coin.{creator_address}.{subdenom}.

Usage:

zigchaind query factory show-denom [denom] [flags]

Example:

zigchaind query factory show-denom coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

show_denom.png

Mint and Send Token

After creating a token, the bank admin can mint new tokens and transfer them to a recipient address using the mint-and-send-tokens command.

Note --> Use the full token factory address format: coin.{creator_address}.{subdenom}.

Usage:

zigchaind tx factory mint-and-send-tokens [amount-token] [recipient-address] [flags]

Example:

zigchaind tx factory mint-and-send-tokens 1000coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda \
zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2 \
--from zuser1 --chain-id zigchain \
--gas-prices 0.25uzig --gas auto --gas-adjustment 1.3

This will:

  • Mint 1000 tokens of denom panda
  • Send minted tokens to the specified recipient address (e.g.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2).
  • Requires admin privileges — only bank admin can mint tokens.

Output example:

mint_tokens.png

Verify Minted Tokens

After minting tokens, check the denom to confirm the supply increased.

Example:

zigchaind query factory show-denom coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

show_denom

Burn Token

The burn-tokens command allows a token holder to permanently remove tokens from circulation.

Note --> Use the full token factory address format: coin.{creator_address}.{subdenom}.

Usage:

zigchaind tx factory burn-tokens [amount-denom] [flags]

Example:

zigchaind tx factory burn-tokens 200coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda \
--from zuser1 --chain-id zigchain \
--gas-prices 0.25uzig --gas auto --gas-adjustment 1.5

This will:

  • Burn 200 tokens of denom panda.
  • Permanently remove them from circulation.

Output example:

burn_tokens_tx.

Verify Burned Tokens

After burning tokens, check the denom’s updated supply to confirm the reduction.

Example:

zigchaind query factory show-denom coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

show_denom

Get the Denoms List of an Admin

The denoms-by-admin command retrieves the list of denoms originally created by a specific creator address (not the current bank or meta admin).

Usage:

zigchaind query factory denoms-by-admin [admin] [flags]

Example:

zigchaind query factory denoms-by-admin zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2

Output example:

denoms_by_admin

Set Denom Metadata

The set-denom-metadata command allows the bank admin or metadata admin to update a token’s metadata.

Usage:

zigchaind tx factory set-denom-metadata [metadata] [flags]

Example:

zigchaind tx factory set-denom-metadata \
'{
"description": "Panda is a sample token designed for demonstration purposes on the ZIGChain.",
"denom_units": [
{
"denom": "coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda",
"exponent": 0
},
{
"denom": "mpanda",
"exponent": 3
}
],
"base": "coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda",
"display": "mpanda",
"name": "panda",
"symbol": "coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda",
"uri": "ipfs://new_panda_uri_6",
"uri_hash": "8fd2e4e4ecf24e086aa0d03042005e5fc2a36e0bbea10bf502dd8f18cc22473c"
}' \
--from zuser1 --chain-id zigchain \
--gas-prices 0.25uzig --gas auto --gas-adjustment 1.5

Output example:

set_denom_meta

Verify Metadata Update

After setting the metadata, check if the changes were applied.

Example:

zigchaind query bank denom-metadata coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

denom_meta

Update Denom URI and URI Hash

The update-denom-uri command allows the bank admin or metadata admin to update a token’s metadata URI and its corresponding SHA-256 hash, while keeping all other metadata unchanged.

Note --> Use the full token factory address format: coin.{creator_address}.{subdenom}.

Usage:

zigchaind tx factory update-denom-uri [denom] [uri] [uri-hash] [flags]

Example:

zigchaind tx factory update-denom-uri coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda \
'ipfs://bafybeieexamplepandametadata_newuri' \
'2f76f5b8e4d3a2e6f97c247f2d76836964dec629a898852e28cdbf69d9819bbe' \
--from zuser1 --chain-id zigchain \
--gas-prices 0.25uzig --gas auto --gas-adjustment 1.5

Output example:

update_uri

Verify URI Update

After updating, confirm that the metadata changes have been applied.

Example:

zigchaind query bank denom-metadata coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

denom_meta

Update Denom Max Supply

The update-denom-max-supply command allows the bank admin to increase the maximum supply of a token. It also provides the option to permanently lock future max supply changes by setting can-change-max-supply to false.

Note --> Use the full token factory address format: coin.{creator_address}.{subdenom}.

Usage:

zigchaind tx factory update-denom-max-supply [denom] [max-supply] [can-change-max-supply] [flags]

Example:

zigchaind tx factory update-denom-max-supply coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda \
2000000000 true \
--from zuser1 --chain-id zigchain \
--gas-prices 0.25uzig --gas auto --gas-adjustment 1.5

Output example:

update_max_supply

Verify Max Supply Update

After updating, confirm the new max supply by checking the denom data.

Example:

zigchaind query factory show-denom coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

show_denom

Get the Denom Admins

The denom-auth command allows you to retrieve the bank admin and metadata admin for a specific token. This helps in identifying who has control over the denom’s minting, burning, and metadata updates.

Note --> Use the full token factory address format: coin.{creator_address}.{subdenom}.

Usage:

zigchaind query factory denom-auth [denom] [flags]

Example:

zigchaind query factory denom-auth coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

denom_auth

Update Denom Auth (Bank Admin and Metadata Admin)

The update-denom-auth command allows the current bank admin to reassign both bank admin and metadata admin roles for a denom.

Note --> Use the full token factory address format: coin.{creator_address}.{subdenom}.

Usage:

zigchaind tx factory update-denom-auth [denom] [bank-admin-address] [metadata-admin-address] [flags]

Example:

zigchaind tx factory update-denom-auth coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda \
zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2 zig1sm4a7yjls3mpz492ge08ych34yvyxurchg4fkf \
--from zuser1 --chain-id zigchain \
--gas-prices 0.25uzig --gas auto --gas-adjustment 1.5

Output example:

update_denom_auth

Verify Admin Update

After updating, check if the new admin roles have been assigned.

Example:

zigchaind query factory denom-auth coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

denom_auth

Note: In the following example, the bank admin has been set back to the creator address.

Update Denom Metadata Auth

The update-denom-metadata-auth command allows the current bank admin or metadata admin to reassign the metadata admin for a specific denom.

Note --> Use the full token factory address format: coin.{creator_address}.{subdenom}.

Usage:

zigchaind tx factory update-denom-metadata-auth [denom] [metadata-admin] [flags]

Example:

zigchaind tx factory update-denom-metadata-auth coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda \
zig166dqkxnvsj82vfv2m96h65ed4aysavj5kj8nhy \
--from zuser1 --chain-id zigchain \
--gas-prices 0.25uzig --gas auto --gas-adjustment 1.5

Output example:

update_meta_auth

Verify Metadata Admin Update

After updating, check if the new metadata admin has been assigned.

Example:

zigchaind query factory denom-auth coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda

Output example:

denom_auth

Get the List of All Denoms Created

The list-denom command retrieves all denoms that have been created in the factory module.

The response includes the following:

{
"creator": "zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2",
"denom": "coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda",
"maxSupply": "2000000000",
"totalMinted": "1000",
"canChangeMaxSupply": true,
"totalBurned": "200",
"totalSupply": "800"
}

Example:

zigchaind query factory list-denom

Output example:

list_denom

Get the list of all Denoms Authorities

The list-denom-auth command retrieves all denoms along with their admin roles.

The response includes the following:

{
"denom": "coin.zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2.panda",
"bankAdmin": "zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2",
"metadataAdmin": "zig166dqkxnvsj82vfv2m96h65ed4aysavj5kj8nhy"
}

Example:

zigchaind query factory list-denom-auth

Output example:

list_denom_auth

Withdraw Module Fees

The withdraw-module-fees command allows the beneficiary (if set in params) to withdraw accumulated module fees and transfer them to a specified recipient.

Usage:

zigchaind tx factory withdraw-module-fees [receiver] [flags]

Example:

zigchaind tx factory withdraw-module-fees zig1fycdqgg5v8wkkl0fc5y8qjlf6wsk4x9jhrvxh2 \
--from zuser1 --chain-id zigchain \
--gas-prices 0.25uzig --gas auto --gas-adjustment 1.5

Get the Factory Params

The params command retrieves the current parameters settings of the factory module.

Example:

zigchaind query factory params

Output example:

params

Note --> Factory parameters can only be updated through governance. To modify these parameters, a governance proposal must be submitted and approved. Check the Governance Article for more details.