Skip to content

Epic: Soroban stream lifecycle implementation #123

Description

@ogazboiz

Summary

Implement the full on chain lifecycle for FlowFi payment streams in the Soroban StreamContract. Replace placeholder logic so that create, withdraw, top up, and cancel reflect real balances over time and emit useful events.

Scope

  • Implement create_stream so that it:
    • Allocates stream ids from a persistent counter.
    • Transfers tokens from the sender into the contract.
    • Calculates rate_per_second from amount and duration and stores it.
    • Persists a Stream record in contract storage.
  • Implement withdraw so that it:
    • Computes claimable amount based on elapsed time and rate.
    • Transfers tokens to the recipient.
    • Updates withdrawn_amount and last_update_time.
  • Implement cancel_stream so that it:
    • Computes remaining balance and refunds sender.
    • Marks the stream as inactive.
    • Emits a StreamCancelled event.

Acceptance Criteria

  • Contract compiles without unused variables or duplicate functions.
  • Unit tests cover create, withdraw, top up, and cancel happy paths.
  • Manual Soroban testing shows expected token flows for a sample stream.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcontractsSmart contract related tasksenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions