-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage of deprecated ChainLink API in EIP1271Wallet
#197
Comments
Duplicate #178 |
Valid finding. I am hesitating whether this should be low or medium but decided to leave it as a medium because the likeliness is low but the impact would be huge, and all the wardens submitted this with a medium severity. Also: "Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements." |
Making this a primary issue, because it contains the most concise description. |
Handle
cmichel
Vulnerability details
The Chainlink API (
latestAnswer
) used in theEIP1271Wallet
contract is deprecated:This function does not error if no answer has been reached but returns 0. Besides, the
latestAnswer
is reported with 18 decimals for crypto quotes but 8 decimals for FX quotes (See Chainlink FAQ for more details). A best practice is to get the decimals from the oracles instead of hard-coding them in the contract.Recommended Mitigation Steps
Use the
latestRoundData
function to get the price instead. Add checks on the return data with proper revert messages if the price is stale or the round is uncomplete, for example:The text was updated successfully, but these errors were encountered: