Skip to main content

Security Tokens (T-REX)

Deploy regulated security tokens using the T-REX (ERC-3643) standard with on-chain identity verification and modular compliance.

Overview

T-REX tokens enforce compliance at the smart contract level:

  1. Identity Registry — every investor must have a verified on-chain identity
  2. Compliance Modules — rules that govern transfers (country restrictions, max balance, supply limits)
  3. Trusted Issuers — authorized entities that issue identity claims
  4. Claim Topics — required claim types for investor verification

1. Deploy a T-REX Token

const token = await urblock.tokens.create({
name: "Real Estate Fund",
symbol: "REF",
standard: "ERC3643",
network: "polygon_amoy",
initial_supply: "0",
required_claim_topics: [1, 7],
idempotency_key: "trex-deploy-001",
});

2. Set Up Claim Topics

Define which claims investors need:

// KYC claim (topic 1)
await urblock.claimTopics.create({
topic: 1,
description: "KYC verification",
network: "polygon_amoy",
idempotency_key: "topic-kyc-001",
});

// Accredited investor claim (topic 7)
await urblock.claimTopics.create({
topic: 7,
description: "Accredited investor",
network: "polygon_amoy",
idempotency_key: "topic-accredited-001",
});

3. Register Trusted Issuers

Authorize entities to issue claims:

await urblock.trustedIssuers.create({
address: "0xKYCProvider...",
claim_topics: [1, 7],
network: "polygon_amoy",
idempotency_key: "issuer-001",
});

4. Register Investor Identities

const identity = await urblock.identities.create({
address: "0xInvestor...",
identity_address: "0xOnchainId...",
country: 840, // USA (ISO 3166-1 numeric)
network: "polygon_amoy",
idempotency_key: "identity-001",
});

Add Claims to Identity

await urblock.identities.addClaim(identity.id, {
topic: 1,
issuer: "0xKYCProvider...",
data: "0x...", // signed claim data
idempotency_key: "claim-kyc-001",
});

5. Deploy Compliance Modules

// Country restrictions
const module = await urblock.compliance.createModule({
name: "CountryRestrictions",
network: "polygon_amoy",
rules: [
{ type: "country_restrict", countries: [408], allowed: false },
],
idempotency_key: "compliance-001",
});

// Add another country restriction
await urblock.compliance.addRule(module.id, {
type: "country_restrict",
countries: [364], // Iran
allowed: false,
idempotency_key: "rule-001",
});

6. Mint to Verified Investors

Only verified investors (with valid on-chain identity + claims) can receive T-REX tokens:

const tx = await urblock.transactions.mint(token.id, {
to: "0xInvestor...",
amount: "1000000000000000000000", // 1000 tokens
idempotency_key: "trex-mint-001",
});

7. Compliance Operations

Check Compliance Before Transfer

const check = await urblock.compliance.checkCompliance(token.id, {
from: "0xSender...",
to: "0xRecipient...",
amount: "100000000000000000",
});
console.log(check.compliant); // true or false

Freeze an Address

await urblock.trex.freeze(token.id, {
address: "0xSuspicious...",
idempotency_key: "freeze-001",
});

Freeze Partial Amount

await urblock.trex.freezePartial(token.id, {
address: "0xInvestor...",
amount: "500000000000000000",
idempotency_key: "freeze-partial-001",
});

Force Transfer (Recovery/Legal)

await urblock.trex.forceTransfer(token.id, {
from: "0xOldAddress...",
to: "0xNewAddress...",
amount: "1000000000000000000",
idempotency_key: "force-001",
});

Wallet Recovery

await urblock.trex.recover(token.id, {
lost_address: "0xLostWallet...",
new_address: "0xNewWallet...",
idempotency_key: "recover-001",
});

Available Compliance Module Types

ModuleDescription
CountryRestrictionsBlock transfers to/from specific countries
MaxBalanceLimit maximum token balance per holder
SupplyLimitCap total token supply
TimeTransfersLimitsLimit transfer volume per time period

Next Steps