Module
Token Factory
The base layer of CenterChain. Any account creates and administers its own bank-native denom, decides who may hold or receive it, and authorizes a swap between two denoms.
On-chain name: tokenfactory · Consensus version 2
What the module owns
- A denom is
factory/{creator}/{subdenom}, and the creating account becomes its first admin. Creating a denom writes bank denom metadata, aDenomAuthorityMetadatarecord and a creator-to-denom index entry. - The denom creation fee is
10000000ucenby default and is burned unless community-pool funding is enabled. The create path also consumes2000000extra gas. factory/liquidity/pool/{pool_id}is a reserved namespace. A genesis file may contain such a denom only when the liquidity module account administers it and it matches a registered pool id, which is what stops an account from minting a counterfeit LP share.- Caps: subdenom 44 bytes, creator segment 75 bytes, 100,000 denoms and 100,000 blacklisted addresses across the chain.
Key features
Denom administration
The denom admin (creator or delegate) controls minting, burning, restriction, delegates, and blacklist for their denom.
Compliance restrictions
Blacklist and restricted-denom rules enforced in CanSendTokens -- the single decision point for all sends.
Two-phase swap authorization
A swap is an authorization (grant) plus a settlement. The holder grants a limit; the counter-party settles within it.
NFT transfer policy
Token factory owns the NFT transfer policy, so NFT sends also pass throughCanSendTokens.
Messages
- MsgCreateDenom -- Create a new denom under
factory/{creator}/{subdenom}. - MsgMint -- Mint tokens of an existing denom (admin only).
- MsgBurn -- Burn tokens from the sender's account.
- MsgChangeAdmin -- Transfer denom administration to another account.
- MsgSetDenomMetadata -- Update bank denom metadata.
- MsgAddToBlacklist / MsgRemoveFromBlacklist -- Manage the denom's blacklist.
- MsgSetDenomRestriction / MsgRemoveDenomRestriction -- Set or remove the restricted-denom rule (who may hold/receive).
- MsgSetSendEnabled -- Toggle send enabled for the denom.
- MsgAuthorizeSwap / MsgRevokeSwap / MsgSettleSwap -- The three steps of the two-phase swap.
- MsgAddDelegate / MsgRemoveDelegate -- Delegate admin actions to another account.
Queries
- Denom / Denoms -- Fetch a single denom or paginated list of denoms by creator.
- DenomMetadata / DenomsMetadata -- Fetch bank denom metadata.
- DenomAuthorityMetadata -- Fetch the admin and restriction metadata.
- Blacklist / Blacklists -- Fetch blacklisted addresses for a denom.
- DenomRestriction -- Fetch the restricted-denom rule.
- Params -- Module parameters (creation fee, caps, etc.).
- SwapAuthorization / SwapAuthorizations -- Fetch active swap authorizations.
Caps and limits
- Subdenom length: ≤ 44 bytes
- Creator segment length: ≤ 75 bytes
- Total denoms: ≤ 100,000
- Total blacklisted addresses: ≤ 100,000
- Creation fee: 10,000,000 ucen (default)
- Extra gas for creation: 2,000,000
Integration guide
The shortest path for each job:
Create and administer your own token
Swap two denoms under a user-granted limit
Where the rules live
The token factory is the base layer. Every other CenterChain module creates or administers a denom through it. It also gates sends: the blacklist and the restricted-denom rule are enforced in one place.