TokenFactory, the contract starts with a zero total supply and a status of DRAFT. Minting moves shares into investor wallets and, on first mint, transitions the token to ACTIVE — signalling that the asset is live and tradeable. You can also mint additional shares to an already-ACTIVE token, for example when a farmland holding expands or new investors are admitted.
Mint via the CLI
The fastest way to mint during development is the interactiveankara mint command. It reads your deployed contracts from ankara.config.json and prompts for the recipient and amount:
1
Select token
If you have multiple deployed tokens, the CLI lists them. Choose the one you want to mint from.
2
Enter recipient address
Provide the investor’s EVM address (
0x...) or Stellar public key (G...).3
Enter amount
Enter the number of tokens in whole units (e.g.
1000). The CLI converts this to wei (1000 * 10^18) before broadcasting.4
Confirm and broadcast
Review the summary and press Enter. The tx hash and (on Polygon Amoy) an explorer link are printed when the transaction confirms.
Mint via the SDK
UseAssetRegistry.mint() to call the token contract directly from TypeScript. This is the same call the CLI makes under the hood.
registry.mint() accepts any EVM address or Stellar public key for to, and a bigint for amount. The amount is always 18-decimal fixed-point, so use ethers.parseEther() for human-readable values.
The connected signer (or
stellarSecretKey) must hold the MINTER_ROLE on the token contract. If you deployed the token yourself, your address is the admin and has this role automatically.Batch minting via the CLI
To distribute tokens to many investor wallets in one step, useankara batch-mint. Provide a CSV file with one address,amount pair per line:
investors.csv:
Transfer management and permissioned transfers
By default, Ankara Chain tokens are freely transferable between any addresses. You can gate transfers so that only KYC-verified addresses can receive tokens by attaching aWhitelistVerifier contract to the token.
When a verifier is set on the token contract, any transfer to an un-verified address reverts on-chain. Set the verifier address when you deploy — pass identityVerifier in your deploy options — or update it later through AssetRegistry:
Checking balances
Via AssetRegistry
Via the useTokenBalance React hook
In a React or Next.js application, use theuseTokenBalance hook — no signer required:
Token lifecycle
Minting interacts with theAssetStatus enum that every Ankara Chain token carries on-chain:
The first
mint() call automatically transitions the token from DRAFT to ACTIVE. Subsequent mints on an already-ACTIVE token do not change its status. You can also read and update the status directly: