This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
lockDuration
of mlumStaking
positions) during vote()
opening up the ability to double vote with same funds in the same period.
#75
Hunter
High
unchecked (finished
lockDuration
ofmlumStaking
positions) duringvote()
opening up the ability to double vote with same funds in the same period.Summary
unchecked (finished
lockDuration
ofmlumStaking
positions) duringvote()
invoter
contract opening up the ability to double vote with same funds in the same period.Vulnerability Detail
in
vote()
we see that in Line #167 we revert if the user has voted before in this Period
in Lines #172,#175 we check that
lockDuration
andinitialLockDuration
are larger than_periodDuration
(14 days) and_minimumLockTime
respectivelyTo give more context about
lockDuration
from_mlumStaking
mlum
and is capped at 365 Days ( to prevent very high multipliers)amountWithMultiplier
that is used for rewards calculations - and voting power retreivals as seen in Line tedox - Users can double their voting power insideVoter.sol
#179The problem here comes from the fact that there is no check for finished
lockDuration
ofmlumStaking
positions and i will describe with an example whymlumStaking
position nor renewed itfully
and destroy his position (burning thetokenId
that he voted with before)tokenId
that is not registerd in_hasVotedInPeriod
mappingImpact
now this has alot of impacts
BribeRewarder
contract connected to that Poolmlum
emmissionsCode Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/7fd1a65b76d50f1bf2555c699ef06cde2b646674/magicsea-staking/src/Voter.sol#L153-L219
Tool used
Manual Review
Recommendation
check if
position.startLockTime + position.lockDuration) <= _currentBlockTimestamp()
revert the vote() with errorrenew your lock
or you need to make sure that
position.startLockTime + position.lockDuration)
will be less than_currentBlockTimestamp()
and will be less than the end time of voting periodDuplicate of #166
The text was updated successfully, but these errors were encountered: