Skip to content

FallbackCLRSOracleL2 ​

Git Source

Inherits:FluidOracleL2, FallbackCLRSOracle

Gets the exchange rate between the underlying asset and the peg asset by using: the price from a Chainlink price feed or a Redstone Oracle with one of them being used as main source and the other one acting as a fallback if the main source fails for any reason. Reverts if fetched rate is 0.

Functions ​

constructor ​

sets the main source, Chainlink Oracle and Redstone Oracle data.

solidity
constructor(
    string memory infoName_,
    uint8 targetDecimals_,
    CLRSConstructorParams memory cLRSParams_,
    address sequencerUptimeFeed_
)
    FallbackCLRSOracle(
        infoName_,
        targetDecimals_,
        cLRSParams_.mainSource,
        cLRSParams_.chainlinkParams,
        cLRSParams_.redstoneOracle
    )
    FluidOracleL2(sequencerUptimeFeed_);

Parameters

NameTypeDescription
infoName_stringOracle identify helper name.
targetDecimals_uint8
cLRSParams_CLRSConstructorParamsCLRS Fallback Oracle data
sequencerUptimeFeed_addressL2 sequencer uptime Chainlink feed

getExchangeRateOperate ​

solidity
function getExchangeRateOperate()
    public
    view
    virtual
    override(FallbackCLRSOracle, FluidOracleL2)
    returns (uint256 exchangeRate_);

getExchangeRateLiquidate ​

solidity
function getExchangeRateLiquidate()
    public
    view
    virtual
    override(FallbackCLRSOracle, FluidOracleL2)
    returns (uint256 exchangeRate_);

getExchangeRate ​

solidity
function getExchangeRate()
    public
    view
    virtual
    override(FallbackCLRSOracle, FluidOracleL2)
    returns (uint256 exchangeRate_);

Structs ​

CLRSConstructorParams ​

solidity
struct CLRSConstructorParams {
    uint8 mainSource;
    ChainlinkConstructorParams chainlinkParams;
    RedstoneOracleData redstoneOracle;
}