Tutorial — Enterprise & RWA
Build a compliance token
Regulated assets need allowlists, transfer hooks, and KYC tiers wired into the token itself. Tenzro's token factory ties balance changes to TDIP identity claims so eligibility is enforced at transfer time.
- Level
- Advanced
- Time
- ~25 min
- Prerequisites
- Issuer identity with KYC tier 3
- Stack
- TypeScript · Solidity
01
Deploy the controlled token
Use the token factory and set the required minimum KYC tier for holders.
const token = await tz.call("create_token", {
name: "Acme Reg-D", symbol: "ARD",
decimals: 6, total_supply: "1000000",
controls: { min_kyc_tier: 2, allowlist_only: true }
});02
Wire the allowlist
Each holder must have a TDIP DID with the required KYC credential issued.
await tz.call("compliance_add_holder", {
token: token.address, did: "did:tenzro:human:..."
});03
Issue with credential check
Mint reverts if the recipient DID does not carry the required credential.
await tz.call("token_mint", {
token: token.address, to: holder, amount: "1000"
});04
Freeze and unfreeze
The issuer can freeze a balance if a sanctions hit triggers; unfreeze when cleared.
await tz.call("compliance_freeze", { token: token.address, holder });
await tz.call("compliance_unfreeze", { token: token.address, holder });Related