background
With the releasing of X-REF token at mid of Jan, 2022, we need broaden X-REF usage besides of just staking for reward. To enable X-REF holders taking part in some governance events maybe an interesting idea. Cause X-REF holder can be seen as valuable supporters of ref project and their opinion on governance events should be seriously taken care of.
demands for referendum
Currently, we use SputnikDao to process on-chain governance. Truely it is powerful, but there are two requirements it cann’t fulfill:
- support votes directly from tons of users;
- support votes using voting token weigted by locking period;
They are exactly what we want to deliver in X-Referendum.
basic concepts
- session, each session lasts 30 days;
- proposal, a referendum valid in a single session, possible states include [WarmUp, InProgress, Approved, Rejected, Nonsense, Expired];
- token and ballot, users lock token to get ballot for voting, the longer they lock, the more ballots they got;
- vote, can vote any InProgress proposal for approve, reject even nonsense, which means the proposal is sort of a spam, and endorsement NEAR for that proposal would be slashed ( to resist proposal flood attack).
roles and actions
users
- can lock token to get ballots,
- they can choose to lock 1 to 24 sessions. Eg:
1 X-REF for 1 session locking got 1 ballot, but 24 ballots for a 24 sessions locking; - All users share the same 24 sessions locking period. If a user locks his X-REF in the middle of some session, he gets propotional ballots for that session. Eg:
Assume we are now at mid of some session, like 15 days passes the beginning of the session.
Now, Alice locks 10 X-REF for 6 sessions(half year) , then she actually got 1 * 10 * 0.5 + 5 * 10 = 55 ballots. And she can unlock her 10 X-REF 165 days later.
- they can choose to lock 1 to 24 sessions. Eg:
- can withdraw their unlocked token;
- can vote for any InProgress proposal with the whole amount of their ballots;
Proposer
- can create a proposal,
- must deposit a fixed amount of NEAR as endorsement,
- can choose a voting policy, (Relative Voting or Absolute Voting),
- can set begin and end time,
Before begin time, the proposal is in WarmUp state, proposer can remove it, makes any changs and re-create again.
After end time, if the proposal hasn’t reach any final state (approved, rejected, nonsense), it will reach expired state.
- can remove a WarmUp proposal for modification or other purpose.
- can redeem his endorsement NEAR for an expired proposal.
Owner
- can modify details of vote policies.
- can modify request amount of endorsement NEAR.
- can transfer his ownership to other one.
Vote Policy
There are two vote policies and a global nonsense threshold.
Relative Voting
A threshold for minimum voting ratio, and another one for any opinion to defeat others. Eg:
30% and 50% means we need more than 30% ballots to voting and the opinion got more than 50% in total votes win.
Absolute Voting
A threshold for approve and another one for reject, both based on total valid ballots. Eg:
55% and 30% means we need more than 55% ballots to approve but only 30%+ ballots to reject it.
nonsense threshold
it is based on total valid ballots and forced to apply on each proposal. Eg:
45% means once 45%+ ballots vote for nonsense, the proposal goes to nonsense state and endorsement NEAR would be slashed.
Extension
besides referendum, we can also extend it into investigation mode. user would not be limited to simply approve and reject, but has more options to choose.