Function: fetchPrice()
Get the latest price returned from the oracle.
Branches and code coverage (including function calls)
Intended branches
If
updated < block.timestamp
, get the price from_fetchPrice
and update thelastUpdated
variable with current timestamp.If
updated >= block.timestamp
, get the price by calling the function at signaturesp.signature
on thesp.collateral
address.
Negative behavior
If
updated >= block.timestamp
, revert if the call tosp.collateral
is unsuccessful.
Function call analysis
sp.collateral.call(abi.encode(sp.signature))
What is controllable? N/A.
If return value controllable, how is it used and how can it go wrong? Return values are not controllable.
What happens if it reverts, reenters, or does other unusual control flow? The entire function would revert if the external call reverts --- no reentrancy scenarios.