You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename the getLatestPrice() function to getChainlinkDataFeedLatestAnswer()
Revert if returned answer or roundId are zero
Have a check for a stale answer. The timeStamp/updatedAt should be compared against the storage variable provided by the user that ideally should be a value close to a heartbeat of an actual feed. If block.timestamp - s_usdcUsdFeedHeartbeat is greater than timeStamp contract should revert
Currently contract returns plain answer. We should format that value based on the decimals() of the feed and token's decimals
Test all of these edge cases using Chainlink Local
getLatestPrice()
function togetChainlinkDataFeedLatestAnswer()
answer
orroundId
are zerotimeStamp
/updatedAt
should be compared against the storage variable provided by the user that ideally should be a value close to a heartbeat of an actual feed. Ifblock.timestamp - s_usdcUsdFeedHeartbeat
is greater thantimeStamp
contract should revertanswer
. We should format that value based on thedecimals()
of the feed and token's decimalsThe text was updated successfully, but these errors were encountered: