Platform: Code4rena
Start Date: 21/06/2022
Pot Size: $55,000 USDC
Total HM: 29
Participants: 88
Period: 5 days
Judge: gzeon
Total Solo HM: 7
Id: 134
League: ETH
Rank: 87/88
Findings: 1
Award: $62.46
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: BowTiedWardens
Also found by: 0v3rf10w, 0x1f8b, 0x29A, 0xKitsune, 0xNazgul, 0xf15ers, 0xkatana, 0xkowloon, Bnke0x0, ElKu, Fitraldys, Funen, GalloDaSballo, IllIllI, JC, Kaiziron, Lambda, MadWookie, Noah3o6, Nyamcil, RoiEvenHaim, TomJ, Tomio, UnusualTurtle, Waze, _Adam, ajtra, asutorufos, bardamu, c3phas, catchup, datapunk, defsec, delfin454000, fatherOfBlocks, grGred, hake, hansfriese, hyh, ignacio, joestakey, kebabsec, ladboy233, oyc_109, pashov, poirots, rfa, robee, sach1r0, samruna, sashik_eth, simon135, slywaters, z3s, zer0dot
62.4602 USDC - $62.46
If a variable is not set/initialized, it is assumed to have the default value (0, false, 0x0 etc. depending on the data type). Explicitly initializing it wastes gas.
I would recommend leaving the initialized variables with the default values on the following lines:
Lender.sol:265: for (uint256 i = 0; i < o.length; ) {
++i costs less gas compared to i++ or i += 1 for unsigned integers, as pre-increment is cheaper (about 5 gas per iteration). This statement is true even with the optimizer enabled.
I would recommend changing the increment from postfix to prefix in the following lines:
Lender.sol:96: i++; Lender.sol:120: i++; Lender.sol:289: i++;
External functions are cheaper than public functions
I would recommend chanding the following to external functions
Lender.sol#167-183 Lender.sol#192-235 Lender.sol#247-305 Lender.sol#317-367 Lender.sol#377-420 Lender.sol#433-473 Lender.sol#486-534 Lender.sol#545-589 Lender.sol#597-632 Redeemer.sol#107-151 Redeemer.sol#158-198 Redeemer.sol#206-231 Redeemer.sol#240-266 Redeemer.sol#275-296