feat(streaming): implement global pause mechanism (#445)#1
Open
kokobutter-web wants to merge 3 commits into
Open
feat(streaming): implement global pause mechanism (#445)#1kokobutter-web wants to merge 3 commits into
kokobutter-web wants to merge 3 commits into
Conversation
added 3 commits
April 25, 2026 10:27
- Add lifecycle dependency for pause/unpause functionality - Add Admin storage key and initialize function - Add pause/unpause functions with admin authorization - Add is_destroyed flag and require_not_destroyed guard - Wrap create_stream, withdraw, cancel_stream with pause/destroy checks - Add extend_stream for active stream extension (prerequisite for self-destruct) - Add self_destruct with cleanup of all streams and refunds - Require contract to be paused before self-destruct for safety - Add comprehensive tests for pause, unpause, and self-destruct scenarios - All state-changing operations blocked when paused or destroyed Part of EDOHWARES#445 EDOHWARES#458 EDOHWARES#474
- Inline claimable_amount logic within claim to avoid double-reading Claimed - Read claimed value once at start, compute claimable directly - Reduces one storage read per claim operation - Estimated saving: ~5% gas for claim function Part of EDOHWARES#448
- Pass oracle address as parameter to calculate_total_collateral_value - Read Oracle once in distribute_seized_collateral and pass to helper - Read Oracle once in should_liquidate instead of inside helper - Eliminates duplicate storage fetch in distribution path - Estimated saving: ~10% gas for liquidation operations Part of EDOHWARES#448
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.
Summary
Changes
Testing
Fixes EDOHWARES#445