Skip to main content

PolicyEnablerV2

Git Source

Inherits: EnablerV2, PolicyAdminOptimized

Title: PolicyEnablerV2

An abstract policy mix-in that wires EnablerV2 to the role-based access control exposed by PolicyAdminOptimized.

The mix-in restricts enable to the admin role and disable to either the admin or the emergency role, matching the access pattern of the legacy PolicyEnabler. Inheriting policies are expected to override _beforeEnable and _beforeDisable when implementation specific state changes are required, and to assign the ROLES module address inside configureDependencies.

The mix-in does not introduce any storage variables of its own and does not modify the IEnabler wire-level surface, so legacy callers that target the IEnabler interface continue to interoperate with policies that derive from this contract.

Functions​

_authorizeEnable​

Validates that the caller is permitted to enable the contract.

Reverts if:

  • The caller is not authorized to perform the enable.

Reverts if:

  • The caller does not hold the admin role.
function _authorizeEnable(bytes calldata) internal view override onlyAdminRole;

Parameters

NameTypeDescription
_bytesThe calldata payload passed to enable.

_authorizeDisable​

Validates that the caller is permitted to disable the contract.

Reverts if:

  • The caller is not authorized to perform the disable.

Reverts if:

  • The caller holds neither the admin role nor the emergency role.
function _authorizeDisable(bytes calldata) internal view override onlyEmergencyOrAdminRole;

Parameters

NameTypeDescription
_bytesThe calldata payload passed to disable.