Soroban smart contracts for tokenizing real-world assets (real estate, invoices, commodities) on Stellar with built-in compliance: KYC allowlists, transfer restrictions, jurisdiction rules, administrative pausing, and proportional dividend distribution.
Real-world assets are represented as compliant tokens where only verified addresses can hold or transfer them — the transfer gate is enforced on-chain via a cross-contract call into the compliance contract.
| Contract | Purpose | Docs | Testnet |
|---|---|---|---|
| compliance | KYC allowlist + jurisdiction rules; the transfer gate | docs | CBUERYDM7DXTZLLKDBRJKUBPFJ7M4OSUN4T7XKUARU345RLXNAIQD2IU |
| asset-token | Compliant RWA token; transfers gated by compliance | docs | CBMCWLSQSWUTLUJFCNBHNBSXMUM3XU7NAQ5TSNERW4HA4ZZBYHLG4ECZ |
| registry | Index of all tokenized assets + TVL | docs | CBX5SMLTXX6JP4HA5GQIO2V6QM7WCUGL2GZ6D4U773HMRI6RXISKPUR3 |
| dividend | Proportional yield/dividend distribution | docs | CAR4XY3CEBQWFOL27JEWFW34KXSIZA7RFKDQMEIV7ZU723RWY37I2SYX |
Full addresses and the sample asset are in DEPLOYMENTS.md.
transfer(from, to, amount)
├─ from.require_auth()
├─ assert !paused
├─ compliance.is_allowed(from) ── cross-contract call ──► compliance contract
├─ compliance.is_allowed(to) ── cross-contract call ──► compliance contract
└─ move balances + emit event
If either party is not Approved (or is expired / suspended / in a blocked
jurisdiction), the transfer reverts. The asset token knows only the compliance
interface (#[contractclient]), so the concrete compliance contract can be
swapped with set_compliance.
These contracts are native Soroban programs — Stellar's Rust/WASM smart-contract platform — and lean directly on Stellar primitives:
- Addresses are Stellar accounts (
G…) and contracts (C…); auth is enforced withrequire_auth()so only the account that signed the transaction can act. - Cross-contract calls wire the system together: the asset token holds only the
compliance interface (
#[contractclient]) and callsis_allowedon the live compliance contract on every transfer/mint (the gate shown above). - Events are published on every state change (
register,transfer,approved,created,claim, …) so off-chain indexers can follow activity over Soroban RPC. - Persistent + instance storage with TTL bumping keeps asset, KYC and distribution state alive on-ledger.
- Value scaling: valuations are stored as USD cents (
i128); token amounts are integers in each token's owndecimalsbase.
Network passphrase: Test SDF Network ; September 2015 · Soroban RPC:
https://soroban-testnet.stellar.org
Deployed contract ids are in the Contracts table above and in
DEPLOYMENTS.md; each links to its record on
Stellar Expert. Build to WASM and deploy
with the Stellar CLI via
scripts/deploy.sh.
- The web app reads state by simulating view calls over Soroban RPC and signs writes with Freighter.
- The API indexes on-chain state by polling Soroban RPC — read-only, holding no keys.
- Rust + Soroban SDK 26
- Cargo workspace, one member per contract
- 48 unit tests including the cross-contract compliance checks
# build all contracts to wasm
stellar contract build
# run the full test suite (48 tests)
cargo test
# deploy + initialize everything on Testnet
NETWORK=testnet IDENTITY=rwa-admin ./scripts/deploy.shSee CONTRIBUTING.md for local Soroban setup, the compliance model, and how to add a new compliance rule.
- Web app: https://github.com/RWA-ToolKit/stellar-rwa-web
- API + Docs: https://github.com/RWA-ToolKit/stellar-rwa-api-docs
MIT — see LICENSE.