DeFiHardhatOracleProxyUpdates
100,000 USDC
View results
Submission Details
Severity: low
Invalid

`convertKind` is not checking if the return value `kind` is valid or not

Summary

In the convertKind function, consider adding a default case to handle potential errors or unexpected values. This helps ensure that the function can gracefully handle future modifications to the enum. or even if someone passed a wrong kind so it will return a graceful error rather then returning something weird.

Recommendations

Add this check

/// @notice Decoder for the Convert Enum
function convertKind(bytes memory self) internal pure returns (ConvertKind) {
ConvertKind kind = abi.decode(self, (ConvertKind));
+ require(kind <= ConvertKind.UNRIPE_TO_RIPE, "Invalid ConvertKind");
+ return kind;
}
Updates

Lead Judging Commences

giovannidisiena Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational/Invalid

Support

FAQs

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