Platform: Code4rena
Start Date: 14/04/2022
Pot Size: $75,000 USDC
Total HM: 8
Participants: 72
Period: 7 days
Judge: Jack the Pug
Total Solo HM: 2
Id: 110
League: ETH
Rank: 37/72
Findings: 2
Award: $170.41
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0v3rf10w, 0x1f8b, 0xDjango, 0xkatana, AmitN, CertoraInc, Dravee, Funen, Hawkeye, Jujic, MaratCerby, Picodes, Ruhum, SolidityScan, TerrierLover, TomFrenchBlockchain, TrungOre, VAD37, Yiko, berndartmueller, cmichel, csanuragjain, danb, defsec, delfin454000, dipp, ellahi, fatherOfBlocks, georgypetrov, gs8nrv, gzeon, horsefacts, hubble, hyh, ilan, jah, joestakey, kebabsec, kenta, kyliek, m9800, minhquanym, oyc_109, p_crypt0, peritoflores, rayn, reassor, remora, rfa, robee, scaraven, securerodd, shenwilly, sorrynotsorry, tchkvsky, teryanarmen, z3s
93.8321 USDC - $93.83
CitadelMiner.sol
StakedCitadel.sol
StakedCitadelLocker.sol
🌟 Selected for report: Dravee
Also found by: 0v3rf10w, 0x1f8b, 0xAsm0d3us, 0xBug, 0xDjango, 0xNazgul, 0xkatana, CertoraInc, Cityscape, Funen, Hawkeye, IllIllI, MaratCerby, SolidityScan, TerrierLover, TomFrenchBlockchain, Tomio, TrungOre, bae11, berndartmueller, csanuragjain, defsec, delfin454000, ellahi, fatherOfBlocks, gs8nrv, gzeon, horsefacts, ilan, jah, joestakey, joshie, kebabsec, kenta, nahnah, oyc_109, rayn, rfa, robee, saian, securerodd, simon135, slywaters, sorrynotsorry, tchkvsky, teryanarmen, z3s
76.5844 USDC - $76.58
CitadelMiner.sol
Funding.sol
L79: if it were a function, instead of a modifier, the gas cost would be lower.
L145: if it were a function, instead of a modifier, the gas cost would be lower.
L236: this operation can be wrapped in unckecked, since the if() validates the underflow.
L419 / L420: Instead of creating the variables and then setting them, if you create and set them at the same time, you spend less gas.
KnightingRound.sol
L218: this operation can be wrapped in unckecked, It shouldn't be possible to overflow totalTokenOutClaimed + tokenOutAmount_, since they depend on all the validations above.
L250: this operation can be wrapped in unckecked, since the if() validates the underflow.
StakedCitadel.sol
L452: instead of creating a variable and then using it, it could be put directly into L461.
L456: instead of creating a variable and then using it, it could be put directly into L464.
L822: this operation can be wrapped in unckecked, _diff= _after - b and r = b + _diff, if L820 does not revert, then neither does L822.
L852: directly return the operation and not create a variable, this generates an extra expense of gas.
L874: directly return the _calculateFee() calls and not create a variable, this generates an extra expense of gas.
StakedCitadelVester.sol
L111: esting[recipient].unlockEnd could be put as a local variable, since it is used more than once.
L115: esting[recipient].unlockBegin could be put as a local variable, since it is used more than once.
StakedCitadelLocker.sol
L265: take the i++ out of the for() and make it unckecked.
L407: take the i-- out of the for() and make it unckecked.
L426: take the i-- out of the for() and make it unckecked.
L421: the return variable uint256 "epoch" is not used, should it be used or not create that variable.