Tricky Pebble Dachshund - Owner can by mistake rollover to a new voting period while previous period is active, users could loose bribe rewards due to deprived participation #696
Owner can by mistake rollover to a new voting period while previous period is active, users could loose bribe rewards due to deprived participation
Summary
The owner can roll over the voting session unintentionally by clicking on startNewVotingPeriod() function. This will replace the context of _currentVotingPeriodId, then it will not create enough opportunity for all eligible users to participate in the voting.
Vulnerability Detail
Current Voting period is the context when votes are casted and bribes are accounted. If the current voting period is amended before it expires replacing it with a new voting period, then users who did not vote yet will be deprived of the opportunity to earn bribe rewards.
In summary, there is a possibility that the voter contract is not honouring the voting period time window. This is unfair to those who assumed the time window for voting was 14 days.
While owner is responsible, the problem exists because there is no way for owner to correct this error.
Tricky Pebble Dachshund
Low/Info
Owner can by mistake rollover to a new voting period while previous period is active, users could loose bribe rewards due to deprived participation
Summary
The owner can roll over the voting session unintentionally by clicking on
startNewVotingPeriod()
function. This will replace the context of_currentVotingPeriodId
, then it will not create enough opportunity for all eligible users to participate in the voting.Vulnerability Detail
Current Voting period is the context when votes are casted and bribes are accounted. If the current voting period is amended before it expires replacing it with a new voting period, then users who did not vote yet will be deprived of the opportunity to earn bribe rewards.
In summary, there is a possibility that the voter contract is not honouring the voting period time window. This is unfair to those who assumed the time window for voting was
14 days
.While owner is responsible, the problem exists because there is no way for owner to correct this error.
Impact
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L107-L115
Tool used
Manual Review
Recommendation
The
startNewVotingPeriod
function should have a validation criteria to ensure that there is no active voting period before creating a new one.