Skip to content

Add contract stream templates - #859

Open
itzkingaddie wants to merge 4 commits into
ritik4ever:mainfrom
itzkingaddie:issue-684-contract-stream-templates
Open

Add contract stream templates#859
itzkingaddie wants to merge 4 commits into
ritik4ever:mainfrom
itzkingaddie:issue-684-contract-stream-templates

Conversation

@itzkingaddie

@itzkingaddie itzkingaddie commented Aug 28, 2026

Copy link
Copy Markdown

Overview

Adds reusable contract stream templates so senders can save stream configuration and create funded streams from those saved templates.

Related Issue

Closes #684

Changes

  • Added StreamTemplate and TemplateCreated contract types in contracts/src/templates.rs.
  • Added persistent storage for template IDs, template records, and per-sender template indexes.
  • Added template APIs:
    • create_template
    • get_template
    • get_templates_by_sender
    • create_stream_from_template
  • Added vesting_type to stream records and stream-created events so template-created streams retain the saved config.
  • Reused the existing stream validation, token allowlist, escrow transfer, stream ID allocation, storage, and event path for template-created streams.
  • Isolated the legacy escrow contract in its own module and declared errors.rs, fixing pre-existing library compile blockers from duplicate Soroban macro symbols and the missing module declaration.
  • Merged latest main and preserved upstream claim throttling, native token admin, DAO, benchmark, and snapshot changes while resolving the template-stream conflict.

Verification Results

  • cargo check --manifest-path contracts\Cargo.toml --lib passes.
  • cargo test --manifest-path contracts\Cargo.toml --test templates passes: 2 passed, 0 failed.
  • cargo test --manifest-path contracts\Cargo.toml passes: 132 unit tests, 1 benchmark test, 2 template tests, and doc tests.

Acceptance Criteria

Criteria Status
Template creation stores config on-chain Done
Stream from template has identical config Done
Max 10 templates per sender Done

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@itzkingaddie Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@itzkingaddie is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: ca6ab798-f594-40a9-a945-0fd9fc30d7b4


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

[FEATURE] Add contract stream templates (reusable stream configs)

1 participant