CreateTokenClass, mint supply with MintToken, transfer with TransferToken, and burn with BurnToken. The executor enforces the supply policy on every state transition.
When to use this
- Issue a stablecoin, points balance, or revenue-share unit.
- Mint a treasury currency for an autonomous organisation.
- Wrap an external asset for use in Sigil DEX pools.
Prerequisites
- A funded controller DID (the DID that will hold mint and policy authority).
- An RPC endpoint and the standard
SIGIL_*environment variables.
Recipe
Create the token class
CreateTokenClass defines the token’s identifier, ticker, decimals, issuer, controller, and supply policy. The token id must be globally unique.supply_policy variants live in sigil-core/src/transaction.rs: Fixed, Capped, Inflationary, and Controlled.Mint initial supply
u128 does not fit in JavaScript’s Number.Reading state
Common errors
| Symptom | Cause | Fix |
|---|---|---|
token_id already exists | The id was used in a prior block | Choose a new id — token ids are immutable |
mint exceeds max_supply | Capped policy exhausted | Burn first, or raise the cap via SetTokenPolicy |
transfer denied by policy | transfer_policy restricts transfers | Submit through the policy controller’s flow |
decimals out of range | decimals > 18 | Pick a value in [0, 18] |
See also
- Primitive: custom tokens — policy options and economics.
- Cookbook: Swap on the DEX — pair your token against another.
- Transaction reference: CreateTokenClass