This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
0xBhumii - Lack of Validation for Updating Minimum Lock Time in Voting Contract #419
Labels
Non-Reward
This issue will not receive a payout
0xBhumii
High
Lack of Validation for Updating Minimum Lock Time in Voting Contract
Summary
The
Voter
contract allows the owner to update the minimum lock time for voting eligibility without any validation checks or restrictions. This can lead to a situation where users who have locked their tokens for the initial minimum period may lose their voting power if the minimum lock time is increased. This issue can result in users losing their ability to participate in ongoing voting periods, undermining the fairness and predictability of the voting process.Vulnerability Detail
In the
Voter
contract, the owner can update the minimum lock time required for voting by calling theupdateMinimumLockTime
function. However, this function lacks any validation or restrictions, allowing the owner to arbitrarily increase the minimum lock time. If users have locked their tokens for the initially specified minimum period and the owner increases the minimum lock time during an ongoing voting period, these users will lose their voting power for that period. This creates an unfair scenario where users cannot predict or rely on their voting eligibilityImpact
Users who have locked their tokens for the initially specified minimum period may lose their voting power if the minimum lock time is increased by the owner. This undermines the fairness and predictability of the voting process, leading to potential user dissatisfaction and loss of trust
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L172
Tool used
Manual Review
Recommendation
Modify code in a way it changes to the minimum lock time should only take effect after the current voting period has ended
The text was updated successfully, but these errors were encountered: