IThresholdGovernor

Git Source

Inherits: IBatchGovernor

Author: M^0 Labs

Functions

getProposal

Returns all data of a proposal with identifier proposalId.

function getProposal(uint256 proposalId)
    external
    view
    returns (
        uint48 voteStart,
        uint48 voteEnd,
        ProposalState state,
        uint256 noVotes,
        uint256 yesVotes,
        address proposer,
        uint256 quorum,
        uint16 quorumNumerator
    );

Parameters

NameTypeDescription

proposalId

uint256

The unique identifier for the proposal.

Returns

NameTypeDescription

voteStart

uint48

The first clock value when voting on the proposal is allowed.

voteEnd

uint48

The last clock value when voting on the proposal is allowed.

state

ProposalState

The state of the proposal.

noVotes

uint256

The amount of votes cast against the proposal.

yesVotes

uint256

The amount of votes cast for the proposal.

proposer

address

The address of the account that created the proposal.

quorum

uint256

The threshold/quorum of yes votes required for the proposal to succeed.

quorumNumerator

uint16

The threshold/quorum numerator used to calculate the quorum.

thresholdRatio

Returns the threshold ratio to be applied to determine the success threshold for a proposal.

For all intents and purposes, this is the same as quorumNumerator.

function thresholdRatio() external view returns (uint16);

proposalQuorum

Returns the quorum of yes votes needed for a specific proposal to succeed.

function proposalQuorum(uint256 proposalId) external view returns (uint256);

Parameters

NameTypeDescription

proposalId

uint256

The unique identifier for the proposal.

Returns

NameTypeDescription

<none>

uint256

The quorum of yes votes needed for the proposal to succeed.

quorumNumerator

Returns the quorum numerator used to determine the quorum for a proposal.

For all intents and purposes, this is the same as thresholdRatio.

function quorumNumerator() external view returns (uint256);

quorumDenominator

Returns the quorum denominator used to determine the quorum for a proposal.

function quorumDenominator() external view returns (uint256);

ONE

Returns the value used as 100%, to be used to correctly ascertain the threshold ratio.

function ONE() external pure returns (uint256);

Events

ThresholdRatioSet

Emitted when the threshold ratio is set.

event ThresholdRatioSet(uint16 thresholdRatio);

Parameters

NameTypeDescription

thresholdRatio

uint16

The new threshold ratio.

QuorumNumeratorUpdated

Emitted when the quorum numerator is set.

event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);

Parameters

NameTypeDescription

oldQuorumNumerator

uint256

The old quorum numerator.

newQuorumNumerator

uint256

The new quorum numerator.

Errors

InvalidThresholdRatio

Revert message when trying to set the threshold ratio above 100% or below 2.71%.

error InvalidThresholdRatio(uint256 thresholdRatio, uint256 minThresholdRatio, uint256 maxThresholdRatio);

Parameters

NameTypeDescription

thresholdRatio

uint256

The threshold ratio being set.

minThresholdRatio

uint256

The minimum allowed threshold ratio.

maxThresholdRatio

uint256

The maximum allowed threshold ratio.

Copyright 2024 M^0 Foundation