OracleManager.sol
OracleManager
The Oracle Manager stores oracle implementations. External contracts can call getPrice
to get the price of an asset.
oracles
Active oracle implementations.
Stored in priority order.
numOracles
The number of active oracle implementations.
quoteAsset
The ERC20 in which the price is quoted.
MIN_SUPPORTED_ORACLES
The minimum number of supported oracles.
MAX_SUPPORTED_ORACLES
The maximum number of supported oracles.
constructor
Sets the ERC20 in which the price is quoted.
Parameters
getPrice
Returns the price of the asset quoted in terms of the base asset.
Iterates through oracles
in order, and calls IBasePriceOracle.getPrice()
if the oracle supports the asset. Reverts if no oracle supports by asset.
Parameters
Return Values
setOracles
Sets the oracle implementations.
First it zeroes out the oracles
array in storage. It copies elements from _oracles
then updates numOracles
. 10 >= number of oracles > 0. Can be called only by the owner.
Parameters
getOracles
Retrieves the oracle implementations.
Used for off-chain data retrieval.
Return Values
Last updated