This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
scammed - Voter::startNewVotingPeriod lacks check if the current voting period has ended #504
Labels
Non-Reward
This issue will not receive a payout
scammed
Medium
Voter::startNewVotingPeriod lacks check if the current voting period has ended
Summary
Voter::startNewVotingPeriod()
does not check if_currentVotingPeriodId
has ended.Vulnerability Detail
The owner can start new voting periods with
startNewVotingPeriod()
, but the function does not check if the current one has ended, which will make the contract logic inconsistent, as well asBribeRewarder.sol
's logic, which is based on the duration of the period.Impact
Period rewards can remain locked as they are based on
_periodDuration
.Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/42e799446595c542eff9519353d3becc50cdba63/magicsea-staking/src/Voter.sol#L107-L115
Tool used
Manual Review
Recommendation
Add a check that the
timestamp
when callingstartNewVotingPeriod
is after_currentVotingPeriodId.endTime
.The text was updated successfully, but these errors were encountered: