Soroban smart contracts for Swipely, the cross-chain bridge and DEX liquidity monitoring platform on the Stellar network. These contracts provide the on-chain primitives the platform relies on — trusted source registries, asset locking/escrow, operator rotation, and transfer state tracking.
This is a Cargo workspace with the following members:
| Crate | Description |
|---|---|
soroban/ |
Core Soroban contracts (access control, trusted sources, thresholds) |
escrow_contract/ |
Time-locked escrow contract for bridge transfers |
transfer_state_machine/ |
Transfer state-machine contract logic |
harness/ |
Test harness and integration helpers |
- Rust (stable) with the
wasm32-unknown-unknowntarget - Soroban CLI (
stellar/soroban)
rustup target add wasm32-unknown-unknown# Build optimized wasm for release
cargo build --release --target wasm32-unknown-unknown
# Run the contract test suites
cargo testThe release profile is tuned for small wasm output (opt-level = "z", LTO,
symbol stripping) — see Cargo.toml.
Every public function under soroban/src/ — arguments, authorization
requirements, and emitted events — is documented in
soroban/docs/API_REFERENCE.md, organized by
contract and grouped by what's actually compiled into the deployed contract
versus test-only or unreferenced code. The corresponding numeric error codes
are consolidated in soroban/docs/ERRORS.md,
along with a check that each contract's codes are internally unique.
Resource-usage (CPU instructions, memory, ledger footprint) benchmarks for
the escrow, threshold-window, and source-trust hot paths live in
BENCHMARKS.md, which documents how to re-run them and
records baseline numbers to compare against.
Formatting and lints are enforced across the workspace and run as their own CI job:
# Formatting (settings in rustfmt.toml)
cargo fmt --all -- --check
# Lints, with warnings treated as errors
cargo clippy --all-targets --all-features -- -D warningsRun cargo fmt --all to format locally before committing. Where a lint is
intentionally suppressed (e.g. a public contract entrypoint's argument count,
or a reserved-for-later constant), the #[allow(...)] is accompanied by a
comment explaining why.
swipely_frontend— dashboard UIswipely_backend— API and monitoring services
MIT — see LICENSE.