Invalid equation check on require
#2
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Handle
hagrid
Vulnerability details
The
withdraw(uint256 rewardAmount)
function on theAbstractRewardMine
contract is wrongly controlling the reward amount.Impact
Using the
withdraw
function instead ofwithdrawAll
function will cost nearly same gas amount since these functions are nearly identical.Proof of Concept
Tools Used
Manual Review
Recommended Mitigation Steps
require(rewardAmount <= rewardEarned, "< earned");
The require function above should be replaced with:
require(rewardAmount < rewardEarned, "< earned");
Else, both withdraw functions will be nearly identical.
The text was updated successfully, but these errors were encountered: