array length should be cached to save gas in for loop
No need to explicitly initialize variables with default values: uint i = 0;
in for loop
++i
costs less gas compared to i++
.
add this if (amount != 0)
code
Test: getAccountCollateralValue: this is only [weth, wbtc]
if there are more Collaterals it will cost more.
before: 127827 :: after : 112009
Manual Review
for loop: cache length.
uint L = s_collateralTokens.length;
for(uint i; i < L; ++i) {}
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.