IEnabler
Interface for contracts that can be enabled and disabled
This is designed for usage by periphery contracts that cannot inherit from PolicyEnabler. Authorization is deliberately left open to the implementing contract.
Functions
isEnabled
Returns true if the contract is enabled
function isEnabled() external view returns (bool enabled);
Returns
| Name | Type | Description |
|---|---|---|
enabled | bool | True if the contract is enabled, false otherwise |
enable
Enables the contract
Implementing contracts should implement permissioning logic
function enable(bytes calldata enableData_) external;
Parameters
| Name | Type | Description |
|---|---|---|
enableData_ | bytes | Optional data to pass to a custom enable function |
disable
Disables the contract
Implementing contracts should implement permissioning logic
function disable(bytes calldata disableData_) external;
Parameters
| Name | Type | Description |
|---|---|---|
disableData_ | bytes | Optional data to pass to a custom disable function |
Events
Enabled
Emitted when the contract is enabled
event Enabled();
Disabled
Emitted when the contract is disabled
event Disabled();
Errors
NotEnabled
Thrown when the contract is not enabled
error NotEnabled();
NotDisabled
Thrown when the contract is not disabled
error NotDisabled();