Skip to content

Repository files navigation

Stellar RWA Contracts

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.

Contracts

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.

How compliance gating works

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.

Stellar integration

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 with require_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 calls is_allowed on 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 own decimals base.

Network & deployment (Testnet)

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.

How the rest of the toolkit consumes these contracts

  • 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.

Tech stack

  • Rust + Soroban SDK 26
  • Cargo workspace, one member per contract
  • 48 unit tests including the cross-contract compliance checks

Quick start

# 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.sh

See CONTRIBUTING.md for local Soroban setup, the compliance model, and how to add a new compliance rule.

Sister repos

License

MIT — see LICENSE.

About

Soroban smart contracts for tokenizing real-world assets on Stellar with built-in compliance (KYC allowlists, transfer restrictions, dividends).

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages