IBatchGovernor
Inherits: IGovernor
Author: M^0 Labs
Functions
castVotes
Allows the caller to cast votes on multiple proposals.
Parameters
Name | Type | Description |
---|---|---|
|
| The list of unique proposal IDs being voted on. |
|
| The list of support type per proposal IDs to cast. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast for each proposal (the same for all of them). |
castVotesBySig
Allows a signer to cast votes on multiple proposals via an ECDSA secp256k1 signature.
Parameters
Name | Type | Description |
---|---|---|
|
| The list of unique proposal IDs being voted on. |
|
| The list of support type per proposal IDs to cast. |
|
| An ECDSA secp256k1 signature parameter. |
|
| An ECDSA secp256k1 signature parameter. |
|
| An ECDSA secp256k1 signature parameter. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast for each proposal (the same for all of them). |
castVotesBySig
Allows a signer to cast votes on multiple proposals via an arbitrary signature.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account casting the votes. |
|
| The list of unique proposal IDs being voted on. |
|
| The list of support type per proposal IDs to cast. |
|
| An arbitrary signature |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast for each proposal (the same for all of them). |
castVotesWithReason
Allows the caller to cast votes with reason on multiple proposals.
Parameters
Name | Type | Description |
---|---|---|
|
| The list of unique proposal IDs being voted on. |
|
| The list of support type per proposal IDs to cast. |
|
| The list of reason per proposal IDs to cast. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast for each proposal (the same for all of them). |
castVotesWithReasonBySig
Allows a signer to cast votes with reason on multiple proposals via an ECDSA secp256k1 signature.
Parameters
Name | Type | Description |
---|---|---|
|
| The list of unique proposal IDs being voted on. |
|
| The list of support type per proposal IDs to cast. |
|
| The list of reason per proposal IDs to cast. |
|
| An ECDSA secp256k1 signature parameter. |
|
| An ECDSA secp256k1 signature parameter. |
|
| An ECDSA secp256k1 signature parameter. |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast for each proposal (the same for all of them). |
castVotesWithReasonBySig
Allows a signer to cast votes with reason on multiple proposals via an arbitrary signature.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account casting the votes. |
|
| The list of unique proposal IDs being voted on. |
|
| The list of support type per proposal IDs to cast. |
|
| The list of reason per proposal IDs to cast. |
|
| An arbitrary signature |
Returns
Name | Type | Description |
---|---|---|
|
| The number of votes cast for each proposal (the same for all of them). |
getBallotDigest
Returns the ballot digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Name | Type | Description |
---|---|---|
|
| The unique proposal ID being voted on. |
|
| The type of support to cast for the proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The digest to be signed. |
getBallotsDigest
Returns the ballots digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Name | Type | Description |
---|---|---|
|
| The list of unique proposal IDs being voted on. |
|
| The list of support type per proposal IDs to cast. |
Returns
Name | Type | Description |
---|---|---|
|
| The digest to be signed. |
getBallotWithReasonDigest
Returns the ballot with reason digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Name | Type | Description |
---|---|---|
|
| The unique proposal ID being voted on. |
|
| 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 digest to be signed. |
getBallotsWithReasonDigest
Returns the ballots with reason digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Name | Type | Description |
---|---|---|
|
| The list of unique proposal IDs being voted on. |
|
| The list of support type per proposal IDs to cast. |
|
| The list of reason per proposal IDs to cast. |
Returns
Name | Type | Description |
---|---|---|
|
| The digest to be signed. |
hashProposal
Returns the unique identifier for the proposal if it were created at this exact moment.
Parameters
Name | Type | Description |
---|---|---|
|
| The single call data used to call this governor upon execution of a proposal. |
Returns
Name | Type | Description |
---|---|---|
|
| The unique identifier for the proposal. |
voteToken
Returns the EIP-5805 token contact used for determine voting power and total supplies.
BALLOTS_TYPEHASH
Returns the EIP712 typehash used in the encoding of the digest for castVotesBySig
function.
BALLOTS_WITH_REASON_TYPEHASH
Returns the EIP712 typehash used in the encoding of the digest for castVotesWithReasonBySig
function.
Errors
AlreadyVoted
Revert message when a voter is trying to vote on a proposal they already voted on.
ArrayLengthMismatch
Revert message when input arrays do not match in length.
EmptyProposalIdsArray
Revert message when the proposal IDs array is empty.
ExecutionFailed
Revert message when execution of a proposal fails.
Parameters
Name | Type | Description |
---|---|---|
|
| The revert data returned due to the failed execution. |
InvalidCallData
Revert message when a proposal's call data is not specifically supported.
InvalidCallDatasLength
Revert message when a proposal's call data array is not of length 1.
InvalidTarget
Revert message when a proposal target is not this governor itself.
InvalidTargetsLength
Revert message when a proposal's targets array is not of length 1.
InvalidValue
Revert message when a proposal value is not 0 ETH.
InvalidValuesLength
Revert message when a proposal's values array is not of length 1.
InvalidVoteStart
Revert message when a an invalid vote start is detected.
InvalidVoteTokenAddress
Revert message when the vote token specified in the constructor is address(0).
NotSelf
Revert message when the caller of a governance-controlled function is not this governor itself.
ProposalCannotBeExecuted
Revert message when the proposal information provided cannot be executed.
ProposalDoesNotExist
Revert message when the proposal does not exist.
ProposalExists
Revert message when the proposal already exists.
ProposalInactive
Revert message when voting on a proposal that is not in an active state (i.e. not collecting votes).
Parameters
Name | Type | Description |
---|---|---|
|
| The current state of the proposal. |
ZeroVotingPower
Revert message when voting on a proposal with a zero voting weight.
Enums
VoteType
The type of support to cast for a proposal.