CompoundVotingMachine
CompoundVotingMachine based on Compound's governance with a few differences.
Last updated
CompoundVotingMachine based on Compound's governance with a few differences.
Last updated
The differences between CompoundVotingMachine and Compound's governance:
no timelock, once vote has passed it stays open for 'queuePeriod' (2 days by default), if vote decision has changed, execution will be delayed so at least 24 hours are left to vote;
execution modified to support DAOStack Avatar/Controller.
The contract based on GovernorAlpha.
An event emitted when a new proposal is created.
Parameter name | Annotation |
---|---|
An event emitted when using blockchain proposal bridge.
Emitted when proposal made for a different blockchain.
An event emitted when a vote has been cast on a proposal.
An event emitted when a proposal has been canceled.
An event emitted when a proposal has been queued.
An event emitted when a proposal has been executed.
An event emitted when a proposal call has been executed.
An event emitted when a new guardian set.
An event emitted when a new voting parameters set.
Here's the per index description of each parameter.
The function creates a proposal to be voted on.
Returns: the ID of a newly created proposal.
Also here's an overloaded variant of the function with additional parameter forBlockchain
. The parameter is used to create a proposal in a specific sidechain.
The function is to execute the proposal list of transactions.
Anyone can call this once it's ETA has arrived.
The function is to cancel a proposal. In case if a proposer are no longer hold the votes that were required to propose.
The function is to get the current status of a proposal.
The ProposalState
enum is:
The function is to cast the users vote on a proposal.
The function is to return the chain ID on which the contract was deployed.
The function allows anyone to emit details about proposal that passed. Can be used for cross-chain proposals using blockheader proofs.
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Index | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Field name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
id
The ID of the proposal.
proposer
The address of the proposer.
targets
The targets list of contracts to be executed on.
values
The list of native token value to be used in each contract call.
signatures
The list of functions signatures to execute on targets
.
calldatas
The list of parameters to pass to each function in signatures
.
startBlock
Starting block number of voting.
endBlock
Ending block number of voting.
description
Short description of the proposal.
id
The ID of the proposal.
proposer
The address of the proposer.
targets
The targets list of contracts to be executed on.
values
The list of native token value to be used in each contract call.
signatures
The list of functions signatures to execute on targets
.
calldatas
The list of parameters to pass to each function in signatures
.
startBlock
Starting block number of voting.
endBlock
Ending block number of voting.
forBlockchain
The chain ID.
eta
An exact time of the proposal bridging.
forVotes
An amount of vote power "FOR".
againstVotes
An amount of vote power "AGAINST".
id
The ID of the proposal.
forBlockchain
The chain ID of the blockchain proposal made for.
voter
The voter address.
proposalId
The proposal ID for which the vote was cast.
support
Check whether the vote cast was "FOR" or "AGAINST".
votes
The amount of voting power for the vote cast.
id
The ID of the proposal.
id
The ID of the proposal.
eta
The timestamp of the queueing.
id
The ID of the proposal.
id
The ID of the proposal.
index
The index of the target contract from proposal.
ok
The status of the proposal call.
result
The result of the proposal call.
newGuardian
The new guardian address.
params
The voting parameters.
0
The default voting period.
1
The default quorum percentage.
2
The proposal percentage.
3
The proposal max operations.
4
The delay in blocks before the newly created proposal would work.
5
The duration of time (in seconds) after proposal passed thershold before it can be executed.
6
The duration of time (in seconds) after proposal passed with absolute majority before it can be executed.
7
During the queue period if vote decision has changed, the queue period time duration is extended so that at least this amount of time in seconds is left.
8
The duration of time (in seconds) a succeeded proposal has to be executed on the blockchain.
targets
The address of the contracts on which proposal actions should be executed.
values
The amounts of native tokens that should be sent to the targets
addresses.
signatures
The function selectors (signatures) that should be called as proposals actions should a proposal succeed.
calldatas
The call arguments for the signatures
.
description
The short description of a proposal.
proposalId
The ID of the proposal that should be executed.
proposalId
The ID of the proposal that should be canceled.
proposalId
The ID of the proposal that should be canceled.
Pending
The proposal is pending.
Active
The proposal is pending and voters can vote now.
ActiveTimelock
The proposal is pending and passed quorum, time lock of 2 days activated, still open for voting.
Canceled
The proposal is canceled.
Defeated
The voters voted against.
Succeded
The voters voted for.
Expired
The proposal time has passed. And it's no longer votable for.
Executed
The proposal transactions has been executed.
proposalId
The ID of the proposal.
support
Is the vote "FOR" or "AGAINST".
proposalId
The ID of the proposal.