-
A Participant must call either
lockDGD/withdrawDGD
orconfirmContinuedParticipation
to participate in a quarter (and deemed a "Participant", which meansDaoCommon.isParticipant(user) == true
) -
lastParticipatedQuarter
is always the most recent quarter that a user has participated/is participating. It is only set when userlockDGD/withdrawDGD/confirmContinuedParticipation
-
As long as calculateGlobalRewardsBeforeNewQuarter() has finished in a quarter, sum of all participants'
lockedDGDStake
must always be exactly the same astotalLockedDGDStake
(inDaoStakeStorage
contract) -
As long as calculateGlobalRewardsBeforeNewQuarter() has finished in a quarter, sum of all moderators'
lockedDGDStake
must be exactly the same astotalModeratorLockedDGDStake
-
After ANY step where a participant's Reputation or DGDStake is changed, except for when a user receives a bonus from voting, or when user locks in DGDs the first time (and hence getting the bonus reputation from carbon votes),
refreshModeratorStatus()
must be called -
Before ANY step where a participant's DGD stake is changed,
refreshDGDStake
must be called -
In any quarter after the first quarter,
calculateGlobalRewardsBeforeNewQuarter()
must finish first (returns true) before ANY other activities in the DAO can happen, except for:
DaoFundingManager.claimFunding()
- functions in
DaoIdentity
andDaoWhitelisting
Dao.updatePRL()
Dao.setNewDaoContracts()
Dao.founderCloseProposals()
-
updateRewardsAndReputationBeforeNewQuarter()
can only and must be called by the 3 staking functions (lock/withdraw/continue). -
After a participant doing ANY action using
DaoStakeLocking
contract in a locking phase of a quarter, hislastQuarterThatReputationWasUpdated
is ALWAYScurrentQuarter - 1
-
lastQuarterThatRewardsWasUpdated
is either:- 0, when a user has not participated at all, or has participated for quarter X but the rewards calculation for quarter X has not been done (
updateUserRewardsForLastParticipatingQuarter
has not been called in a subsequent quarter after X) - exactly the same as
lastParticipatedQuarter
, when the rewards calculation for thelastParticipatedQuarter
has been done - same as
previousLastParticipatedQuarter
, when the user has participated inlastParticipatedQuarter
but the rewards has not been calculated for thelastParticipatedQuarter
- 0, when a user has not participated at all, or has participated for quarter X but the rewards calculation for quarter X has not been done (
-
The sum of all users' DGX rewards for quarter N, calculated using
calculateUserRewardsForLastParticipatingQuarter()
when theirlastParticipatedQuarter == N
, must be exactly equal to thedgxRewardsPoolLastQuarter
of quarter N+1 (in other words, the dgx rewards pool of quarter N). Likewise, the sum of all users' dgxRewardsAsModerator should add up to the moderator rewards pool (CONFIG_PORTION_TO_MODERATORS_NUM/CONFIG_PORTION_TO_MODERATORS_DEN * dgxRewardsPool)- There will be rounding error, which must only be in the order of 1e-9
-
When a participant's rewards is calculated for a quarter N that he last participated in, his current
Reputation
andlockedDGDStake
must be exactly the same as hisReputation
andlockedDGDStake
when calculateGlobalRewardsBeforeNewQuarter() was called in quarter N+1.- Otherwise, the previous invariant will not hold
-
No matter what the circumstances, any participant will be able to:
- withdraw all their DGDs in any locking phase, or after the DAO is migrated
- lock DGDs and participate in DAO activities (creating proposals/voting) in any quarter.
- withdraw all of their claimableDGXs, minus the appropriate demurrage fees
-
The collateral can only be claimed back in these scenarios:
- Before the proposal is finalized, by calling closeProposal()
- The proposal is failed in either Draft Voting phase or Voting phase (index 0)
- After all milestones are done and the final voting round is passed
-
The number of non-Digix proposals that goes through the Voting Round (VotingRound index 0) in a particular quarter must be <= get_uint_config(CONFIG_NON_DIGIX_PROPOSAL_CAP_PER_QUARTER)
-
Except for the whitelisted contracts in
DaoWhitelistingStorage
, no other contracts can read any information that gives away:- whether any voting round is passed or not.
- whether a participant has voted yes or no in a particular voting round
This is to prevent bribing contracts from verifying on-chain that a vote seller has indeed voted as instructed/ a voting has indeed passed/failed
-
As long as the Dao is not replaced yet,
calculateGlobalRewardsBeforeNewQuarter()
must always be able to run in the beginning of the quarter and every DGD holders who have locked in DGDs at some point will be able to withdraw all of their DGDs