Skip to content

Add an emergency switch for authority-gated setters #3083

Description

@onurinanc

The Authority component gates every setter on an account (policy setters, metadata setters, pausable manager, and more) through a single chokepoint, assert_authorized. There is currently no way to disable that entire surface in one operation. This issue proposes a global closed flag on Authority so the owner can atomically block all authority-gated procedures, an emergency switch for the account's management surface.

A common access-control pattern is the ability to freeze a contract's whole restricted surface in a single call, regardless of role membership, as an emergency measure. We have no equivalent.

Note that Pausable does not cover this: it only gates the functional execute paths (mint/burn/transfer), not the admin setters. Concretely:

So while paused, a role/owner can still rewrite the mint policy. Pause freezes value flow, it does not freeze configuration. The two are complementary, and the "freeze configuration" half is missing.

Exists:

  • Authority is the single gate every setter passes through via assert_authorized.
  • The value slot is [authority, 0, 0, 0]
  • Owner checks are already in-module (authority.masm imports ownable2step).

Missing:

  • Any way to disable all authority-gated procedures at once.

Design

We can put a flag on Authority: assert_authorized is already the chokepoint, so the check lives there with zero changes to the setters.

Storage becomes

[authority, target_closed, 0, 0]  

Runtime (authority.masm):

  • At the top of assert_authorized, panic with a new ERR_AUTHORITY_CLOSED, blocking every gated procedure in all modes before any role/owner dispatch.
  • Add set_target_{closed/opened}) gated directly on ownable2step::assert_sender_is_owner_internal, not routed through assert_authorized.

open flag must bypass the closed check. Otherwise, closeassert_authorized rejects everyone → open is uncallable → account permanently bricked. Gating open/close on the owner check directly guarantees the owner can always reopen.

The scope is for OwnerControlled / RbacControlled (both install Ownable2Step) as AuthControlled has no owner, so the switch is out of scope there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    standardsRelated to standard note scripts or account components
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions