Skip to main content

IEnabler

Git Source

Title: 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

NameTypeDescription
enabledboolTrue if the contract is enabled, false otherwise

enable​

Enables the contract

Implementing contracts should implement permissioning logic

function enable(bytes calldata enableData_) external;

Parameters

NameTypeDescription
enableData_bytesOptional 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

NameTypeDescription
disableData_bytesOptional 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();