The function getAccountCollateralValue employs an inefficient loop structure by using the length of the s_collateralTokens array in the loop condition.
This approach can result in suboptimal gas usage, especially if the s_collateralTokens array is expected to grow in size over time. Using the array's length in the loop condition forces the function to iterate through the entire array on each invocation, even if the user's collateral is only associated with a small subset of tokens.
gas cost issue
Manual Review and slither
it is more gas efficient to cache the array it in some local variable and use that variable instead,
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.