For the complete documentation index, see llms.txt. This page is also available as Markdown.

MixinVoting

Overview

License: Apache-2.0-or-later

abstract contract MixinVoting is MixinState

Inherits MixinState (which inherits OZ Governor) as a single chain, avoiding a diamond between the voting and state mixins over the Governor branch.

Errors info

GovLowVotingPower

error GovLowVotingPower(uint256 votingPower, uint256 proposalThreshold)

Thrown when the proposer has insufficient voting power.

Parameters:

Name
Type
Description

votingPower

uint256

The proposer's current voting power.

proposalThreshold

uint256

The minimum voting power required to propose.

GovNoActions

error GovNoActions()

Thrown when a proposal contains no actions.

GovTooManyActions

Thrown when a proposal contains too many actions.

Parameters:

Name
Type
Description

provided

uint256

The number of actions submitted.

max

uint256

The maximum number of actions allowed per proposal.

GovVotingClosed

Thrown when a vote is cast outside the active voting period.

Parameters:

Name
Type
Description

proposalId

uint256

The id of the proposal.

state

enum ProposalStatus

The current state of the proposal.

GovAlreadyVoted

Thrown when a voter tries to vote twice on the same proposal.

Parameters:

Name
Type
Description

proposalId

uint256

The id of the proposal.

voter

address

The address that has already voted.

GovNoVotes

Thrown when a voter has no voting power.

Parameters:

Name
Type
Description

voter

address

The address that attempted to vote.

GovExecutionValueMismatch

Thrown when execute is called with insufficient native tokens.

Parameters:

Name
Type
Description

required

uint256

The amount required for execution.

provided

uint256

The amount of native tokens sent with the call.

GovUnableToCancel

Thrown when an account other than the proposer tries to cancel a proposal.

Parameters:

Name
Type
Description

proposalId

uint256

The id of the proposal.

caller

address

The account that attempted the cancellation.

GovActionsLengthMismatch

Thrown when the OZ-format propose receives arrays of different lengths.

GovInvalidSupport

Thrown when a vote is cast with a support value that is not a valid vote type.

Parameters:

Name
Type
Description

support

uint8

The supplied support value.

GovProposalIdUnknown

Thrown when the OZ-format execute does not match any stored proposal.

Parameters:

Name
Type
Description

proposalHash

bytes32

The OpenZeppelin proposal hash computed from the supplied arguments.

Functions info

propose (0x367015bb)

Creates a proposal on the the given actions. Must have at least proposalThreshold.

Must have at least proposalThreshold of voting power to call this function.

Parameters:

Name
Type
Description

actions

struct IGovernanceVoting.ProposedAction[]

The proposed actions. An action specifies a contract call.

description

string

A text description for the proposal.

Return values:

Name
Type
Description

proposalId

uint256

The ID of the newly created proposal.

propose (0x7d5e81e2)

Must not call super: OZ Governor linear storage (slots 0-6) must stay empty. See docs/governance/TALLY_COMPAT.md. Create a new proposal. Vote starts after a delay specified by {IGovernor-votingDelay} and lasts for a duration specified by {IGovernor-votingPeriod}.

Emits a {ProposalCreated} event.

NOTE: The state of the Governor and targets may change between the proposal creation and its execution. This may be the result of third party actions on the targeted contracts, or other governor proposals. For example, the balance of this contract could be updated or its access control permissions may be modified, possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough value to cover a proposal with multiple transfers).

nonces (0x7ecebe00)

Voter nonces are tracked in an ERC-7201 slot (see _voterNonces) instead of OZ Nonces's private regular mapping, keeping all live governance state namespaced.

execute (0xfe0d94c1)

Executes a proposal that has passed and is currently executable.

Parameters:

Name
Type
Description

proposalId

uint256

The ID of the proposal to execute.

execute (0x2656227d)

Must not call super: OZ Governor linear storage (slots 0-6) must stay empty. See docs/governance/TALLY_COMPAT.md. Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the deadline to be reached. Depending on the governor it might also be required that the proposal was queued and that some delay passed.

Emits a {ProposalExecuted} event.

NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.

cancel (0x40e58ee5)

Cancels a proposal that has not started voting yet.

Only the proposer can cancel, and only while the proposal is Pending. A canceled proposal cannot be voted on or executed. Cancelling does not consume the proposal id.

Parameters:

Name
Type
Description

proposalId

uint256

The ID of the proposal to cancel.

cancel (0x452115d6)

Must not call super: OZ Governor linear storage (slots 0-6) must stay empty. See docs/governance/TALLY_COMPAT.md. Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e. before the vote starts.

Emits a {ProposalCanceled} event.

Last updated