Governance
Introduction
JustLend DAO protocol is governed and upgraded by JST holders. There are three components included in the governance system: JST(WJST) token, governance module(GovernorBravo) and Timelock. The governance of the JustLend DAO protocol is through proposals, whose process can be summarized as proposal posting-voting-taking effect.
Governance Parameters
Param | Value | Description |
---|---|---|
quorumVotes | 600000000 | The least for-votes for a proposal to take effect |
votingPeriod | 86400 | Voting duration(block counts), can be changed by proposals |
proposalThreshold | 200000000 | The least votes that a proposer must possess, can be changed by proposals |
votingDelay | 1 | The waiting duration before voting starts(block counts) |
proposalMaxOperations | 10 | Action maximum within a proposal |
proposalCount | 11 | Current proposal count |
JST & WJST
JST can be exchanged for WJST token at a 1:1 ratio. WJST can be used to vote for proposals.
Governance Process
An account must possess at least 200,000,000 votes to create governance proposals. When a proposal is created, the voting period starts and will last for 86,400 block times(approx. 3 days). If a majority of affirmation and at least 600,000,000 votes are cast for the proposal, the proposal will wait for 2 days(according to Timelock.delay, the current value is 172,800s) to take into effect.
Solidity API
Proposals
propose() / Contract: GovernorBravo
Calling this method creates a proposal to change & update the JustLend DAO protocol.
Parameter description:
Parameter | Type | Description |
---|---|---|
targets | address[] | Target addresses for calls to be made during proposal execution |
values | uint[] | Values to be passed to the calls |
signatures | string[] | Function signatures |
calldatas | bytes[] | Data for each function |
description | string | A Readable message of what exactly the proposal changes |
Returns: The ID of this proposal
queue() / Contract: GovernorBravo
Calling this method moves a successful proposal into the Timelock waiting period. The waiting period begins when this method is successfully called.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the successful proposal |
Returns: None, reverts on error.
execute() / Contract: GovernorBravo
Calling this method executes the proposal whose waiting period has already been ended. Actions in the proposal will be invoked during the execution.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the proposal to be executed |
Returns: None, reverts on error.
cancel() / Contract: GovernorBravo
Calling this function cancels a proposal. A proposal can be cancelled at any time prior to its execution.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the proposal to be cancelled |
Returns: None, reverts on error.
getActions() / Contract: GovernorBravo
Calling this method gets the actions of an exact proposal.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the proposal |
Return Values:
Returns | Type | Description |
---|---|---|
targets | address[] | Target addresses for calls to be made during proposal execution |
values | uint[] | Values to be passed to the calls |
signatures | string[] | Function signatures |
calldatas | bytes[] | Data for each function |
getReceipt() / Contract: GovernorBravo
Calling this method gets the votes of a specified voter on a proposal.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the specified proposal |
voter | address | Address of the specified account |
Return Values:
Returns | Type | Description |
---|---|---|
Receipt | struct | bool hasVoted // voted or not bool support // for or against uint96 votes //vote count |
state() / Contract: GovernorBravo
Calling this method returns the state of a specified proposal.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the specified proposal |
Return Values:
Returns | Type | Description |
---|---|---|
ProposalState | enum | Pending Active Canceled Defeated Succeeded Queued Expired Executed |
Poll & Vote
deposit() / Contract: WJST
Calling this method exchanges JST for WJST at a one-to-one ratio.
Parameter description:
Parameter | Type | Description |
---|---|---|
sad | uint256 | Number of votes(WJST) to exchange |
Returns: None, reverts on error
castVote() / Contract: GovernorBravo
Calling this method casts a vote on a proposal. The voting weight will be calculated at the time the proposal's state becomes active.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the proposal to vote |
votes | uint | Number of the votes to be cast |
support | bool | For or against |
Returns: None, revers on error.
castVoteWithReason() / Contract: GovernorBravo
Calling this method casts a vote on a proposal. The reason can be submitted simultaneously.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the proposal to vote |
votes | uint | Number of the votes to be cast |
support | bool | For or against |
reason | string | voting reason |
Returns: None, revers on error.
castVoteBySig() / Contract: GovernorBravo
Calling this method casts votes on a specified proposal. Comparing with castVote()
, this method allows offline signature.
Parameter description:
Parameter | Type | Description |
---|---|---|
proposalId | uint | ID of the proposal to vote |
votes | uint | Number of the votes to be cast |
support | bool | For or against |
v | uint8 | Recover byte of the signature |
r | bytes32 | Half of the ECDSA signature pair |
s | bytes32 | Half of the ECDSA signature pair |
Returns: None, reverts on error.
Last updated