Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Why this matters
lib.rs:293 sets stream.last_update_time = env.ledger().timestamp() on top-up, but that field is the accrual anchor: calculate_claimable (lib.rs:343) computes elapsed = effective_now - last_update_time, so advancing it to now zeroes all accrued-but-unwithdrawn time. Concrete loss: 1000-token/1000s stream (rate 1); at t=900 recipient has vested 900 unwithdrawn; sender top_up(+100) -> last_update_time=900 -> get_claimable_amount=0; sender cancel_stream at t=901 pays recipient only 1 and refunds 1099 to sender. Recipient loses ~899 already-earned tokens.
Acceptance criteria
Files to touch
contracts/stream_contract/src/lib.rs
Out of scope
- Changing the protocol fee logic
- Frontend/backend top-up wiring
Why this matters
lib.rs:293 sets stream.last_update_time = env.ledger().timestamp() on top-up, but that field is the accrual anchor: calculate_claimable (lib.rs:343) computes elapsed = effective_now - last_update_time, so advancing it to now zeroes all accrued-but-unwithdrawn time. Concrete loss: 1000-token/1000s stream (rate 1); at t=900 recipient has vested 900 unwithdrawn; sender top_up(+100) -> last_update_time=900 -> get_claimable_amount=0; sender cancel_stream at t=901 pays recipient only 1 and refunds 1099 to sender. Recipient loses ~899 already-earned tokens.
Acceptance criteria
Files to touch
contracts/stream_contract/src/lib.rsOut of scope