Skip to content

fix: reject bounded streams whose total obligation overflows - #480

Open
Goodness-0x wants to merge 1 commit into
conduit-protocol:mainfrom
Goodness-0x:fix/stream-initialize-overflow-check
Open

fix: reject bounded streams whose total obligation overflows#480
Goodness-0x wants to merge 1 commit into
conduit-protocol:mainfrom
Goodness-0x:fix/stream-initialize-overflow-check

Conversation

@Goodness-0x

Copy link
Copy Markdown

Fix: reject bounded streams whose total obligation overflows

Summary

Fixes #405 by rejecting bounded DripStream initializations whose total obligation would overflow i128.

Previously, initialize() validated zero/negative rates and malformed time ranges, but it did not reject the case where:

rate_per_second * (end_time - start_time)

would overflow. That allowed a direct-initialized stream to be created in a state that later trapped settlement flows (withdraw, cancel, clawback, force_cancel) with ArithmeticOverflow after enough ledger time elapsed, permanently locking the escrow.

What changed

  • Added an upfront bounded-stream overflow check in lib.rs
  • Added a focused regression test in tests.rs covering the overflow case

Verification

I verified with:

source "$HOME/.cargo/env" && cd /workspaces/streamFi-contracts && cargo test -p drip-stream -- --nocapture

Closing

Closes #405

@Goodness-0x
Goodness-0x requested a review from Jaydbrown as a code owner August 31, 2026 09:53
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Goodness-0x 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

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

Labels

None yet

Projects

None yet

1 participant