Check participation rate on referendum 1%
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 37s Details

This commit is contained in:
Ladd Hoffman 2024-03-28 18:04:28 -05:00
parent e95a8c0cb9
commit 13a88767bd
1 changed files with 6 additions and 4 deletions

View File

@ -152,11 +152,13 @@ contract Proposals is DAOContract, IOnValidate {
// Make a record of this result
pool.stakedFor = stakedFor;
pool.stakedAgainst = stakedAgainst;
// Participation threshold of 50%
bool participationAboveThreshold = 2 * (stakedFor + stakedAgainst) >=
dao.totalSupply();
// Handle Referendum 0%
if (proposal.stage == Stage.Referendum0) {
bool participationAboveThreshold = 2 *
(stakedFor + stakedAgainst) >=
dao.totalSupply();
// If vote passes (2/3 majority) and has >= 50% participation
if (votePasses && participationAboveThreshold) {
proposal.stage = Stage.Referendum1;
@ -168,7 +170,7 @@ contract Proposals is DAOContract, IOnValidate {
}
// Handle Referendum 1%
} else if (proposal.stage == Stage.Referendum1) {
if (votePasses) {
if (votePasses && participationAboveThreshold) {
proposal.stage = Stage.Referendum100;
} else if (referendum.retryCount[1] >= 3) {
proposal.stage = Stage.Failed;