Platform: Code4rena
Start Date: 26/05/2022
Pot Size: $75,000 USDT
Total HM: 31
Participants: 71
Period: 7 days
Judge: GalloDaSballo
Total Solo HM: 18
Id: 126
League: ETH
Rank: 44/71
Findings: 2
Award: $153.16
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x29A, 0xDjango, 0xNazgul, 0xf15ers, BouSalman, Chom, Deivitto, Dravee, ElKu, FSchmoede, Funen, GimelSec, Hawkeye, MiloTruck, Picodes, SecureZeroX, SmartSek, TerrierLover, WatchPug, _Adam, asutorufos, berndartmueller, c3phas, catchup, cccz, cogitoergosumsw, cryptphi, csanuragjain, delfin454000, dipp, ellahi, gzeon, hansfriese, horsefacts, hyh, kirk-baird, minhquanym, oyc_109, pauliax, reassor, robee, sashik_eth, shenwilly, simon135, sorrynotsorry, sseefried, unforgiven, xiaoming90, z3s
101.0887 USDT - $101.09
I see most functions don't have natspecs for parameters and I recommend to add for good understanding.
Some tokens (USDT) do not work when changing the allowance from an existing non-zero allowance value. You need to approve zero amount first.
The initial values of "lockFeesIncentive" and "stakerLockFeesIncentive" are 10000 and 0 so the sum equals to FEE_DENOMINATOR. After you update these fees using setFeeInfo() function, if sum of two fees are greater than FEE_DENOMINATOR, the function earmarkFees() in L576-L595 will be failed because both fees will be calculated and transferred separately from feeToken balance of current contract. That's why I think it would be good to add a require() at L195.
require(_lockFeesIncentive + _stakerLockFeesIncentive <= FEE_DENOMINATOR, "invalid fee info");
withdraw() function() in L214 has this require() and it would be good to add same require() for this function also.
require(amount > 0, "RewardPool : Cannot withdraw 0");
#0 - GalloDaSballo
2022-07-07T22:55:34Z
Valid Refactor
##Â They must first be approved by zero and then the actual allowance must be approved.
Not valid, you won't need to approve(0) because the system always transferFrom
the entire amount
Valid Low, nice catch!
Valid Refactor, Nice
Disagree on that specific event, no point in indexing those values
Neat report, some unique finds
1L, 2R
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x29A, 0xKitsune, 0xNazgul, 0xf15ers, 0xkatana, Cityscape, Dravee, ElKu, FSchmoede, Funen, GalloDaSballo, Hawkeye, Kaiziron, MiloTruck, Randyyy, RoiEvenHaim, Ruhum, SecureZeroX, SmartSek, TerrierLover, TomJ, Tomio, WatchPug, Waze, _Adam, asutorufos, c3phas, catchup, cogitoergosumsw, delfin454000, ellahi, fatherOfBlocks, gzeon, hansfriese, horsefacts, jonatascm, minhquanym, oyc_109, pauliax, reassor, robee, sach1r0, saian, sashik_eth, simon135, z3s
52.0655 USDT - $52.07
Change storage to memory if possible contracts\Booster.sol#L351 contracts\Booster.sol#L400 contracts\Booster.sol#L497
Use != 0 instead of > 0 for uint variables contracts\BaseRewardPool.sol#L173 contracts\BaseRewardPool.sol#L196 contracts\BaseRewardPool.sol#L215 contracts\Booster.sol#L517 contracts\Booster.sol#L526 contracts\Booster.sol#L541 contracts\Booster.sol#L551 contracts\Booster.sol#L562 contracts\Booster.sol#L586 contracts\Booster.sol#L590 contracts\VE3DRewardPool.sol#L210 contracts\VE3DRewardPool.sol#L234 contracts\VE3DRewardPool.sol#L253 contracts\VeAssetDepositor.sol#L89 contracts\VeAssetDepositor.sol#L117 contracts\VeAssetDepositor.sol#L132 contracts\VeAssetDepositor.sol#L138 contracts\VoterProxy.sol#L100
Use ++i instead of i++, i+=1 contracts\BaseRewardPool.sol#L176 contracts\BaseRewardPool.sol#L199 contracts\BaseRewardPool.sol#L218 contracts\BaseRewardPool.sol#L245 contracts\BaseRewardPool.sol#L282 contracts\Booster.sol#L329 contracts\VE3DRewardPool.sol#L148 contracts\VE3DRewardPool.sol#L214 contracts\VE3DRewardPool.sol#L238 contracts\VE3DRewardPool.sol#L257 contracts\VE3DRewardPool.sol#L281 contracts\VE3DRewardPool.sol#L326 contracts\VoterProxy.sol#L217
Use if(flag) instead of if(flag == true), if(!flag) instead of if(flag == false) contracts\VoterProxy.sol#L70 contracts\VoterProxy.sol#L110 contracts\VoterProxy.sol#L113 contracts\Booster.sol#L352 contracts\Booster.sol#L498 contracts\VoterProxy.sol#L93 contracts\VoterProxy.sol#L96
An array’s length should be cached to save gas in for-loops contracts\BaseRewardPool.sol#L176 contracts\BaseRewardPool.sol#L199 contracts\BaseRewardPool.sol#L218 contracts\BaseRewardPool.sol#L245 contracts\BaseRewardPool.sol#L282 contracts\Booster.sol#L329 contracts\VE3DRewardPool.sol#L148 contracts\VE3DRewardPool.sol#L281 contracts\VoterProxy.sol#L217
#0 - GalloDaSballo
2022-07-14T02:08:49Z
Saves less than 500 gas