Contract Overview
The SLASettle smart contract layer is implemented in Rust using soroban-sdk 29.0.1. The current v0.2 contracts were deployed and cut over while Stellar Testnet was on Protocol 29. It is organized into two distinct, loosely coupled contracts hosted in the SLASettleHQ/slasettle-vault repository.
Contract Architecture & Coupling
text
+-------------------------------------------------------+
| watcher_registry |
| - Manages watcher set & counts per-round votes |
| - Emits: CheckSubmitted, WatcherRegistered/Removed |
+-------------------------------------------------------+
^
| Cross-contract read:
| get_round_tally(sla_id, round_id, endpoint_hash)
|
+-------------------------------------------------------+
| sla_vault |
| - Holds provider collateral in escrow |
| - Interprets quorum: votes_down >= quorum_threshold |
| - Executes penalty transfers to beneficiaries |
| - Emits: SlaCreated, BondToppedUp, SettlementPaid, |
| SlaCancelled, BondWithdrawn |
+-------------------------------------------------------+Clean Separation of Concerns
watcher_registry:- Acts strictly as an attestation registry and round tally aggregator.
- Has zero dependencies on
sla_vaultor any financial/token contracts. - Does not enforce quorum thresholds or make settlement decisions.
sla_vault:- Manages agreement lifecycle, collateral balances, and payouts.
- References
watcher_registryvia a stored contract address initialized at deployment. - Performs cross-contract calls using the compiled client (
watcher_registry_contract::Client) to inspect round vote tallies. - Contains all economic and quorum enforcement logic.
Deployed Contract Addresses (Stellar Testnet)
| Contract Name | Address | Functionality |
|---|---|---|
sla_vault | CA5R7V5IGMYOBRSAMP4R5MWURSNTY6565NSKEEVR6626PLC3VM2A3EZ2 | Collateral escrow, agreement configuration, and penalty settlement. |
watcher_registry | CDTIVQ6I77EMFP42522RIFKMSMJID3BDLNR5LPLJEGVAS4Q2DJDMN3DY | Node registration, check attestation, and vote tallying. |
- Network: Stellar Testnet
- Network Passphrase:
Test SDF Network ; September 2015 - RPC URL:
https://soroban-testnet.stellar.org
Building from Source
To compile the smart contracts from the slasettle-vault repository:
bash
git clone https://github.com/SLASettleHQ/slasettle-vault.git
cd slasettle-vault
# Build both release WASM targets
stellar contract build
# WASM artifacts output:
# target/wasm32v1-none/release/watcher_registry.wasm
# target/wasm32v1-none/release/sla_vault.wasmDeterministic compilation with stellar contract build produces bytecode that matches the deployed Testnet contracts byte-for-byte.