GovernedBase
#
Abstract base class that defines behaviors for governed contracts.
This class is abstract so that specific behaviors can be defined for the constructor. Contracts should not be left ungoverned, but not all contract will have a constructor (for example those pre-defined in genesis).
Events#
GovernanceCallTimelocked
#
event GovernanceCallTimelocked(
bytes4 selector,
uint256 allowedAfterTimestamp,
bytes encodedCall
)
Emitted when a new governance
call has been recorded and is now waiting for the time lock to expire.
GovernanceInitialised
#
event GovernanceInitialised(
address initialGovernance
)
Emitted when the governance
address is initialized.
This address will be used until production mode is entered (see GovernedProductionModeEntered
).
At that point the governance
address is taken from GovernanceSettings
.
GovernedProductionModeEntered
#
event GovernedProductionModeEntered(
address governanceSettings
)
Emitted when governance
is enabled and the governance
address cannot be changed anymore
(only through a network fork).
TimelockedGovernanceCallCanceled
#
event TimelockedGovernanceCallCanceled(
bytes4 selector,
uint256 timestamp
)
Emitted when a timelocked governance
call is canceled before execution.
TimelockedGovernanceCallExecuted
#
event TimelockedGovernanceCallExecuted(
bytes4 selector,
uint256 timestamp
)
Emitted when a timelocked governance
call is executed.
Functions#
cancelGovernanceCall
#
function cancelGovernanceCall(
bytes4 _selector
) external;
Cancel a timelocked governance
call before it has been executed.
Only governance
can call this method.
Parameters | Type | Description |
---|---|---|
_selector |
bytes4 |
The method selector. |
executeGovernanceCall
#
function executeGovernanceCall(
bytes4 _selector
) external;
Execute the timelocked governance
calls once the timelock period expires.
Only executor can call this method.
Parameters | Type | Description |
---|---|---|
_selector |
bytes4 |
The method selector (only one timelocked call per method is stored). |
governance
#
function governance(
) public view returns (
address);
Returns the current effective governance
address.
switchToProductionMode
#
function switchToProductionMode(
) external;
Enter the production mode after all the initial governance
settings have been set.
This enables timelocks and the governance
can be obtained afterward by calling
governanceSettings
.getGovernanceAddress().
Emits GovernedProductionModeEntered
.
Modifiers#
Structures#
Variables#
governanceSettings
#
contract IGovernanceSettings governanceSettings
Governance Settings.
productionMode
#
bool productionMode
When true, governance
is enabled and cannot be disabled. See switchToProductionMode
.
timelockedCalls
#
mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls
List of pending timelocked governance
calls.