IMasterChefRewarder interface is not defined onModify() cause DoS on MasterChefV2 contract
Summary
There is no function called onModify() defined in the IMasterChefRewarder interface, but the MasterChefV2._modify() function calls this function, causing the transaction to revert.
But the IMasterChefRewarder interface is not defined the onModify() function
Impact
Since the MasterChefV2._modify() function is used by several other functions, this causes a Denial of Service (DoS) on MasterchefV2.emergencyWithdraw(), MasterchefV2.depositOnBehalf(), MasterchefV2.deposit(), MasterchefV2.withdraw(), and MasterchefV2.claim().
Considering the Solidity documentation and ABI coding, it appears that the two interfaces have the same address type and are therefore compatible during the calls.
0xAadi
Medium
IMasterChefRewarder
interface is not definedonModify()
cause DoS onMasterChefV2
contractSummary
There is no function called
onModify()
defined in theIMasterChefRewarder
interface, but theMasterChefV2._modify()
function calls this function, causing the transaction to revert.Vulnerability Detail
The vulnerability lies in the following code:
But the
IMasterChefRewarder
interface is not defined theonModify()
functionImpact
Since the
MasterChefV2._modify()
function is used by several other functions, this causes a Denial of Service (DoS) onMasterchefV2.emergencyWithdraw()
,MasterchefV2.depositOnBehalf()
,MasterchefV2.deposit()
,MasterchefV2.withdraw()
, andMasterchefV2.claim()
.Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/MasterchefV2.sol#L560
Tool used
Manual Review
Recommendation
Define the
onModify()
function in theIMasterChefRewarder
interface.