Skip to main content

IGovernor

IGovernor

Dev note

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

ChainAddress

Functions

transferGovernor

function transferGovernor(address newGovernor) external
Dev note

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
Dev note

The new governor accepts the governorship transfer.

pendingGovernor

function pendingGovernor() external view returns (address)
Dev note

Returns the address of the pending governor.

governor

function governor() external view returns (address)
Dev note

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)
Dev note

The caller account is not authorized to perform an operation.

GovernorInvalidAddress

error GovernorInvalidAddress(address governor)
Dev note

The governor is not a valid governor account. (eg. address(0))