BatchGovernor
Inherits: IBatchGovernor, ERC712Extended
Author: M^0 Labs
State Variables
_SELECTOR_PLUS_0_ARGS
Length constant for calldata with no argument.
_SELECTOR_PLUS_1_ARGS
Length constant for calldata with one argument.
_SELECTOR_PLUS_2_ARGS
Length constant for calldata with two arguments.
_SELECTOR_PLUS_3_ARGS
Length constant for calldata with three arguments.
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.
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.
voteToken
Returns the EIP-5805 token contact used for determine voting power and total supplies.
_proposals
The list of proposals per proposal ID.
hasVoted
Returns whether account
has voted on the proposal with identifier proposalId
.
Functions
onlySelf
Reverts if the caller is not the contract itself.
constructor
Construct a new BatchGovernor contract.
Parameters
castVote
Allows the caller to cast a vote on a proposal with id proposalId
.
Parameters
Returns
castVotes
Allows the caller to cast votes on multiple proposals.
Parameters
Returns
castVoteWithReason
Allows the caller to cast a vote with reason on a proposal with id proposalId
.
Parameters
Returns
castVotesWithReason
Allows the caller to cast votes with reason on multiple proposals.
Parameters
Returns
castVoteBySig
Allows a signer to cast a vote on a proposal with id proposalId
via an ECDSA secp256k1 signature.
Parameters
Returns
castVoteBySig
Allows a signer to cast a vote on a proposal with id proposalId
via an ECDSA secp256k1 signature.
Parameters
Returns
castVotesBySig
Allows a signer to cast votes on multiple proposals via an ECDSA secp256k1 signature.
Parameters
Returns
castVotesBySig
Allows a signer to cast votes on multiple proposals via an ECDSA secp256k1 signature.
Parameters
Returns
castVoteWithReasonBySig
Allows a signer to cast a vote with reason on a proposal with id proposalId
via an ECDSA secp256k1 signature.
Parameters
Returns
castVoteWithReasonBySig
Allows a signer to cast a vote with reason on a proposal with id proposalId
via an ECDSA secp256k1 signature.
Parameters
Returns
castVotesWithReasonBySig
Allows a signer to cast votes with reason on multiple proposals via an ECDSA secp256k1 signature.
Parameters
Returns
castVotesWithReasonBySig
Allows a signer to cast votes with reason on multiple proposals via an ECDSA secp256k1 signature.
Parameters
Returns
hashProposal
Returns the unique identifier for the proposal if it were created at this exact moment.
Parameters
Returns
hashProposal
Returns the unique identifier for the proposal if it were created at this exact moment.
Parameters
Returns
name
Returns the name of the contract.
proposalDeadline
Returns the last clock value when voting on the proposal with identifier proposalId
is allowed.
Parameters
Returns
proposalProposer
Returns the account that created the proposal with identifier proposalId
.
Parameters
Returns
proposalSnapshot
Returns the clock value used to retrieve voting power to vote on proposal with identifier proposalId
.
Parameters
Returns
proposalVotes
Returns the vote support totals for the proposal with identifier proposalId
.
Parameters
Returns
token
Returns the EIP-5805 token contact used for determine voting power and total supplies.
CLOCK_MODE
Returns a machine-readable string description of the clock the contract is operating on.
proposalThreshold
Returns the required voting power an account needs to create a proposal.
clock
Returns the current timepoint according to the mode the contract is operating on.
getBallotDigest
Returns the ballot digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Returns
getBallotsDigest
Returns the ballots digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Returns
getBallotWithReasonDigest
Returns the ballot with reason digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Returns
getBallotsWithReasonDigest
Returns the ballots with reason digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Returns
getVotes
Returns the voting power of account
at clock value timepoint
.
Parameters
Returns
state
Returns the state of a proposal with identifier proposalId
.
Parameters
Returns
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.
_castVotes
Cast votes on several proposals for voter_
.
Parameters
Returns
_castVote
Cast votes on proposal for voter_
.
Parameters
Returns
_castVote
Cast weight_
votes on a proposal with id proposalId_
for voter_
.
Parameters
_createProposal
Creates a new proposal with the given parameters.
Parameters
_execute
Executes a proposal given its call data and voteStart (which are unique to it).
Parameters
Returns
_propose
Internal handler for making proposals.
Parameters
Returns
_tryExecute
This function tries to execute a proposal based on the call data and a range of possible vote starts. This is needed due to the fact that proposalId's are generated based on the call data and vote start time, and so an executed function will need this in order to attempt to find and execute a proposal given a known range of possible vote start times which depends on how the inheriting implementation determines the vote start time and expiry of proposals based on the time of the proposal creation.
Parameters
Returns
_clock
Returns the current timepoint according to the mode the contract is operating on.
_getTotalSupply
Returns the vote token's total supply at timepoint_
.
Parameters
Returns
_voteStart
Returns the timepoint at which voting would start for a proposal created in current timepoint.
_getVoteEnd
Returns the timepoint at which voting would end given a timepoint at which voting would start.
Parameters
Returns
_getBallotDigest
Returns the ballot digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Returns
_getBallotsDigest
Returns the ballots digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Returns
_getBallotWithReasonDigest
Returns the ballot with reason digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Returns
_getBallotsWithReasonDigest
Returns the ballots digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Returns
_getReasonListHash
Returns the hash of the reason list to be used in the ballots digest.
Parameters
Returns
_hashProposal
Returns the unique identifier for the proposal if it were created at this exact moment.
Parameters
Returns
_hashProposal
Returns the unique identifier for the proposal if it were to have a given vote start timepoint.
Parameters
Returns
_revertIfNotSelf
Reverts if the caller is not the contract itself.
_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.
_revertIfInvalidCalldata
All proposals target this contract itself, and must call one of the listed functions to be valid.
Parameters
_revertIfInvalidProposal
Reverts if the proposal arguments are invalid.
Parameters
Structs
Proposal
Proposal struct for storing all relevant proposal information.
Properties