Platform: Code4rena
Start Date: 17/03/2022
Pot Size: $30,000 USDC
Total HM: 8
Participants: 43
Period: 3 days
Judge: gzeon
Total Solo HM: 5
Id: 100
League: ETH
Rank: 27/43
Findings: 2
Award: $80.30
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: defsec
Also found by: 0x1f8b, 0xDjango, 0xNazgul, 0xkatana, 0xwags, CertoraInc, Funen, GeekyLumberjack, GreyArt, IllIllI, Kenshin, Ruhum, TerrierLover, WatchPug, berndartmueller, bugwriter001, cccz, cmichel, csanuragjain, hake, kenta, kirk-baird, leastwood, minhquanym, oyc_109, peritoflores, rayn, remora, rfa, robee, saian, samruna, sorrynotsorry, wuwe1
51.8842 USDC - $51.88
_initialAmount
in function hook
is unused.hook
in DepositHook.sol
had an input variable _initialAmount
but didn’t use anywhere in the function. Same issue with _initialAmount
in WithdrawHook.sol
_initialAmount
#0 - ramenforbreakfast
2022-03-22T22:44:23Z
duplicate of #5
28.4169 USDC - $28.42
_amountToDeposit
or _amountWithdrawn
Variable _valueAfter
is unnecessary to keep in memory when we only use it to calculate _amountToDeposit
once.
https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/Collateral.sol#L75-L79 https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/Collateral.sol#L151-L155
For example, change line 78-79 to
_amountToDeposit = _strategyController.totalValue() - _valueBefore;
#0 - ramenforbreakfast
2022-03-22T22:43:37Z
Disputable suggestion, there is value in readability in keeping valueAfter
separate. Marking this as duplicate since #41 covers this and is a higher quality submission imo.