There is a call to the chainlink oracle, even if the amount is 0 and the price is not needed.
In the getAccountCollateralValue
function there is a loop thru all the available collateral tokens and a call to getUsdValue
with the amount the account holds and the token address. Neither here, nor in getUsdValue
there is a check for the amount to be 0. This results in the chainlink oracle to be called for every Token, even if the user is not hold any amount and the returned value would be 0, no matter the price.
Unneccessary calls to chainlink oracle cost more gas.
Manual Review
Check for amount to be 0 in getUsdValue
function and return 0 without calling the oracle.
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.