Cache array length outside of loop
If not cached, the solidity compiler will always read the length of the array during each iteration. Caching the length changes each of these to a DUP<N>
(3 gas), and gets rid of the extra DUP<N>
needed to store the stack offset.
Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/Lender.sol
Manual Code Review by SolSaver
Cache array length outside of loop
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.