Developer Guides
Governor C
allows the deployment on-chain voting system using PQV, with respect to Compound's Governor Alpha & Bravo interface.
Hardcoded Parameters
Proposal Threshold
Addresses with more than 50,000 COMP (or any ERC20 token registered by function initialize
) can invoke proposal. This threshold can be changed by admin within the range of [50000, 100000].
Voting Period
After starting of the proposal, COMP holders can submit their votes during a voting period. The voting period can be changed by admin within the range of [5760, 80640] Ethereum blocks.
Each blockchain has a different block interval. Even at the same protocol, it can be changed after a hardfork.
Voting Delay
Users allow to vote for the proposal after a certain delay. The voting delay can be changed by admin within the range of [1, 40320] Ethereum blocks.
Quorum
According to majority, at least 400,000 votes are cast for the proposal to execute.
Max Operations per Proposal
The maximum number of actions that can be included in one proposal. Each action is same as booked function-call belongs to the proposal.
Storage
New Proposal State: Unfinalized
Enumerated type ProposalState
. The types are Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed, and Unfinalized.
Unfinalized state refers to a status in which casting has been completed but votes aggregation has not yet begun. It is changed into Defeated or Succeeded after executing the finalized
function.
Chainlink VRF
Governor C uses Chainlink VRF v1.
Fee
Fee
is required to fulfill a VRF request. Therefore, the contract should own enough LINK to pay the specified fee.
Fee
varies by network. To prepare for changes in fee, Governor C provides a fee update function. The admin can change the VRF request fee.
Request Randomness
Those functions invoke Chainlink's requestRandomness
, which makes the initial request for randomness.
PQV
Probabilistic Element
Probabilistic element is calculated by . The default value is . The higher , the more similar to the result of QV. Details are here: PQV EVALUATION - Change of similarity according to change of PQV probabilistic element.
The admin can change by assigning new expN
and expD
.
Expectation Value
pqvExpect
gets expectation value of for, against, and abstain votes before finalizing proposal. It also returns bool of a proposal's success or failure.
Finalize
Finalizes an active proposal. After the proposal is finalized, votes aggregation is triggered and its state is changed into either Defeated or Succeeded.
Implementation
Last updated