Soroban smart contracts that power on-chain features of StreamFi — a Stellar-native live streaming platform.
Five contracts shipped covering the initial on-chain surface: subscriptions, tip goals with escrow, atomic revenue splits, paid access gates, and scheduled payouts. All contracts are independently deployable and share no runtime dependencies.
streamfi-contracts/
├── contracts/
│ ├── subscription/ # Per-creator subscription tiers
│ ├── tip-goal-escrow/ # Kickstarter-style tip goals
│ ├── revenue-split/ # Atomic multi-recipient splits
│ ├── token-gated-access/ # Paid access gates for exclusive content
│ └── payout-scheduler/ # Cadence-based auto-sweep payouts
├── docs/ # Design notes and roadmap
├── Cargo.toml # Workspace root
├── rust-toolchain.toml # Pinned toolchain
└── .github/ # CI + issue templates
- Rust (
stabletoolchain — pinned inrust-toolchain.toml) - Stellar CLI (
stellar— install) - wasm32 target:
rustup target add wasm32-unknown-unknown
# Build every contract to WASM
cargo build --release --target wasm32-unknown-unknown
# Run the full test suite
cargo test
# Format and lint
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warningsThe built WASM artifacts land in target/wasm32-unknown-unknown/release/.
# Build
cargo build --release --target wasm32-unknown-unknown
# Deploy the subscription contract
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/streamfi_subscription.wasm \
--source alice \
--network testnet
# Initialize with admin + payment token (USDC on testnet)
stellar contract invoke \
--id <contract_id> \
--source alice \
--network testnet \
-- init \
--admin <admin_address> \
--payment_token <usdc_contract_address>| Contract | Purpose | Status |
|---|---|---|
subscription |
Per-creator subscription tiers + access checks | ✅ Shipped |
tip-goal-escrow |
Kickstarter-style tip goals with escrow + refund | ✅ Shipped |
revenue-split |
Atomic multi-recipient split by basis points | ✅ Shipped |
token-gated-access |
Paid access gates (permanent or time-bounded) | ✅ Shipped |
payout-scheduler |
Cadence-based auto-sweep from creator pool | ✅ Shipped |
See docs/roadmap.md for details.
The backend (see streamfi-frontend) is designed to call these contracts' cheap read-only accessors — subscription.is_active(subscriber, creator) and token_gated_access.has_access(gate_id, holder) — before minting signed Mux playback tokens for gated content. That gives us CDN-level access enforcement backed by on-chain state, with no periodic reconciliation job needed.
Payment flows (tip-goal-escrow.contribute, revenue-split.pay, payout-scheduler.deposit) are called directly by user wallets or by keeper bots, with the frontend surfacing events published by each contract for live UI updates.
We welcome contributions. See CONTRIBUTING.md for setup, coding standards, and PR conventions. Security issues should be reported per SECURITY.md.
Apache-2.0 — see LICENSE.