OracleRef is an abstract contract which references an oracle. It defines some basic utilities useful for contracts referencing an oracle.
The contract allows for updating or reading from the oracle. The oracle price is reported as FEI per X where X is some other asset like ETH, USDC, or USD depending on the oracle needs.
It allows Governor⚖️to change the referenced Oracle
Referenced oracle contract update
function oracle() external view returns (IOracle);
Returns the address of the referenced oracle as an interface.
function peg() external view returns (Decimal.D256 memory);
Returns the output of
oracle().read(), reverts if the oracle is invalid.
function invert(Decimal.D256 calldata price)externalpurereturns (Decimal.D256 memory);
price to be reported in the reverse direction. When applied to
peg it reports X per FEI wher X is some underlying asset.
function updateOracle() external returns (bool);
Pass-through updates the referenced oracle.
function setOracle(address _oracle) external;
Sets the address of the referenced oracle to