Comment on page
OracleRef
A reference to an oracle contract
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 RUSD 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
OracleUpdate
Referenced oracle contract update
type | param | description |
address indexed | _oracle | new oracle |
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)
external
pure
returns (Decimal.D256 memory);
Inverts a
price
to be reported in the reverse direction. When applied to peg
it reports X per RUSD wher X is some underlying asset.function setOracle(address _oracle) external;
Sets the address of the referenced oracle to
_oracle
.emits
OracleUpdate
oracleref.json
3KB
Code
OracleRef ABI
ioracleref.json
1KB
Code
OracleRef Interface ABI
Last modified 2yr ago