Skip to content

feat: initial contracts setup - #45

Open
hpmaxi wants to merge 13 commits into
mainfrom
feat/initial-contracts-setup
Open

feat: initial contracts setup#45
hpmaxi wants to merge 13 commits into
mainfrom
feat/initial-contracts-setup

Conversation

@hpmaxi

@hpmaxi hpmaxi commented Aug 25, 2026

Copy link
Copy Markdown

Summary

First slice of the reference contracts, plus the deploy wiring so CI can
build the wasms and generate the TS clients.

What's here

  • Shared libs + workspacepricing (deposit/redeem conversion,
    round-trip and overflow invariants) and cross-contract bindings.
  • RWA share token — SEP-57 token: constructor wires 7-decimal
    metadata, admin, the manager role and the two compliance components.
    The privileged surface is RBAC-gated on manager and delegates to the
    audited RWA internals; Pausable is the token's own admin brake.
  • Compliance + identity-verifier stubs — permissive dispatcher and
    an allowlist verifier: the minimal RWA wiring M1 needs.
  • Deploy + client generationenvironments.toml declares the three
    contracts with constructor args, so stellar-scaffold deploys them and
    emits TS clients.

Design notes

  • One token, not a vault. The token fixes ContractType = RWA; the
    async vault lands in Port the async vault #65. A contract can pick only one ContractType, so
    the split is forced, not stylistic.
  • All contractimpl blocks in one module. Soroban's contracttrait
    client generation can't be split across files — cargo test breaks on
    the generated client's private testutils fields.
  • Entry-gated, exit-open. mint and transfer-in check identity; burn
    does not, so a de-listed holder can always be redeemed out.

Verification

  • cargo test: share-token 2/2, pricing 4/4.
  • stellar contract build: three wasms (share_token 35 KB).
  • TS client generates from the spec. Full scaffold deploy + client-gen
    runs in CI (needs the local-network container).

Closes #62, #63, #66.

@hpmaxi hpmaxi changed the title chore: scaffold reproducible dev environment (nix flake + rust toolch… feat: initial contracts setup Aug 25, 2026
@hpmaxi
hpmaxi force-pushed the feat/initial-contracts-setup branch from d06d2ad to ac9645c Compare August 26, 2026 18:56
@hpmaxi
hpmaxi marked this pull request as ready for review August 26, 2026 18:58
@hpmaxi
hpmaxi requested a review from luchobonatti August 26, 2026 18:58
@hpmaxi hpmaxi self-assigned this Aug 26, 2026
hpmaxi added 3 commits August 27, 2026 17:51
Permissive compliance dispatcher (bind/unbind token, add/remove
modules, admin-gated) with no policy modules registered, and an
allowlist identity verifier whose verify_identity reverts with
error 304 for non-listed accounts. Minimal RWA wiring for M1: the
share-token constructor requires both, and mint calls verify_identity.

Closes #63
Add the RWAToken surface (mint/burn/forced_transfer/recover/freeze/…),
each gated on the manager role and delegating to the audited RWA
internals, plus AccessControl and an admin-gated Pausable brake. All
contractimpl blocks live in one module: soroban's contracttrait client
generation can't be split across files without breaking the test build
on the client's private testutils fields. A test asserts the manager
mints to an allowlisted holder.

Closes #62
Declare compliance, identity-verifier and share-token under
[development.contracts] with client generation and constructor args.
Account and contract names resolve to deployed addresses, so the
share-token constructor receives the compliance and identity-verifier
addresses at deploy time. Lets stellar-scaffold deploy the three and
generate their TS clients.

Closes #66
@hpmaxi
hpmaxi force-pushed the feat/initial-contracts-setup branch from 8f6329b to fbc9c6a Compare August 27, 2026 22:17
Add a //! header and a contractmeta entry (stub=testnet-only;
prod=external ERC-3643 ...) to the compliance and identity-verifier
stubs, so the deployed wasm advertises they are placeholders, not part
of the product.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port the RWA share token

1 participant