Skip to content

Add protocol-level emergency pause mechanism#400

Open
wheval wants to merge 2 commits into
accesslayerorg:mainfrom
wheval:feat/emergency-pause-protocol
Open

Add protocol-level emergency pause mechanism#400
wheval wants to merge 2 commits into
accesslayerorg:mainfrom
wheval:feat/emergency-pause-protocol

Conversation

@wheval

@wheval wheval commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds pause() and unpause() admin-only functions gated by set_protocol_admin
  • Persists a Paused boolean flag in contract storage (default false)
  • Emits ProtocolPaused / ProtocolUnpaused events on each state change
  • buy_key, sell_key, and register_creator check the flag and revert with ProtocolPaused (error variant 17) when active
  • All get_* / quote_* / is_* read-only view functions are completely unaffected
  • Adds Unauthorized error variant (18) for non-admin callers to pause/unpause

Acceptance criteria

  • pause() sets the flag and emits ProtocolPaused event
  • unpause() clears the flag and emits ProtocolUnpaused event
  • Buy reverts with ProtocolPaused when paused
  • Sell reverts with ProtocolPaused when paused
  • Creator registration reverts with ProtocolPaused when paused
  • All read-only view functions succeed while paused
  • Non-admin caller to pause or unpause is rejected with Unauthorized
  • Unit tests cover all of the above cases (9 tests, all green)

Closes #393

wheval added 2 commits June 19, 2026 20:12
Adds pause() and unpause() admin-only functions that set a persistent
paused flag and emit ProtocolPaused/ProtocolUnpaused events. buy_key,
sell_key, and register_creator check the flag and revert with
ProtocolPaused when active. All read-only view functions are unaffected.
Adds Unauthorized error variant for non-admin callers.

Closes accesslayerorg#393
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add protocol-level emergency pause that halts buy and sell while keeping reads live

1 participant