ReEnablerGracePeriodImmutable
Inherits: ReEnablerGracePeriod
Title: ReEnablerGracePeriodImmutable
An abstract extension of ReEnablerGracePeriod that locks the grace window
after construction.
setGracePeriod always reverts with GracePeriod_NotConfigurable. The
_authorizeSetGracePeriod hook is left abstract so that an inheriting contract
that re-opens the setter must define an authorisation rule consciously.
Functions
constructor
Forwards the initial grace window length to the parent constructor.
constructor(uint32 period_) ReEnablerGracePeriod(period_);
Parameters
| Name | Type | Description |
|---|---|---|
| period_ | uint32 | The grace window length in seconds. |
setGracePeriod
The setter is gated by givenEnabled, so the grace window is fixed at the
value it held when the contract was last disabled and cannot be changed while
the contract is in the disabled state.
Reverts if:
The contract is disabled.
_authorizeSetGracePeriodrejects the caller.period_is zero.
The function delegates the caller authorization to
_authorizeSetGracePeriod and the value validation plus event emission to
_setGracePeriod. The function is declared virtual so that an
implementation that wishes to lock the window after construction can
override it and revert with GracePeriod_NotConfigurable; see
ReEnablerGracePeriodImmutable for the canonical lock.
function setGracePeriod(uint32) public pure override;
Parameters
| Name | Type | Description |
|---|---|---|
| _ | uint32 | The new length of the grace window in seconds. |