IGovernor
Inherits: IERC6372, IERC712
Author: M^0 Labs
Functions
castVote
Allows the caller to cast a vote on a proposal with id proposalId
.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
|
| The type of support to cast for the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast. |
castVoteBySig
Allows a signer to cast a vote on a proposal with id proposalId
via an ECDSA secp256k1 signature.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
|
| The type of support to cast for the proposal. |
|
| An ECDSA secp256k1 signature parameter. |
|
| An ECDSA secp256k1 signature parameter. |
|
| An ECDSA secp256k1 signature parameter. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast. |
castVoteBySig
Allows voter
to cast a vote on a proposal with id proposalId
via an arbitrary signature.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account that casting their vote, and purported to have signed. |
|
| The unique identifier for the proposal. |
|
| The type of support to cast for the proposal. |
|
| An arbitrary signature. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast. |
castVoteWithReason
Allows the caller to cast a vote with reason on a proposal with id proposalId
.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
|
| The type of support to cast for the proposal. |
|
| The reason for which the caller casts their vote, if any. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast. |
castVoteWithReasonBySig
Allows a signer to cast a vote with reason on a proposal with id proposalId
via an ECDSA secp256k1 signature.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
|
| The type of support to cast for the proposal. |
|
| The reason for which the caller casts their vote, if any. |
|
| An ECDSA secp256k1 signature parameter. |
|
| An ECDSA secp256k1 signature parameter. |
|
| An ECDSA secp256k1 signature parameter. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast. |
castVoteWithReasonBySig
Allows voter
to cast a vote with reason on a proposal with id proposalId
via an arbitrary signature.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account that casting their vote, and purported to have signed. |
|
| The unique identifier for the proposal. |
|
| The type of support to cast for the proposal. |
|
| The reason for which the caller casts their vote, if any. |
|
| An arbitrary signature. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast. |
execute
Allows the caller to execute a proposal.
Parameters
Name | Type | Description |
---|---|---|
|
| An array of addresses that will be called upon the execution. |
|
| An array of ETH amounts that will be sent to each respective target upon execution. |
|
| An array of call data used to call each respective target upon execution. |
|
| The hash of the string of the description of the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
propose
Allows the caller to create a proposal.
Parameters
Name | Type | Description |
---|---|---|
|
| An array of addresses that will be called upon the execution. |
|
| An array of ETH amounts that will be sent to each respective target upon execution. |
|
| An array of call data used to call each respective target upon execution. |
|
| The string of the description of the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
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.
getVotes
Returns the voting power of account
at clock value timepoint
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account with voting power. |
|
| The point in time, according to the clock mode the contract is operating on. |
Returns
Name | Type | Description |
---|---|---|
|
| The voting power of |
hashProposal
Returns the unique identifier for the proposal if it were created at this exact moment.
Parameters
Name | Type | Description |
---|---|---|
|
| An array of addresses that will be called upon the execution. |
|
| An array of ETH amounts that will be sent to each respective target upon execution. |
|
| An array of call data used to call each respective target upon execution. |
|
| The hash of the string of the description of the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
hasVoted
Returns whether account
has voted on the proposal with identifier proposalId
.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
|
| The address of some account. |
Returns
Name | Type | Description |
---|---|---|
|
| Whether |
name
Returns the name of the contract.
proposalDeadline
Returns the last clock value when voting on the proposal with identifier proposalId
is allowed.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The last clock value when voting on the proposal is allowed. |
proposalProposer
Returns the account that created the proposal with identifier proposalId
.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The address of the account that created the proposal. |
proposalSnapshot
Returns the clock value used to retrieve voting power to vote on proposal with identifier proposalId
.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The clock value used to retrieve voting power. |
proposalThreshold
Returns the required voting power an account needs to create a proposal.
proposalVotes
Returns the vote support totals for the proposal with identifier proposalId
.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of votes cast against the proposal. |
|
| The amount of votes cast for the proposal. |
|
| The amount of votes cast in abstention the proposal. |
quorum
Returns the minimum number of eligible (COUNTING_MODE) votes for a proposal to succeed.
state
Returns the state of a proposal with identifier proposalId
.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The state of the proposal. |
token
Returns the EIP-5805 token contact used for determine voting power and total supplies.
votingDelay
Returns the number of clock values that must elapse before voting begins for a newly created proposal.
votingPeriod
Returns the number of clock values between the vote start and vote end.
BALLOT_TYPEHASH
Returns the EIP712 typehash used in the encoding of the digest for castVoteBySig
function.
BALLOT_WITH_REASON_TYPEHASH
Returns the EIP712 typehash used in the encoding of the digest for castVoteWithReasonBySig
function.
Events
ProposalCreated
Emitted when a proposal has been created.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
|
| The address of the account that created the proposal. |
|
| An array of addresses that will be called upon the execution. |
|
| An array of ETH amounts that will be sent to each respective target upon execution. |
|
| Empty string array required to be compatible with OZ governor contract. |
|
| An array of call data used to call each respective target upon execution. |
|
| The first clock value when voting on the proposal is allowed. |
|
| The last clock value when voting on the proposal is allowed. |
|
| The string of the description of the proposal. |
ProposalExecuted
Emitted when a proposal has been executed.
Parameters
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
VoteCast
Emitted when a vote for a proposal with id proposalId
has been cast by voter
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account that has casted their vote. |
|
| The unique identifier for the proposal. |
|
| The type of support that has been cast for the proposal. |
|
| The number of votes cast. |
|
| The string of the reason |
Enums
ProposalState
Proposal state.