The instances below point to the second+ access of a state variable within a function. Caching of a state variable replaces each Gwarmaccess (100 gas) with a much cheaper stack read. Other less obvious fixes/optimizations include having local memory caches of state variable structs, or having local caches of state variable contracts/addresses.
More detail see this.
There are 10
instances of this issue:
Fees.WETH should be cached with local memory-based variable in Fees.sellProfits(address), It is called more than once:
Staking.balance should be cached with local memory-based variable in Staking.update(), It is called more than once:
Lender.feeReceiver should be cached with local memory-based variable in Lender.refinance(Refinance[]), It is called more than once:
Lender.pools should be cached with local memory-based variable in Lender.refinance(Refinance[]), It is called more than once:
Lender.pools should be cached with local memory-based variable in Lender.addToPool(bytes32,uint256), It is called more than once:
Lender.pools should be cached with local memory-based variable in Lender.setPool(Pool), It is called more than once:
Lender.pools should be cached with local memory-based variable in Lender.borrow(Borrow[]), It is called more than once:
Lender.pools should be cached with local memory-based variable in Lender.removeFromPool(bytes32,uint256), It is called more than once:
Lender.pools should be cached with local memory-based variable in Lender.buyLoan(uint256,bytes32), It is called more than once:
Lender.loans should be cached with local memory-based variable in Lender.refinance(Refinance[]), It is called more than once:
Cache storage-based state variables in local memory-based variables appropriately to convert SLOADs to MLOADs and reduce gas consumption from 100 units to 3 units. than once for a function
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.