Declaring the token and amount variables in the getAccountCollateralValue function outside the for loop can save considerable amount of gas, especially for large address arrays.
See summary
Considerable amount of gas can be saved, making the protocol cheaper to use.
Remix
The optimized getAccountCollateralValue 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.