You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In extreme scenarios where the total staking amount is zero or extremely small, the quorum calculation will allow proposals to almost always pass. Because the quorum is calculated relative to total stake, if that stake is zero, any proposal effectively meets the quorum threshold. Consequently, proposals can be accepted without receiving any meaningful support.
In this case, requiredExceeding will be 0 as long as totalStakedAmount is small enough (less than 5000).
Impact:
With zero or negligible total stake,the quorum requirements and thresholds do not provide any meaningful resistance or require actual consensus.
Proof of Concept:
Execute the following test by running forge test --mt testQuorumCalculationWithZeroOrSmallTotalStake -vv:
functiontestQuorumCalculationWithZeroOrSmallTotalStake()public{addressproposer=users[2];// Create a proposaladdress[]memorytargets=newaddress[](1);targets[0]=users[1];uint256[]memoryvalues=newuint256[](1);values[0]=100ether;bytes[]memorycallDatas=newbytes[](1);callDatas[0]="";uint256proposalId=createProposal(proposer,"Test Proposal",targets,values,callDatas);// No validators added, total stake is zero// Switch to Voting phaseswitchPhase();// No votes cast// Switch phase to end VotingswitchPhase();// Finalize proposaldao.finalize(proposalId);// Check proposal stateProposalmemoryproposal=dao.getProposal(proposalId);// Proposal is accepted// @note Basically, when total stakes are 0 or very small at the time of quorum calculation, any proposal will get accepted (as long as Yes >= No)assertEq(uint256(proposal.state),uint256(ProposalState.Accepted));}
Recommendation:
Ensure that proposals cannot pass without 0 votes.
Consider implementing a base quorum that is independent of the total staked amount.
The text was updated successfully, but these errors were encountered:
MSalman6
added a commit
to MSalman6/diamond-contracts-dao
that referenced
this issue
Jan 2, 2025
Severity: Low
Likelihood: Low
Description:
In extreme scenarios where the total staking amount is zero or extremely small, the quorum calculation will allow proposals to almost always pass. Because the quorum is calculated relative to total stake, if that stake is zero, any proposal effectively meets the quorum threshold. Consequently, proposals can be accepted without receiving any meaningful support.
In this case,
requiredExceeding
will be 0 as long astotalStakedAmount
is small enough (less than5000
).Impact:
With zero or negligible total stake,the quorum requirements and thresholds do not provide any meaningful resistance or require actual consensus.
Proof of Concept:
Execute the following test by running
forge test --mt testQuorumCalculationWithZeroOrSmallTotalStake -vv
:Recommendation:
The text was updated successfully, but these errors were encountered: