Soroban smart contracts for SoroStream — a real-time payment streaming protocol on Stellar. Stream USDC by the second for salaries, subscriptions, vesting schedules, and grant disbursements.
- Sender calls
create_stream()locking USDC for a recipient over a defined duration. - Contract computes
flow_rate = amount / duration_seconds. - Recipient calls
withdraw()at any time to claimflow_rate × elapsed_seconds. - Sender can
cancel_stream()— recipient gets earned amount, sender gets remainder. - Sender can
top_up()to add more USDC, automatically extending the end time. - Streams can
auto_renew— restarting automatically on completion.
| Layer | Technology |
|---|---|
| Language | Rust 1.84+ |
| Smart Contract SDK | soroban-sdk 22.0.0 |
| CLI | stellar-cli |
| CI | GitHub Actions |
# 1. Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 2. Add WASM target
rustup target add wasm32-unknown-unknown
# 3. Install Stellar CLI
cargo install --locked stellar-cli --features opt
# 4. Run tests
cargo test
# 5. Lint
cargo clippy -- -D warnings
# 6. Build WASM
stellar contract build| Function | Description |
|---|---|
create_stream(sender, recipient, token, amount, duration_seconds, auto_renew) |
Creates a new stream, returns stream_id |
withdraw(stream_id, recipient) |
Recipient claims all earned tokens |
cancel_stream(stream_id, sender) |
Cancels stream, splits balance |
top_up(stream_id, sender, amount) |
Adds tokens, extends duration |
get_stream(stream_id) |
Returns full Stream struct |
get_all_stream_ids(start, limit) |
Returns a paginated list of all stream IDs ever created |
get_claimable(stream_id) |
Returns currently claimable amount |
get_streams_by_sender(sender) |
Returns all streams for a sender |
get_streams_by_recipient(recipient) |
Returns all streams for a recipient |
For the full instruction reference with parameters, errors, events, and CLI examples, see docs/contract-reference.md.
| Contract | Address |
|---|---|
| StreamContract | See deployments/testnet.json |
This project participates in the Stellar Wave Program on Drips Wave. Contributors earn rewards for resolving issues during weekly Wave sprints — funded by the Stellar Development Foundation, free for contributors to participate.
See CONTRIBUTING.md for the full workflow. Contributors working on contract state should also read docs/STORAGE.md for persistent vs. temporary storage trade-offs.
Note: Do not start coding until assigned to an issue by a maintainer.