IGovernor

Git Source

Inherits: IERC6372, IERC712

Author: M^0 Labs

Functions

castVote

Allows the caller to cast a vote on a proposal with id proposalId.

function castVote(uint256 proposalId, uint8 support) external returns (uint256 weight);

Parameters

Returns

castVoteBySig

Allows a signer to cast a vote on a proposal with id proposalId via an ECDSA secp256k1 signature.

function castVoteBySig(uint256 proposalId, uint8 support, uint8 v, bytes32 r, bytes32 s)
    external
    returns (uint256 weight);

Parameters

Returns

castVoteBySig

Allows voter to cast a vote on a proposal with id proposalId via an arbitrary signature.

function castVoteBySig(address voter, uint256 proposalId, uint8 support, bytes memory signature)
    external
    returns (uint256 weight);

Parameters

Returns

castVoteWithReason

Allows the caller to cast a vote with reason on a proposal with id proposalId.

function castVoteWithReason(uint256 proposalId, uint8 support, string calldata reason)
    external
    returns (uint256 weight);

Parameters

Returns

castVoteWithReasonBySig

Allows a signer to cast a vote with reason on a proposal with id proposalId via an ECDSA secp256k1 signature.

function castVoteWithReasonBySig(
    uint256 proposalId,
    uint8 support,
    string calldata reason,
    uint8 v,
    bytes32 r,
    bytes32 s
) external returns (uint256 weight);

Parameters

Returns

castVoteWithReasonBySig

Allows voter to cast a vote with reason on a proposal with id proposalId via an arbitrary signature.

function castVoteWithReasonBySig(
    address voter,
    uint256 proposalId,
    uint8 support,
    string calldata reason,
    bytes memory signature
) external returns (uint256 weight);

Parameters

Returns

execute

Allows the caller to execute a proposal.

function execute(address[] memory targets, uint256[] memory values, bytes[] memory callDatas, bytes32 descriptionHash)
    external
    payable
    returns (uint256 proposalId);

Parameters

Returns

propose

Allows the caller to create a proposal.

function propose(address[] memory targets, uint256[] memory values, bytes[] memory callDatas, string memory description)
    external
    returns (uint256 proposalId);

Parameters

Returns

COUNTING_MODE

module:voting

A description of the possible "support" values for castVote and the way these votes are counted, meant to be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of key-value pairs that each describe one aspect, for example support=for,against&quorum=for. The string can be decoded by the standard URLSearchParams JavaScript class.

function COUNTING_MODE() external view returns (string memory);

getVotes

Returns the voting power of account at clock value timepoint.

function getVotes(address account, uint256 timepoint) external view returns (uint256);

Parameters

Returns

hashProposal

Returns the unique identifier for the proposal if it were created at this exact moment.

function hashProposal(
    address[] memory targets,
    uint256[] memory values,
    bytes[] memory callDatas,
    bytes32 descriptionHash
) external view returns (uint256);

Parameters

Returns

hasVoted

Returns whether account has voted on the proposal with identifier proposalId.

function hasVoted(uint256 proposalId, address account) external view returns (bool);

Parameters

Returns

name

Returns the name of the contract.

function name() external view returns (string memory);

proposalDeadline

Returns the last clock value when voting on the proposal with identifier proposalId is allowed.

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

Parameters

Returns

proposalProposer

Returns the account that created the proposal with identifier proposalId.

function proposalProposer(uint256 proposalId) external view returns (address);

Parameters

Returns

proposalSnapshot

Returns the clock value used to retrieve voting power to vote on proposal with identifier proposalId.

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

Parameters

Returns

proposalThreshold

Returns the required voting power an account needs to create a proposal.

function proposalThreshold() external view returns (uint256);

proposalVotes

Returns the vote support totals for the proposal with identifier proposalId.

function proposalVotes(uint256 proposalId)
    external
    view
    returns (uint256 noVotes, uint256 yesVotes, uint256 abstainVotes);

Parameters

Returns

quorum

Returns the minimum number of eligible (COUNTING_MODE) votes for a proposal to succeed.

function quorum() external view returns (uint256);

state

Returns the state of a proposal with identifier proposalId.

function state(uint256 proposalId) external view returns (ProposalState);

Parameters

Returns

token

Returns the EIP-5805 token contact used for determine voting power and total supplies.

function token() external view returns (address);

votingDelay

Returns the number of clock values that must elapse before voting begins for a newly created proposal.

function votingDelay() external view returns (uint256);

votingPeriod

Returns the number of clock values between the vote start and vote end.

function votingPeriod() external view returns (uint256);

BALLOT_TYPEHASH

Returns the EIP712 typehash used in the encoding of the digest for castVoteBySig function.

function BALLOT_TYPEHASH() external pure returns (bytes32);

BALLOT_WITH_REASON_TYPEHASH

Returns the EIP712 typehash used in the encoding of the digest for castVoteWithReasonBySig function.

function BALLOT_WITH_REASON_TYPEHASH() external pure returns (bytes32);

Events

ProposalCreated

Emitted when a proposal has been created.

event ProposalCreated(
    uint256 proposalId,
    address proposer,
    address[] targets,
    uint256[] values,
    string[] signatures,
    bytes[] callDatas,
    uint256 voteStart,
    uint256 voteEnd,
    string description
);

Parameters

ProposalExecuted

Emitted when a proposal has been executed.

event ProposalExecuted(uint256 proposalId);

Parameters

VoteCast

Emitted when a vote for a proposal with id proposalId has been cast by voter.

event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);

Parameters

Enums

ProposalState

Proposal state.

enum ProposalState {
    Pending,
    Active,
    Canceled,
    Defeated,
    Succeeded,
    Queued,
    Expired,
    Executed
}

Copyright 2024 M^0 Foundation