Skip to content

Add Soroban contracts: PredicateRegistry, test stablecoin, and client library#54

Closed
alex-predicate wants to merge 16 commits intomainfrom
feat/soroban-contracts
Closed

Add Soroban contracts: PredicateRegistry, test stablecoin, and client library#54
alex-predicate wants to merge 16 commits intomainfrom
feat/soroban-contracts

Conversation

@alex-predicate
Copy link
Copy Markdown
Contributor

Summary

  • predicate-registry — Soroban port of PredicateRegistry.sol: attester management, policy binding, Ed25519 attestation validation with UUID replay protection and expiration checks
  • test-stablecoin — SAC-compatible token with freeze/compliance support built on OpenZeppelin Stellar Contracts 0.6.0 (FungibleToken + BlockList + FungibleBurnable + AccessControl)
  • predicate-client — Shared library crate with Statement/Attestation types, serialize_statement, and authorize_transaction cross-contract helper
  • CI/CD — Added soroban-build job to contracts.yml and Soroban WASM publishing placeholders to publish.yml

36 Soroban tests passing. All 41 existing EVM tests unaffected.

Notable decisions

  • OZ for stablecoin: Uses OpenZeppelin Stellar Contracts 0.6.0 for audited token primitives. OZ 0.6.0 depends on soroban-sdk 23.5.3 while registry/client use 25.3.0 — the crates are independent so this coexists cleanly
  • Ed25519 (not ECDSA): Stellar native curve, using env.crypto().ed25519_verify()
  • Cross-contract replay protection: target field bound to calling contract's address via env.current_contract_address()
  • Contrafactory WASM publishing: Placeholder commands in CI — exact API needs coordination with Contrafactory team

Test plan

  • cd soroban && cargo test — 36 tests across 4 crates
  • cd soroban && cargo fmt --check — formatting clean
  • forge test — 41 EVM tests still pass
  • Review predicate-registry attestation validation flow against EVM PredicateRegistry.sol
  • Review OZ trait composition in test-stablecoin

🤖 Generated with Claude Code

alex-predicate and others added 13 commits March 24, 2026 18:46
Design document for adding Soroban (Stellar) smart contracts:
predicate-registry, test-stablecoin, and predicate-client library.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7-task plan covering workspace scaffolding, predicate-client types,
predicate-registry contract, test-stablecoin, integration tests,
CI/CD updates, and final verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cargo workspace with predicate-client (rlib), predicate-registry (cdylib),
and test-stablecoin (cdylib). All compile against soroban-sdk 25.3.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement the PredicateRegistry Soroban contract, porting the EVM
PredicateRegistry.sol. Includes initialization, ownership transfer,
attester management (register/deregister with swap-and-pop), policy
management, Ed25519 attestation validation with replay protection,
and TTL extension. All 18 tests pass including full Ed25519 signing
round-trip between ed25519-dalek and soroban-sdk.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds test_authorize_transaction_integration to the predicate-registry
test module. A TestWrapperContract is deployed so that authorize_transaction
runs in a real contract context, setting target = wrapper address and making
a cross-contract call to validate_attestation on the registry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- contracts.yml: new soroban-build job (Rust, stellar-cli, build, test, fmt)
- publish.yml: Soroban WASM build + placeholder publish commands

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

alex-predicate and others added 3 commits March 24, 2026 23:07
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Auto-generated JSON files that add ~8k lines of noise to the diff.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alex-predicate alex-predicate deleted the feat/soroban-contracts branch March 27, 2026 18:50
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.

1 participant