IGovernor
IGovernor
Contract module which provides access control mechanism, where there is an account (an governor) that can be granted exclusive access to specific functions.
The initial governor is specified at deployment time in the constructor for Governor
. This
can later be changed with {transferGovernor} and {acceptGovernor}.
This module is used through inheritance. It will make available all functions from parent (Governor).
Modified from the OpenZeppelin Contracts library (5.0.0)
Addresses
Chain | Address |
---|
Functions
transferGovernor
function transferGovernor(address newGovernor) external
Starts the governorship transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current governor.
acceptGovernor
function acceptGovernor() external
The new governor accepts the governorship transfer.
pendingGovernor
function pendingGovernor() external view returns (address)
Returns the address of the pending governor.
governor
function governor() external view returns (address)
Returns the address of the current governor.
Events
GovernorTransferStarted
event GovernorTransferStarted(address previousGovernor, address newGovernor)
GovernorTransferred
event GovernorTransferred(address previousGovernor, address newGovernor)
Errors
GovernorUnauthorizedAccount
error GovernorUnauthorizedAccount(address account)
The caller account is not authorized to perform an operation.
GovernorInvalidAddress
error GovernorInvalidAddress(address governor)
The governor is not a valid governor account. (eg. address(0)
)