Open sherlock-admin3 opened 4 months ago
The protocol team fixed this issue in the following PRs/commits: https://github.com/Velocimeter/v4-contracts/pull/12
Fix looks good. disable_max_lock
now works properly.
The Lead Senior Watson signed off on the fix.
pashap9990
High
voters cannot disable max lock
Summary
Voters can enable maxLock and this causes their voting power wouldn't decrease but they cannot disable maxLock
Vulnerability Detail
Textual PoC: Let's assume three voters lock their assets in ve,hence three nfts will be minted[1,2,3] and after that they enable maxLock
Initial values max_locked_nfts corresponding values:
maxLockIdToIndex corresponding values:
when owner of nft 3 want to disable maxLock he has to call
VotingEscrow::disable_max_lock
in result : variable's values from line 897 til 901:max_locked_nfts corresponding values:
maxLockIdToIndex corresponding values:
finally
Coded PoC:
Impact
Voters cannot withdraw their assets from ve because every time they call
VotingEscrow::withdraw
their lockEnd will be decreaseCode Snippet
https://github.com/sherlock-audit/2024-06-velocimeter/blob/main/v4-contracts/contracts/VotingEscrow.sol#L904
Tool used
Manual Review
Recommendation