Function: setUnderlyingPrice(IQiToken qiToken, uint256 underlyingPriceMantissa, bool setInEdge, bool setInChainlink)
This function sets the underlying price for a qiToken in both underlying oracles.
Inputs
qiTokenControl: Fully controlled by the caller.
Constraints: None.
Impact: A
qiTokento set the underlying price of.
underlyingPriceMantissaControl: Fully controlled by the caller.
Constraints: None.
Impact: A price to set the underlying price of.
setInEdgeControl: Fully controlled by the caller.
Constraints: None.
Impact: A boolean to set if the price should be set in the Edge oracle.
setInChainlinkControl: Fully controlled by the caller.
Constraints: None.
Impact: A boolean to set if the price should be set in the Chainlink oracle.
Branches and code coverage
Intended branches
Check if the
qiTokenis a zero address.Check if both
setInEdgeandsetInChainlinkare false.Check if the price is zero.
Validate the price.
Set the price in the Edge oracle.
Set the price in the Chainlink oracle.
Negative behavior
Revert if the caller is not an owner.
Revert if the
qiTokenis a zero address.Revert if both
setInEdgeandsetInChainlinkare false.Revert if the price is zero.