You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
In the above code, we can see onlyVoter contract can call this function but the issue is in _modify() which checks that only owner of the tokenId can call this otherwise it will revert. As result when voter.sol call this _modify(), it will revert because voter.sol is not the owner of any tokenId
utsav
Medium
Voting will be DoS in _modify()
Summary
Voting will be DoS in _modify() due to strict require statement
Vulnerability Detail
When user votes in Voter.sol, it calls deposit() in bribeRewarder.sol & again deposit() calls _modify()
In the above code, we can see
onlyVoter
contract can call this function but the issue is in _modify() which checks that onlyowner
of thetokenId
can call this otherwise it will revert. As result when voter.sol call this _modify(), it willrevert
becausevoter.sol
is not the owner ofany
tokenIdImpact
Voting will be DoSed in _modify()
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L153C4-L229C6
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L144
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L263C6-L266C10
Tool used
VS code
Recommendation
Remove the check
Duplicate of #39
The text was updated successfully, but these errors were encountered: