Skip to main content
Ankara Chain’s TokenFactory class is the single entry point for deploying tokenized real-world assets on either an EVM chain or Stellar. You provide a config object — network, signer, and factory contract address — and call one of the template-specific deploy methods. The factory handles encoding your asset metadata and broadcasting the deployment transaction, returning a DeployResult with the new token address as soon as the transaction is confirmed.

Prerequisites

Install the SDK and ethers if you haven’t already:

Deploy a fungible RWA token

Construct a TokenFactory with an EVMAnkaraChainConfig. Your signer must be an ethers.js Signer that has enough native gas on the target chain.

Farmland token (full example)

Other EVM template snippets

Each template follows the same pattern — swap the method name and provide the corresponding metadata shape.

DeployResult shape

Every deployFarmland, deployCommodity, deployRealEstate, deployInvoice, deployCarbonCredit, and deployMiningRights call resolves to a DeployResult:

NFT tokens

Use the NFT deploy methods when you need a non-fungible title deed rather than fractional shares. Each returns an NFTDeployResult with nftAddress instead of tokenAddress.

Multi-token contracts

Use multi-token contracts when a single on-chain deployment needs to track many commodity batches (ERC-1155 warehouse receipts) or pool together multiple assets (a fund-style PoolVault).
Both calls return a MultiTokenDeployResult:

Reading asset metadata after deploy

After a token is deployed, use AssetRegistry to read and write its on-chain metadata. Construct it with the adapter from your TokenFactory instance and the address from DeployResult:
AssetRegistry also exposes write methods (updateValuation, setStatus, mint, pause, and template-specific actions like retire for carbon credits). See the SDK reference for the full API.

CLI quick-start

If you prefer an interactive terminal flow, the Ankara Chain CLI wraps all of the above in a guided prompt. Install it once and run:
The CLI walks you through template selection, metadata prompts, and a confirmation step, then writes the new token address and tx hash to your local ankara.config.json.