For getUsdValue()
, return early if amount is 0
If the amount passed is 0, then the function can just return 0 as the USD value.
Otherwise, even for 0 amount, it calls the oracle to get the price which is completely unnecessary.
Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L361
Manual inspection
Consider adding a check for amount == 0
as:
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.