Skip to content

RedstoneOracleImpl2 ​

Git Source

Inherits: OracleError, RedstoneStructs

This contract is used to get the exchange rate from a Redstone Oracle

State Variables ​

_REDSTONE2_ORACLE ​

Redstone price oracle to check for the exchange rate

solidity
IRedstoneOracle internal immutable _REDSTONE2_ORACLE;

_REDSTONE2_INVERT_RATE ​

Flag to invert the price or not (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)

solidity
bool internal immutable _REDSTONE2_INVERT_RATE;

_REDSTONE2_PRICE_SCALER_MULTIPLIER ​

constant value for price scaling to reduce gas usage

solidity
uint256 internal immutable _REDSTONE2_PRICE_SCALER_MULTIPLIER;

_REDSTONE2_INVERT_PRICE_DIVIDEND ​

constant value for inverting price to reduce gas usage

solidity
uint256 internal immutable _REDSTONE2_INVERT_PRICE_DIVIDEND;

_REDSTONE2_ORACLE_NOT_SET_ADDRESS ​

solidity
address internal immutable _REDSTONE2_ORACLE_NOT_SET_ADDRESS = 0x000000000000000000000000000000000000dEaD;

Functions ​

constructor ​

constructor sets the Redstone oracle data

solidity
constructor(RedstoneOracleData memory oracleData_);

_getRedstoneExchangeRate2 ​

Get the exchange rate from Redstone oracle

solidity
function _getRedstoneExchangeRate2() internal view returns (uint256 rate_);

redstoneOracleData2 ​

returns all Redstone oracle related data as utility for easy off-chain use / block explorer in a single view method

solidity
function redstoneOracleData2()
    public
    view
    returns (uint256 redstoneExchangeRate_, IRedstoneOracle redstoneOracle_, bool redstoneInvertRate_);