Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

GovernorProposalGuardian

Inherits: Governor

Extension of {Governor} which adds a proposal guardian that can cancel proposals at any stage in the proposal's lifecycle. NOTE: if the proposal guardian is not configured, then proposers take this role for their proposals.

State Variables

_proposalGuardian

address private _proposalGuardian;

Functions

proposalGuardian

Getter that returns the address of the proposal guardian.

function proposalGuardian() public view virtual returns (address);

setProposalGuardian

Update the proposal guardian's address. This operation can only be performed through a governance proposal. Emits a ProposalGuardianSet event.

function setProposalGuardian(address newProposalGuardian) public virtual onlyGovernance;

_setProposalGuardian

Internal setter for the proposal guardian. Emits a ProposalGuardianSet event.

function _setProposalGuardian(address newProposalGuardian) internal virtual;

_validateCancel

Override Governor-_validateCancel to implement the extended cancellation logic. The {proposalGuardian} can cancel any proposal at any point. If no proposal guardian is set, the {IGovernor-proposalProposer} can cancel their proposals at any point. In any case, permissions defined in {Governor-_validateCancel} (or another override) remains valid.

function _validateCancel(uint256 proposalId, address caller) internal view virtual override returns (bool);

Events

ProposalGuardianSet

event ProposalGuardianSet(address oldProposalGuardian, address newProposalGuardian);