Platform: Code4rena
Start Date: 25/11/2021
Pot Size: $80,000 USDC
Total HM: 35
Participants: 32
Period: 7 days
Judge: GalloDaSballo
Total Solo HM: 27
Id: 59
League: ETH
Rank: 27/32
Findings: 2
Award: $155.86
🌟 Selected for report: 1
🚀 Solo Findings: 0
hagrid
Some tokens (like USDT) do not work when changing the allowance from an existing non-zero allowance value. They must first be approved by zero and then the actual allowance must be approved.
When using one of these unsupported tokens, all transactions revert and the protocol cannot be used.
Manual analysis
Safeapprove with a zero amount first before setting the actual amount.
#0 - 0xScotch
2021-12-08T16:22:05Z
#41
#1 - GalloDaSballo
2022-01-24T00:57:28Z
Duplicate of #41
🌟 Selected for report: hagrid
56.5245 USDC - $56.52
hagrid
The withdraw(uint256 rewardAmount)
function on the AbstractRewardMine
contract is wrongly controlling the reward amount.
Using the withdraw
function instead of withdrawAll
function will cost nearly same gas amount since these functions are nearly identical.
Manual Review
require(rewardAmount <= rewardEarned, "< earned");
The require function above should be replaced with:
require(rewardAmount < rewardEarned, "< earned");
Else, both withdraw functions will be nearly identical.
#0 - GalloDaSballo
2022-01-01T15:54:37Z
I agree with the warden that withdrawAll
is basically the same as withdraw
withdraw
could be made public and reused in withdrawAll