Oracles can be unreachable, therefore it is better to expect such errors when calling them.
Also, it is a good practice to set some limits to the values retrieved from the Oracles.
Not wrapping calls to Oracles in try/catch blocks can lead to code failures and other malicious behavior.
Execution failure or price manipulation.
Manual code analysis.
To handle potential DoS cases when the Oracle is unreachable or an error occurs during the call to getPriceInWeth
, we can wrap the call to this function in a try/catch block. If the Oracle call fails, the catch block can handle the error gracefully.
Additionally, to mitigate an on-chain Oracle attack (price manipulation), we may also check that minPrice < receivedPrice < maxPrice
.
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.