Skip to main content

ReEnablerGracePeriodImmutable

Git Source

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

NameTypeDescription
period_uint32The 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.

  • _authorizeSetGracePeriod rejects 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

NameTypeDescription
_uint32The new length of the grace window in seconds.