s_collateralTokens can be stored in memory in the getAccountCollateralValue function to save gas.
In the DSCEngine contract in the getAccountCollateralValue function s_collateralTokens array can be stored in memory to save gas. The bigger the array is, the more expensive the for loop becomes.
Just add the storage array in memory and use that in the for loop.
address[] memory collateralTokens = s_collateralTokens;
Add this line above the for loop and use this collateralTokens array to perform operations on.
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.