feat(contracts): add emergency pause circuit breaker to payment router#254
Open
oche2920 wants to merge 1 commit into
Open
feat(contracts): add emergency pause circuit breaker to payment router#254oche2920 wants to merge 1 commit into
oche2920 wants to merge 1 commit into
Conversation
- Add KEY_PAUSED storage key to contract instance storage - Implement require_not_paused() helper that panics with ContractPaused - Add admin-only pause() and unpause() functions with access control - Emit (admin, paused) and (admin, unpaused) events on state change - Guard pay() with require_not_paused() check - Add is_paused() view function - Full test coverage: initial state, idempotency, auth guards, event assertions, multi-cycle Closes Fracverse#174
Contributor
|
@oche2920 Pls implement your issue description |
Contributor
|
@oche2920 |
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
Adds emergency pause/unpause functionality to the payment router contract as a circuit breaker for security incidents.
Changes
KEY_PAUSEDstorage key in contract instance storagerequire_not_paused()helper — panics withContractPausedwhen activepause()andunpause()withrequire_auth()access control(admin, paused)and(admin, unpaused)events emitted on state changepay()guarded withrequire_not_paused()checkis_paused()view functionCloses #174