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

GovernorSettingsUpgradeable

Inherits: Initializable, GovernorUpgradeable

Extension of {Governor} for settings updatable through governance.

State Variables

GovernorSettingsStorageLocation

bytes32 private constant GovernorSettingsStorageLocation =
    0x00d7616c8fe29c6c2fbe1d0c5bc8f2faa4c35b43746e70b24b4d532752affd00;

Functions

_getGovernorSettingsStorage

function _getGovernorSettingsStorage() private pure returns (GovernorSettingsStorage storage $);

__GovernorSettings_init

Initialize the governance parameters.

function __GovernorSettings_init(
    uint48 initialVotingDelay,
    uint32 initialVotingPeriod,
    uint256 initialProposalThreshold
) internal onlyInitializing;

__GovernorSettings_init_unchained

function __GovernorSettings_init_unchained(
    uint48 initialVotingDelay,
    uint32 initialVotingPeriod,
    uint256 initialProposalThreshold
) internal onlyInitializing;

votingDelay

module:user-config

Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends on the clock (see ERC-6372) this contract uses. This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a proposal starts. NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type. Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.

function votingDelay() public view virtual override returns (uint256);

votingPeriod

module:user-config

Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock (see ERC-6372) this contract uses. NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting duration compared to the voting delay. NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this interface returns a uint256, the value it returns should fit in a uint32.

function votingPeriod() public view virtual override returns (uint256);

proposalThreshold

function proposalThreshold() public view virtual override returns (uint256);

setVotingDelay

Update the voting delay. This operation can only be performed through a governance proposal. Emits a VotingDelaySet event.

function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance;

setVotingPeriod

Update the voting period. This operation can only be performed through a governance proposal. Emits a VotingPeriodSet event.

function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance;

setProposalThreshold

Update the proposal threshold. This operation can only be performed through a governance proposal. Emits a ProposalThresholdSet event.

function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance;

_setVotingDelay

Internal setter for the voting delay. Emits a VotingDelaySet event.

function _setVotingDelay(uint48 newVotingDelay) internal virtual;

_setVotingPeriod

Internal setter for the voting period. Emits a VotingPeriodSet event.

function _setVotingPeriod(uint32 newVotingPeriod) internal virtual;

_setProposalThreshold

Internal setter for the proposal threshold. Emits a ProposalThresholdSet event.

function _setProposalThreshold(uint256 newProposalThreshold) internal virtual;

Events

VotingDelaySet

event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);

VotingPeriodSet

event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);

ProposalThresholdSet

event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);

Structs

GovernorSettingsStorage

Note: storage-location: erc7201:openzeppelin.storage.GovernorSettings

struct GovernorSettingsStorage {
    uint256 _proposalThreshold;
    uint48 _votingDelay;
    uint32 _votingPeriod;
}