Platform: Code4rena
Start Date: 29/03/2022
Pot Size: $50,000 USDC
Total HM: 16
Participants: 42
Period: 5 days
Judge: 0xean
Total Solo HM: 9
Id: 105
League: ETH
Rank: 33/42
Findings: 2
Award: $154.47
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0v3rf10w, 0xDjango, 0xkatana, 0xmint, Czar102, Dravee, Funen, Ruhum, TerrierLover, defsec, gzeon, hake, hyh, jah, kenta, minhquanym, okkothejawa, pmerkleplant, rayn, reassor, robee, sorrynotsorry, sseefried, teryanarmen
102.9021 USDC - $102.90
No need to initialise the default values :
require(maxBonusRatio>minBonusRatio && minBonusRatio≠0) in constructor :
#0 - Kogaroshi
2022-04-03T07:26:04Z
QA & gas optimizations changes are done in the PR: https://github.com/PaladinFinance/Paladin-Tokenomics/pull/6 (some changes/tips were implemented, others are noted but won't be applied)
🌟 Selected for report: TerrierLover
Also found by: 0v3rf10w, 0xDjango, 0xNazgul, 0xkatana, 0xmint, Cityscape, Czar102, Dravee, Funen, IllIllI, Tomio, antonttc, defsec, gzeon, hake, kenta, minhquanym, pmerkleplant, rayn, rfa, robee, saian, securerodd, teryanarmen
51.5728 USDC - $51.57
Since last UpdateReward is a time in the past, it would be smaller than block.timestamp, therefore use unchecked block:
The nested ifs are already numerous but for gas savings :
Use unchecked block for the aforementioned line :
if (vars.bonusRatioDecrease >= vars.previousBonusRatio) {
newBonusRatio =0 ;
} else{
unchecked{
newBonusRatio=vars.previousBonusRatio-vars.bonusRatioDecrease;
}
}
#0 - Kogaroshi
2022-04-03T07:25:54Z
QA & gas optimizations changes are done in the PR: https://github.com/PaladinFinance/Paladin-Tokenomics/pull/6 (some changes/tips were implemented, others are noted but won't be applied)