fix: claim-all post-condition bounds by remaining escrow, not stale claimable - #23
Merged
Merged
Conversation
…claimable claim-all pays out the claimable balance at execution time, but the deny-mode post-condition capped the contract's outflow at the claimable amount sampled when the button was clicked. Claimable grows every ~5s block, so by the time the tx mined the payout exceeded the stale bound and the chain aborted with abort_by_post_condition — on any active stream, every time. It never surfaced before because earlier claims ran against finished streams, where accrual had stopped. Bound by remaining escrow (deposit − withdrawn) instead: it only shrinks, so it always covers the payout, while still capping outflow at what the stream actually holds — the protection M-3 intended. The cancel flow already used this bound and matches the contract's total outflow exactly; partial claim sends an explicit amount and was never affected.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Claim All failed on-chain (
abort_by_post_condition) on every active stream.The deny-mode post-condition capped the contract's outflow at the claimable amount sampled at click time — but
claim-allpays claimable at execution time, which is higher (accrual continues every ~5s block while the tx waits to mine). Stale bound < actual payout → chain aborts. Hidden until now because earlier claims ran against finished streams (no accrual).Fix
Bound by remaining escrow (
deposit − withdrawn): it never grows (only shrinks on claims), so it always covers the payout while still capping outflow at exactly what the stream holds — the same protection the audit fix (M-3) intended. Cancel already used this bound (matches the contract's total cancel outflowrecipient-amount + sender-refund = deposit − withdrawn); partial claim passes an explicit amount and was never affected.Verify