From 13a88767bd988c56f978ba8e6a3aa31c22247149 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Thu, 28 Mar 2024 18:04:28 -0500 Subject: [PATCH] Check participation rate on referendum 1% --- ethereum/contracts/Proposals.sol | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ethereum/contracts/Proposals.sol b/ethereum/contracts/Proposals.sol index 292a08c..0a8f5cd 100644 --- a/ethereum/contracts/Proposals.sol +++ b/ethereum/contracts/Proposals.sol @@ -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;