The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Unchecked Return Values in euroCollateral() Function

Summary

Potential "unchecked return values" risk in euroCollateral() function

Vulnerability Details

The euroCollateral() function makes an external call to the calculator.tokenToEurAvg() function. If this function call fails for any reason (for instance, if the calculator contract throws an exception or if it runs out of gas), the euroCollateral() function will not know about the failure and will continue executing as if nothing happened.

Recommendations

A require statement in the following format:

(bool success, ) = calculator.tokenToEurAvg(...);
require(success, "Calculator call failed");

should be used to check the return value of external calls.
This way, if the calculator.tokenToEurAvg() function call fails, the require statement will cause the entire transaction to revert, and the error message "Calculator call failed" will be returned

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.