πŸ‘©β€πŸ’»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

    /// @notice The minimum setable proposal threshold
    uint public constant MIN_PROPOSAL_THRESHOLD = 50000e18; // 50,000 Comp

    /// @notice The maximum setable proposal threshold
    uint public constant MAX_PROPOSAL_THRESHOLD = 100000e18; //100,000 Comp

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

    /// @notice The minimum setable voting period
    uint public constant MIN_VOTING_PERIOD = 5760; // About 24 hours

    /// @notice The max setable voting period
    uint public constant MAX_VOTING_PERIOD = 80640; // About 2 weeks

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.

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.

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 ee

Probabilistic element ee is calculated by expNexpD\frac{exp_N}{exp_D}. The default value is 1.051.05. The higher ee, the more similar to the result of QV. Details are here: PQV EVALUATION - Change of similarity according to change of PQV probabilistic element.

Results

The admin can change ee 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