Closed sherlock-admin3 closed 3 months ago
Considering the Solidity documentation and ABI coding, it appears that the two interfaces (IBribeRewarder and IRewarder) have the same address type and are therefore compatible during the calls.
This actually makes it possible to pass the IBribeRewarder
parameter as IRewarder
and not cause any problems with the function's operation.
False
0xAadi
Medium
Use of wrong parameter type in
Voter._checkRegisterCaller()
cause DoS onVoter.onRegister()
Summary
Voter._checkRegisterCaller()
function using a wrong parameter typeIBribeRewarder
instead ofIRewarder
cuaseVoter.onRegister()
to failVulnerability Detail
The vulnerability lies in the
_checkRegisterCaller
function fromVoter
contract.The
getRewarderType
function defined inRewarderFactory
only acceptIRewarder
as the parameter.https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/RewarderFactory.sol#L84C4-L86C6
But the
_checkRegisterCaller
function fromVoter
contract passingIBribeRewarder
as the parameter.This will cause the
Voter.onRegister()
which internally calls the_checkRegisterCaller
will always revert.Impact
DoS on
Voter.onRegister()
cause restricting bribe rewarder from registers itself.Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/Voter.sol#L427C4-L431C6
Tool used
Manual Review
Recommendation
Please update the code like the below one