{ "address": "0x0D4B70DCd1E1B70BC1637AF6f104BE871d615278", "abi": [ { "inputs": [ { "internalType": "string", "name": "infoName_", "type": "string" }, { "components": [ { "internalType": "uint8", "name": "mainSource", "type": "uint8" }, { "components": [ { "internalType": "uint8", "name": "hops", "type": "uint8" }, { "components": [ { "internalType": "contract IChainlinkAggregatorV3", "name": "feed", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256", "name": "token0Decimals", "type": "uint256" } ], "internalType": "struct ChainlinkStructs.ChainlinkFeedData", "name": "feed1", "type": "tuple" }, { "components": [ { "internalType": "contract IChainlinkAggregatorV3", "name": "feed", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256", "name": "token0Decimals", "type": "uint256" } ], "internalType": "struct ChainlinkStructs.ChainlinkFeedData", "name": "feed2", "type": "tuple" }, { "components": [ { "internalType": "contract IChainlinkAggregatorV3", "name": "feed", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256", "name": "token0Decimals", "type": "uint256" } ], "internalType": "struct ChainlinkStructs.ChainlinkFeedData", "name": "feed3", "type": "tuple" } ], "internalType": "struct ChainlinkStructs.ChainlinkConstructorParams", "name": "chainlinkParams", "type": "tuple" }, { "components": [ { "internalType": "contract IRedstoneOracle", "name": "oracle", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256", "name": "token0Decimals", "type": "uint256" } ], "internalType": "struct RedstoneStructs.RedstoneOracleData", "name": "redstoneOracle", "type": "tuple" } ], "internalType": "struct FallbackCLRSOracleL2.CLRSConstructorParams", "name": "cLRSParams1_", "type": "tuple" }, { "components": [ { "internalType": "uint8", "name": "mainSource", "type": "uint8" }, { "components": [ { "internalType": "uint8", "name": "hops", "type": "uint8" }, { "components": [ { "internalType": "contract IChainlinkAggregatorV3", "name": "feed", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256", "name": "token0Decimals", "type": "uint256" } ], "internalType": "struct ChainlinkStructs.ChainlinkFeedData", "name": "feed1", "type": "tuple" }, { "components": [ { "internalType": "contract IChainlinkAggregatorV3", "name": "feed", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256", "name": "token0Decimals", "type": "uint256" } ], "internalType": "struct ChainlinkStructs.ChainlinkFeedData", "name": "feed2", "type": "tuple" }, { "components": [ { "internalType": "contract IChainlinkAggregatorV3", "name": "feed", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256", "name": "token0Decimals", "type": "uint256" } ], "internalType": "struct ChainlinkStructs.ChainlinkFeedData", "name": "feed3", "type": "tuple" } ], "internalType": "struct ChainlinkStructs.ChainlinkConstructorParams", "name": "chainlinkParams", "type": "tuple" }, { "components": [ { "internalType": "contract IRedstoneOracle", "name": "oracle", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256", "name": "token0Decimals", "type": "uint256" } ], "internalType": "struct RedstoneStructs.RedstoneOracleData", "name": "redstoneOracle", "type": "tuple" } ], "internalType": "struct FallbackCLRSOracleL2.CLRSConstructorParams", "name": "cLRSParams2_", "type": "tuple" }, { "internalType": "address", "name": "sequencerUptimeFeed_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [ { "internalType": "uint256", "name": "errorId_", "type": "uint256" } ], "name": "FluidOracleError", "type": "error" }, { "inputs": [], "name": "FALLBACK_ORACLE2_MAIN_SOURCE", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "FALLBACK_ORACLE_MAIN_SOURCE", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "chainlinkOracleData", "outputs": [ { "internalType": "uint256", "name": "chainlinkExchangeRate_", "type": "uint256" }, { "internalType": "contract IChainlinkAggregatorV3", "name": "chainlinkFeed1_", "type": "address" }, { "internalType": "bool", "name": "chainlinkInvertRate1_", "type": "bool" }, { "internalType": "uint256", "name": "chainlinkExchangeRate1_", "type": "uint256" }, { "internalType": "contract IChainlinkAggregatorV3", "name": "chainlinkFeed2_", "type": "address" }, { "internalType": "bool", "name": "chainlinkInvertRate2_", "type": "bool" }, { "internalType": "uint256", "name": "chainlinkExchangeRate2_", "type": "uint256" }, { "internalType": "contract IChainlinkAggregatorV3", "name": "chainlinkFeed3_", "type": "address" }, { "internalType": "bool", "name": "chainlinkInvertRate3_", "type": "bool" }, { "internalType": "uint256", "name": "chainlinkExchangeRate3_", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "chainlinkOracleData2", "outputs": [ { "internalType": "uint256", "name": "chainlinkExchangeRate_", "type": "uint256" }, { "internalType": "contract IChainlinkAggregatorV3", "name": "chainlinkFeed1_", "type": "address" }, { "internalType": "bool", "name": "chainlinkInvertRate1_", "type": "bool" }, { "internalType": "uint256", "name": "chainlinkExchangeRate1_", "type": "uint256" }, { "internalType": "contract IChainlinkAggregatorV3", "name": "chainlinkFeed2_", "type": "address" }, { "internalType": "bool", "name": "chainlinkInvertRate2_", "type": "bool" }, { "internalType": "uint256", "name": "chainlinkExchangeRate2_", "type": "uint256" }, { "internalType": "contract IChainlinkAggregatorV3", "name": "chainlinkFeed3_", "type": "address" }, { "internalType": "bool", "name": "chainlinkInvertRate3_", "type": "bool" }, { "internalType": "uint256", "name": "chainlinkExchangeRate3_", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getExchangeRate", "outputs": [ { "internalType": "uint256", "name": "exchangeRate_", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getExchangeRateLiquidate", "outputs": [ { "internalType": "uint256", "name": "exchangeRate_", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getExchangeRateOperate", "outputs": [ { "internalType": "uint256", "name": "exchangeRate_", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "infoName", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "redstoneOracleData", "outputs": [ { "internalType": "uint256", "name": "redstoneExchangeRate_", "type": "uint256" }, { "internalType": "contract IRedstoneOracle", "name": "redstoneOracle_", "type": "address" }, { "internalType": "bool", "name": "redstoneInvertRate_", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "redstoneOracleData2", "outputs": [ { "internalType": "uint256", "name": "redstoneExchangeRate_", "type": "uint256" }, { "internalType": "contract IRedstoneOracle", "name": "redstoneOracle_", "type": "address" }, { "internalType": "bool", "name": "redstoneInvertRate_", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "sequencerL2Data", "outputs": [ { "internalType": "address", "name": "sequencerUptimeFeed_", "type": "address" }, { "internalType": "uint256", "name": "maxGracePeriod_", "type": "uint256" }, { "internalType": "bool", "name": "isSequencerUp_", "type": "bool" }, { "internalType": "uint256", "name": "lastUptimeStartedAt_", "type": "uint256" }, { "internalType": "uint256", "name": "gracePeriod_", "type": "uint256" }, { "internalType": "bool", "name": "gracePeriodPassed_", "type": "bool" }, { "internalType": "uint256", "name": "lastOutageStartedAt_", "type": "uint256" }, { "internalType": "bool", "name": "isSequencerUpAndValid_", "type": "bool" } ], "stateMutability": "view", "type": "function" } ], "transactionHash": "0x77eede23a60e8da6fbde673ad52e9476db41c8c5b495b10e5a40f0c45cde5b88", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A", "contractAddress": null, "transactionIndex": 9, "gasUsed": "3573333", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "blockHash": "0xc1b9842526d0024bf2879d43448a9d9cdf1b0e38e09ac5f0f6dbd4651cf235ed", "transactionHash": "0x77eede23a60e8da6fbde673ad52e9476db41c8c5b495b10e5a40f0c45cde5b88", "logs": [], "blockNumber": 229058722, "cumulativeGasUsed": "6495925", "status": 1, "byzantium": true }, "args": [ "WSTETH for 1 WEETH", { "chainlinkParams": { "hops": 1, "feed1": { "feed": "0x20bAe7e1De9c596f5F7615aeaa1342Ba99294e12", "invertRate": false, "token0Decimals": 18 }, "feed2": { "feed": "0x0000000000000000000000000000000000000000", "invertRate": false, "token0Decimals": 0 }, "feed3": { "feed": "0x0000000000000000000000000000000000000000", "invertRate": false, "token0Decimals": 0 } }, "redstoneOracle": { "oracle": "0x0000000000000000000000000000000000000000", "invertRate": false, "token0Decimals": 0 }, "mainSource": 1 }, { "chainlinkParams": { "hops": 1, "feed1": { "feed": "0xB1552C5e96B312d0Bf8b554186F846C40614a540", "invertRate": false, "token0Decimals": 18 }, "feed2": { "feed": "0x0000000000000000000000000000000000000000", "invertRate": false, "token0Decimals": 0 }, "feed3": { "feed": "0x0000000000000000000000000000000000000000", "invertRate": false, "token0Decimals": 0 } }, "redstoneOracle": { "oracle": "0x0000000000000000000000000000000000000000", "invertRate": false, "token0Decimals": 0 }, "mainSource": 1 }, "0xFdB631F5EE196F0ed6FAa767959853A9F217697D" ], "numDeployments": 1, "solcInputHash": "d90fd93c0cb282113613d77962ef8eb0", "metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"infoName_\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"mainSource\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"hops\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"feed\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"token0Decimals\",\"type\":\"uint256\"}],\"internalType\":\"struct ChainlinkStructs.ChainlinkFeedData\",\"name\":\"feed1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"feed\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"token0Decimals\",\"type\":\"uint256\"}],\"internalType\":\"struct ChainlinkStructs.ChainlinkFeedData\",\"name\":\"feed2\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"feed\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"token0Decimals\",\"type\":\"uint256\"}],\"internalType\":\"struct ChainlinkStructs.ChainlinkFeedData\",\"name\":\"feed3\",\"type\":\"tuple\"}],\"internalType\":\"struct ChainlinkStructs.ChainlinkConstructorParams\",\"name\":\"chainlinkParams\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contract IRedstoneOracle\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"token0Decimals\",\"type\":\"uint256\"}],\"internalType\":\"struct RedstoneStructs.RedstoneOracleData\",\"name\":\"redstoneOracle\",\"type\":\"tuple\"}],\"internalType\":\"struct FallbackCLRSOracleL2.CLRSConstructorParams\",\"name\":\"cLRSParams1_\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"mainSource\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"hops\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"feed\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"token0Decimals\",\"type\":\"uint256\"}],\"internalType\":\"struct ChainlinkStructs.ChainlinkFeedData\",\"name\":\"feed1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"feed\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"token0Decimals\",\"type\":\"uint256\"}],\"internalType\":\"struct ChainlinkStructs.ChainlinkFeedData\",\"name\":\"feed2\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"feed\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"token0Decimals\",\"type\":\"uint256\"}],\"internalType\":\"struct ChainlinkStructs.ChainlinkFeedData\",\"name\":\"feed3\",\"type\":\"tuple\"}],\"internalType\":\"struct ChainlinkStructs.ChainlinkConstructorParams\",\"name\":\"chainlinkParams\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contract IRedstoneOracle\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"token0Decimals\",\"type\":\"uint256\"}],\"internalType\":\"struct RedstoneStructs.RedstoneOracleData\",\"name\":\"redstoneOracle\",\"type\":\"tuple\"}],\"internalType\":\"struct FallbackCLRSOracleL2.CLRSConstructorParams\",\"name\":\"cLRSParams2_\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"sequencerUptimeFeed_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"errorId_\",\"type\":\"uint256\"}],\"name\":\"FluidOracleError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FALLBACK_ORACLE2_MAIN_SOURCE\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FALLBACK_ORACLE_MAIN_SOURCE\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainlinkOracleData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainlinkExchangeRate_\",\"type\":\"uint256\"},{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"chainlinkFeed1_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"chainlinkInvertRate1_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"chainlinkExchangeRate1_\",\"type\":\"uint256\"},{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"chainlinkFeed2_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"chainlinkInvertRate2_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"chainlinkExchangeRate2_\",\"type\":\"uint256\"},{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"chainlinkFeed3_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"chainlinkInvertRate3_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"chainlinkExchangeRate3_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainlinkOracleData2\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainlinkExchangeRate_\",\"type\":\"uint256\"},{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"chainlinkFeed1_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"chainlinkInvertRate1_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"chainlinkExchangeRate1_\",\"type\":\"uint256\"},{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"chainlinkFeed2_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"chainlinkInvertRate2_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"chainlinkExchangeRate2_\",\"type\":\"uint256\"},{\"internalType\":\"contract IChainlinkAggregatorV3\",\"name\":\"chainlinkFeed3_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"chainlinkInvertRate3_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"chainlinkExchangeRate3_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExchangeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"exchangeRate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExchangeRateLiquidate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"exchangeRate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExchangeRateOperate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"exchangeRate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"infoName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"redstoneOracleData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"redstoneExchangeRate_\",\"type\":\"uint256\"},{\"internalType\":\"contract IRedstoneOracle\",\"name\":\"redstoneOracle_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"redstoneInvertRate_\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"redstoneOracleData2\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"redstoneExchangeRate_\",\"type\":\"uint256\"},{\"internalType\":\"contract IRedstoneOracle\",\"name\":\"redstoneOracle_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"redstoneInvertRate_\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequencerL2Data\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"sequencerUptimeFeed_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxGracePeriod_\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isSequencerUp_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastUptimeStartedAt_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gracePeriod_\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"gracePeriodPassed_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastOutageStartedAt_\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isSequencerUpAndValid_\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"cLRSParams1_\":\"CLRS Fallback Oracle data for ratio dividend\",\"cLRSParams2_\":\"CLRS Fallback Oracle data for ratio divisor\",\"infoName_\":\"Oracle identify helper name.\",\"sequencerUptimeFeed_\":\"L2 sequencer uptime Chainlink feed\"}},\"getExchangeRate()\":{\"details\":\"Deprecated. Use `getExchangeRateOperate()` and `getExchangeRateLiquidate()` instead. Only implemented for backwards compatibility.\"}},\"title\":\"Ratio of 2 Chainlink / Redstone Oracles (with fallback) for Layer 2 (with sequencer outage detection)\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"FALLBACK_ORACLE2_MAIN_SOURCE()\":{\"notice\":\"which oracle to use as main source: - 1 = Chainlink ONLY (no fallback) - 2 = Chainlink with Redstone Fallback - 3 = Redstone with Chainlink Fallback\"},\"FALLBACK_ORACLE_MAIN_SOURCE()\":{\"notice\":\"which oracle to use as main source: - 1 = Chainlink ONLY (no fallback) - 2 = Chainlink with Redstone Fallback - 3 = Redstone with Chainlink Fallback\"},\"chainlinkOracleData()\":{\"notice\":\"returns all Chainlink oracle related data as utility for easy off-chain use / block explorer in a single view method\"},\"chainlinkOracleData2()\":{\"notice\":\"returns all Chainlink oracle related data as utility for easy off-chain use / block explorer in a single view method\"},\"constructor\":{\"notice\":\"sets the two CLRS oracle configs\"},\"getExchangeRateLiquidate()\":{\"notice\":\"Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for liquidations\"},\"getExchangeRateOperate()\":{\"notice\":\"Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for operates\"},\"infoName()\":{\"notice\":\"helper string to easily identify the oracle. E.g. token symbols\"},\"redstoneOracleData()\":{\"notice\":\"returns all Redstone oracle related data as utility for easy off-chain use / block explorer in a single view method\"},\"redstoneOracleData2()\":{\"notice\":\"returns all Redstone oracle related data as utility for easy off-chain use / block explorer in a single view method\"},\"sequencerL2Data()\":{\"notice\":\"returns all sequencer uptime feed related data\"}},\"notice\":\"Gets the exchange rate between the underlying asset and the peg asset by using: 1. 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. 2. set into ratio with another price fetched the same way. I.e. it is possible to do Chainlink Oracle / Chainlink Oracle. E.g. wstETH per 1 weETH on a L2 via CL feeds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracle/oraclesL2/ratio2xFallbackCLRSOracleL2.sol\":\"Ratio2xFallbackCLRSOracleL2\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000000},\"remappings\":[]},\"sources\":{\"contracts/oracle/error.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\ncontract Error {\\n error FluidOracleError(uint256 errorId_);\\n}\\n\",\"keccak256\":\"0xc7b7e945238168d216c480e9dd4fbaaf8780645d58c47f9abdaa4f29910568fe\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/errorTypes.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nlibrary ErrorTypes {\\n /***********************************|\\n | FluidOracleL2 | \\n |__________________________________*/\\n\\n /// @notice thrown when sequencer on a L2 has an outage and grace period has not yet passed.\\n uint256 internal constant FluidOracleL2__SequencerOutage = 60000;\\n\\n /***********************************|\\n | UniV3CheckCLRSOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the delta between main price source and check rate source is exceeding the allowed delta\\n uint256 internal constant UniV3CheckCLRSOracle__InvalidPrice = 60001;\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant UniV3CheckCLRSOracle__InvalidParams = 60002;\\n\\n /// @notice thrown when the exchange rate is zero, even after all possible fallbacks depending on config\\n uint256 internal constant UniV3CheckCLRSOracle__ExchangeRateZero = 60003;\\n\\n /***********************************|\\n | FluidOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid info name is passed into a fluid oracle (e.g. not set or too long)\\n uint256 internal constant FluidOracle__InvalidInfoName = 60010;\\n\\n /***********************************|\\n | sUSDe Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant SUSDeOracle__InvalidParams = 60102;\\n\\n /***********************************|\\n | Pendle Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant PendleOracle__InvalidParams = 60201;\\n\\n /// @notice thrown when the Pendle market Oracle has not been initialized yet\\n uint256 internal constant PendleOracle__MarketNotInitialized = 60202;\\n\\n /// @notice thrown when the Pendle market does not have 18 decimals\\n uint256 internal constant PendleOracle__MarketInvalidDecimals = 60203;\\n\\n /// @notice thrown when the Pendle market returns an unexpected price\\n uint256 internal constant PendleOracle__InvalidPrice = 60204;\\n\\n /***********************************|\\n | CLRS2UniV3CheckCLRSOracleL2 | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even after all possible fallbacks depending on config\\n uint256 internal constant CLRS2UniV3CheckCLRSOracleL2__ExchangeRateZero = 60301;\\n\\n /***********************************|\\n | Ratio2xFallbackCLRSOracleL2 | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even after all possible fallbacks depending on config\\n uint256 internal constant Ratio2xFallbackCLRSOracleL2__ExchangeRateZero = 60311;\\n\\n /***********************************|\\n | Chainlink Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant ChainlinkOracle__InvalidParams = 61001;\\n\\n /***********************************|\\n | UniswapV3 Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant UniV3Oracle__InvalidParams = 62001;\\n\\n /// @notice thrown when constructor is called with invalid ordered seconds agos values\\n uint256 internal constant UniV3Oracle__InvalidSecondsAgos = 62002;\\n\\n /// @notice thrown when constructor is called with invalid delta values > 100%\\n uint256 internal constant UniV3Oracle__InvalidDeltas = 62003;\\n\\n /***********************************|\\n | WstETh Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant WstETHOracle__InvalidParams = 63001;\\n\\n /***********************************|\\n | Redstone Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant RedstoneOracle__InvalidParams = 64001;\\n\\n /***********************************|\\n | Fallback Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant FallbackOracle__InvalidParams = 65001;\\n\\n /***********************************|\\n | FallbackCLRSOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even for the fallback oracle source (if enabled)\\n uint256 internal constant FallbackCLRSOracle__ExchangeRateZero = 66001;\\n\\n /***********************************|\\n | WstETHCLRSOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even for the fallback oracle source (if enabled)\\n uint256 internal constant WstETHCLRSOracle__ExchangeRateZero = 67001;\\n\\n /***********************************|\\n | CLFallbackUniV3Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even for the uniV3 rate\\n uint256 internal constant CLFallbackUniV3Oracle__ExchangeRateZero = 68001;\\n\\n /***********************************|\\n | WstETHCLRS2UniV3CheckCLRSOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even for the uniV3 rate\\n uint256 internal constant WstETHCLRS2UniV3CheckCLRSOracle__ExchangeRateZero = 69001;\\n\\n /***********************************|\\n | WeETh Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant WeETHOracle__InvalidParams = 70001;\\n}\\n\",\"keccak256\":\"0xf19666bfe3d92c9449423d8d35f35e39a4beac9e23cf547e1e38427ef13a6838\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/fluidOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IFluidOracle } from \\\"./interfaces/iFluidOracle.sol\\\";\\nimport { ErrorTypes } from \\\"./errorTypes.sol\\\";\\nimport { Error as OracleError } from \\\"./error.sol\\\";\\n\\n/// @title FluidOracle\\n/// @notice Base contract that any Fluid Oracle must implement\\nabstract contract FluidOracle is IFluidOracle, OracleError {\\n /// @dev short helper string to easily identify the oracle. E.g. token symbols\\n //\\n // using a bytes32 because string can not be immutable.\\n bytes32 private immutable _infoName;\\n\\n constructor(string memory infoName_) {\\n if (bytes(infoName_).length > 32 || bytes(infoName_).length == 0) {\\n revert FluidOracleError(ErrorTypes.FluidOracle__InvalidInfoName);\\n }\\n\\n // convert string to bytes32\\n bytes32 infoNameBytes32_;\\n assembly {\\n infoNameBytes32_ := mload(add(infoName_, 32))\\n }\\n _infoName = infoNameBytes32_;\\n }\\n\\n /// @inheritdoc IFluidOracle\\n function infoName() external view returns (string memory) {\\n // convert bytes32 to string\\n uint256 length_;\\n while (length_ < 32 && _infoName[length_] != 0) {\\n length_++;\\n }\\n bytes memory infoNameBytes_ = new bytes(length_);\\n for (uint256 i; i < length_; i++) {\\n infoNameBytes_[i] = _infoName[i];\\n }\\n return string(infoNameBytes_);\\n }\\n\\n /// @inheritdoc IFluidOracle\\n function getExchangeRate() external view virtual returns (uint256 exchangeRate_);\\n\\n /// @inheritdoc IFluidOracle\\n function getExchangeRateOperate() external view virtual returns (uint256 exchangeRate_);\\n\\n /// @inheritdoc IFluidOracle\\n function getExchangeRateLiquidate() external view virtual returns (uint256 exchangeRate_);\\n}\\n\",\"keccak256\":\"0x2b56537a18379b4d7f69b9d95ebdb39e302951dbcaca882c27b4405bf1ea784b\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/fluidOracleL2.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IFluidOracle } from \\\"./interfaces/iFluidOracle.sol\\\";\\nimport { ErrorTypes } from \\\"./errorTypes.sol\\\";\\nimport { IChainlinkAggregatorV3 } from \\\"./interfaces/external/IChainlinkAggregatorV3.sol\\\";\\nimport { Error as OracleError } from \\\"./error.sol\\\";\\n\\n/// @title FluidOracleL2\\n/// @notice Base contract that any Fluid Oracle L2 must implement\\nabstract contract FluidOracleL2 is IFluidOracle, OracleError {\\n /// @dev Chainlink L2 Sequencer Uptime feed to detect sequencer outages\\n IChainlinkAggregatorV3 internal _SEQUENCER_ORACLE;\\n /// @dev max time period until oracle assumes normal behavior after a sequencer outage.\\n uint256 internal constant _SEQUENCER_MAX_GRACE_PERIOD = 45 minutes;\\n\\n /// @notice sets the L2 sequencer uptime Chainlink feed\\n constructor(address sequencerUptimeFeed_) {\\n _SEQUENCER_ORACLE = IChainlinkAggregatorV3(sequencerUptimeFeed_);\\n }\\n\\n /// @notice returns all sequencer uptime feed related data\\n function sequencerL2Data()\\n public\\n view\\n returns (\\n address sequencerUptimeFeed_,\\n uint256 maxGracePeriod_,\\n bool isSequencerUp_,\\n uint256 lastUptimeStartedAt_,\\n uint256 gracePeriod_,\\n bool gracePeriodPassed_,\\n uint256 lastOutageStartedAt_,\\n bool isSequencerUpAndValid_\\n )\\n {\\n uint80 uptimeStartRoundId_;\\n (isSequencerUp_, uptimeStartRoundId_, lastUptimeStartedAt_) = _sequencerUpStatus();\\n\\n if (isSequencerUp_) {\\n (gracePeriod_, gracePeriodPassed_, lastOutageStartedAt_) = _gracePeriod(\\n uptimeStartRoundId_,\\n lastUptimeStartedAt_\\n );\\n } else {\\n gracePeriod_ = _SEQUENCER_MAX_GRACE_PERIOD;\\n (uint80 roundId_, , , , ) = _SEQUENCER_ORACLE.latestRoundData();\\n lastOutageStartedAt_ = _lastSequencerOutageStart(roundId_ + 1);\\n }\\n\\n return (\\n address(_SEQUENCER_ORACLE),\\n _SEQUENCER_MAX_GRACE_PERIOD,\\n isSequencerUp_,\\n lastUptimeStartedAt_,\\n gracePeriod_,\\n gracePeriodPassed_,\\n lastOutageStartedAt_,\\n isSequencerUp_ && gracePeriodPassed_\\n );\\n }\\n\\n /// @dev ensures that the sequencer is up and grace period has passed\\n function _ensureSequencerUpAndValid() internal view {\\n (bool isSequencerUp_, uint80 uptimeStartRoundId_, uint256 uptimeStartedAt_) = _sequencerUpStatus();\\n\\n if (!isSequencerUp_) {\\n revert FluidOracleError(ErrorTypes.FluidOracleL2__SequencerOutage);\\n }\\n\\n (, bool gracePeriodPassed_, ) = _gracePeriod(uptimeStartRoundId_, uptimeStartedAt_);\\n if (!gracePeriodPassed_) {\\n revert FluidOracleError(ErrorTypes.FluidOracleL2__SequencerOutage);\\n }\\n }\\n\\n /// @inheritdoc IFluidOracle\\n function getExchangeRate() external view virtual returns (uint256 exchangeRate_);\\n\\n /// @inheritdoc IFluidOracle\\n function getExchangeRateOperate() external view virtual returns (uint256 exchangeRate_);\\n\\n /// @inheritdoc IFluidOracle\\n function getExchangeRateLiquidate() external view virtual returns (uint256 exchangeRate_);\\n\\n /// @dev finds last round before `uptimeStartRoundId_` where sequencer status was down, incl. handling cases of\\n /// consecutive rounds where status was down.\\n function _lastSequencerOutageStart(uint80 uptimeStartRoundId_) private view returns (uint256 outageStartedAt_) {\\n uint80 roundId_ = uptimeStartRoundId_;\\n int256 answer_;\\n uint256 startedAt_;\\n do {\\n (roundId_, answer_, startedAt_, , ) = _SEQUENCER_ORACLE.getRoundData(roundId_ - 1);\\n if (answer_ != 0) {\\n // sequencer was down at this round, update outage started at data\\n outageStartedAt_ = startedAt_;\\n } // else: while loop is going to break\\n } while (answer_ != 0 && startedAt_ > 0);\\n }\\n\\n /// @dev finds last round where sequencer status was up, incl. handling cases of consecutive rounds where status was up.\\n function _sequencerUpStatus()\\n private\\n view\\n returns (bool isSequencerUp_, uint80 uptimeStartRoundId_, uint256 uptimeStartedAt_)\\n {\\n (uint80 roundId_, int256 answer_, uint256 startedAt_, , ) = _SEQUENCER_ORACLE.latestRoundData();\\n if (answer_ != 0) {\\n // sequencer is down currently.\\n return (false, 0, 0);\\n }\\n\\n isSequencerUp_ = true;\\n\\n // cover case where there were other consecutive uptime report rounds in between\\n uptimeStartRoundId_ = roundId_;\\n uptimeStartedAt_ = startedAt_;\\n if (uptimeStartedAt_ > 0) {\\n do {\\n (roundId_, answer_, startedAt_, , ) = _SEQUENCER_ORACLE.getRoundData(roundId_ - 1);\\n if (answer_ == 0) {\\n // sequencer was up at this round, consecutive uptime so update uptime start data\\n uptimeStartRoundId_ = roundId_;\\n uptimeStartedAt_ = startedAt_;\\n } // else: while loop is going to break\\n } while (answer_ == 0 && startedAt_ > 0);\\n } // else if startedAt == 0, then it is the first ever round.\\n }\\n\\n /// @dev returns the `gracePeriod_` duration and if the grace period has `passed_` based on\\n /// current uptime round data vs the last sequencer outage duration.\\n function _gracePeriod(\\n uint80 uptimeStartRoundId_,\\n uint256 uptimeStartedAt_\\n ) private view returns (uint256 gracePeriod_, bool passed_, uint256 outageStartedAt_) {\\n uint256 uptimeDuration_ = block.timestamp - uptimeStartedAt_;\\n if (uptimeStartedAt_ == 0 || uptimeDuration_ > _SEQUENCER_MAX_GRACE_PERIOD) {\\n return (_SEQUENCER_MAX_GRACE_PERIOD, true, 0);\\n }\\n\\n outageStartedAt_ = _lastSequencerOutageStart(uptimeStartRoundId_);\\n\\n // grace period is outage duration, capped at _SEQUENCER_MAX_GRACE_PERIOD\\n gracePeriod_ = uptimeStartedAt_ - outageStartedAt_; // outage duration\\n if (gracePeriod_ > _SEQUENCER_MAX_GRACE_PERIOD) {\\n gracePeriod_ = _SEQUENCER_MAX_GRACE_PERIOD;\\n }\\n\\n return (gracePeriod_, uptimeDuration_ > gracePeriod_, outageStartedAt_);\\n }\\n}\\n\",\"keccak256\":\"0x8e70aa5ab5574d0a32cece6a05fd8296efd527281ebc3c236ecad2fc8e310a6b\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/chainlinkOracleImpl.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { IChainlinkAggregatorV3 } from \\\"../interfaces/external/IChainlinkAggregatorV3.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\nimport { ChainlinkStructs } from \\\"./structs.sol\\\";\\n\\n/// @title Chainlink Oracle implementation\\n/// @notice This contract is used to get the exchange rate via up to 3 hops at Chainlink price feeds.\\n/// The rate is multiplied with the previous rate at each hop.\\n/// E.g. to go from wBTC to USDC (assuming rates for example):\\n/// 1. wBTC -> BTC https://data.chain.link/ethereum/mainnet/crypto-other/wbtc-btc, rate: 0.92.\\n/// 2. BTC -> USD https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd rate: 30,000.\\n/// 3. USD -> USDC https://data.chain.link/ethereum/mainnet/stablecoins/usdc-usd rate: 0.98. Must invert feed: 1.02\\n/// finale rate would be: 0.92 * 30,000 * 1.02 = 28,152\\nabstract contract ChainlinkOracleImpl is OracleError, ChainlinkStructs {\\n /// @notice Chainlink price feed 1 to check for the exchange rate\\n IChainlinkAggregatorV3 internal immutable _CHAINLINK_FEED1;\\n /// @notice Chainlink price feed 2 to check for the exchange rate\\n IChainlinkAggregatorV3 internal immutable _CHAINLINK_FEED2;\\n /// @notice Chainlink price feed 3 to check for the exchange rate\\n IChainlinkAggregatorV3 internal immutable _CHAINLINK_FEED3;\\n\\n /// @notice Flag to invert the price or not for feed 1 (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)\\n bool internal immutable _CHAINLINK_INVERT_RATE1;\\n /// @notice Flag to invert the price or not for feed 2 (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)\\n bool internal immutable _CHAINLINK_INVERT_RATE2;\\n /// @notice Flag to invert the price or not for feed 3 (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)\\n bool internal immutable _CHAINLINK_INVERT_RATE3;\\n\\n /// @notice constant value for price scaling to reduce gas usage for feed 1\\n uint256 internal immutable _CHAINLINK_PRICE_SCALER_MULTIPLIER1;\\n /// @notice constant value for inverting price to reduce gas usage for feed 1\\n uint256 internal immutable _CHAINLINK_INVERT_PRICE_DIVIDEND1;\\n\\n /// @notice constant value for price scaling to reduce gas usage for feed 2\\n uint256 internal immutable _CHAINLINK_PRICE_SCALER_MULTIPLIER2;\\n /// @notice constant value for inverting price to reduce gas usage for feed 2\\n uint256 internal immutable _CHAINLINK_INVERT_PRICE_DIVIDEND2;\\n\\n /// @notice constant value for price scaling to reduce gas usage for feed 3\\n uint256 internal immutable _CHAINLINK_PRICE_SCALER_MULTIPLIER3;\\n /// @notice constant value for inverting price to reduce gas usage for feed 3\\n uint256 internal immutable _CHAINLINK_INVERT_PRICE_DIVIDEND3;\\n\\n /// @notice constructor sets the Chainlink price feed and invertRate flag for each hop.\\n /// E.g. `invertRate_` should be true if for the USDC/ETH pool it's expected that the oracle returns USDC per 1 ETH\\n constructor(ChainlinkConstructorParams memory params_) {\\n if (\\n (params_.hops < 1 || params_.hops > 3) || // hops must be 1, 2 or 3\\n (address(params_.feed1.feed) == address(0) || params_.feed1.token0Decimals == 0) || // first feed must always be defined\\n (params_.hops > 1 && (address(params_.feed2.feed) == address(0) || params_.feed2.token0Decimals == 0)) || // if hops > 1, feed 2 must be defined\\n (params_.hops > 2 && (address(params_.feed3.feed) == address(0) || params_.feed3.token0Decimals == 0)) // if hops > 2, feed 3 must be defined\\n ) {\\n revert FluidOracleError(ErrorTypes.ChainlinkOracle__InvalidParams);\\n }\\n\\n _CHAINLINK_FEED1 = params_.feed1.feed;\\n _CHAINLINK_FEED2 = params_.feed2.feed;\\n _CHAINLINK_FEED3 = params_.feed3.feed;\\n\\n _CHAINLINK_INVERT_RATE1 = params_.feed1.invertRate;\\n _CHAINLINK_INVERT_RATE2 = params_.feed2.invertRate;\\n _CHAINLINK_INVERT_RATE3 = params_.feed3.invertRate;\\n\\n // Actual desired output rate example USDC/ETH (6 decimals / 18 decimals).\\n // Note ETH has 12 decimals more than USDC.\\n // 0.000515525322211842331991619857165357691 // 39 decimals. ETH for 1 USDC\\n // 1954.190000000000433 // 15 decimals. USDC for 1 ETH\\n\\n // to get to PRICE_SCLAER_MULTIPLIER and INVERT_PRICE_DIVIDEND:\\n // fetched Chainlink price is in token1Decimals per 1 token0Decimals.\\n // E.g. for an USDC/ETH price feed it's in ETH 18 decimals.\\n // for an BTC/USD price feed it's in USD 8 decimals.\\n // So to scale to 1e27 we need to multiply by 1e27 - token0Decimals.\\n // E.g. for USDC/ETH it would be: fetchedPrice * 1e21\\n //\\n // or for inverted (x token0 per 1 token1), formula would be:\\n // = 1e27 * 10**token0Decimals / fetchedPrice\\n // E.g. for USDC/ETH it would be: 1e33 / fetchedPrice\\n\\n // no support for token1Decimals with more than OracleUtils.RATE_OUTPUT_DECIMALS decimals for now as extremely unlikely case\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER1 = 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - params_.feed1.token0Decimals);\\n _CHAINLINK_INVERT_PRICE_DIVIDEND1 = 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS + params_.feed1.token0Decimals);\\n\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER2 = params_.hops > 1\\n ? 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - params_.feed2.token0Decimals)\\n : 1;\\n _CHAINLINK_INVERT_PRICE_DIVIDEND2 = params_.hops > 1\\n ? 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS + params_.feed2.token0Decimals)\\n : 1;\\n\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER3 = params_.hops > 2\\n ? 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - params_.feed3.token0Decimals)\\n : 1;\\n _CHAINLINK_INVERT_PRICE_DIVIDEND3 = params_.hops > 2\\n ? 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS + params_.feed3.token0Decimals)\\n : 1;\\n }\\n\\n /// @dev Get the exchange rate from Chainlike oracle price feed(s)\\n /// @return rate_ The exchange rate in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n function _getChainlinkExchangeRate() internal view returns (uint256 rate_) {\\n rate_ = _readFeedRate(\\n _CHAINLINK_FEED1,\\n _CHAINLINK_INVERT_RATE1,\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER1,\\n _CHAINLINK_INVERT_PRICE_DIVIDEND1\\n );\\n if (rate_ == 0 || address(_CHAINLINK_FEED2) == address(0)) {\\n // rate 0 or only 1 hop -> return rate of price feed 1\\n return rate_;\\n }\\n rate_ =\\n (rate_ *\\n _readFeedRate(\\n _CHAINLINK_FEED2,\\n _CHAINLINK_INVERT_RATE2,\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER2,\\n _CHAINLINK_INVERT_PRICE_DIVIDEND2\\n )) /\\n (10 ** OracleUtils.RATE_OUTPUT_DECIMALS);\\n\\n if (rate_ == 0 || address(_CHAINLINK_FEED3) == address(0)) {\\n // rate 0 or 2 hops -> return rate of feed 1 combined with feed 2\\n return rate_;\\n }\\n\\n // 3 hops -> return rate of feed 1 combined with feed 2 & feed 3\\n rate_ =\\n (rate_ *\\n _readFeedRate(\\n _CHAINLINK_FEED3,\\n _CHAINLINK_INVERT_RATE3,\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER3,\\n _CHAINLINK_INVERT_PRICE_DIVIDEND3\\n )) /\\n (10 ** OracleUtils.RATE_OUTPUT_DECIMALS);\\n }\\n\\n /// @dev reads the exchange `rate_` from a Chainlink price `feed_` taking into account scaling and `invertRate_`\\n function _readFeedRate(\\n IChainlinkAggregatorV3 feed_,\\n bool invertRate_,\\n uint256 priceMultiplier_,\\n uint256 invertDividend_\\n ) private view returns (uint256 rate_) {\\n try feed_.latestRoundData() returns (uint80, int256 exchangeRate_, uint256, uint256, uint80) {\\n // Return the price in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n if (invertRate_) {\\n return invertDividend_ / uint256(exchangeRate_);\\n } else {\\n return uint256(exchangeRate_) * priceMultiplier_;\\n }\\n } catch {\\n return 0;\\n }\\n }\\n\\n /// @notice returns all Chainlink oracle related data as utility for easy off-chain use / block explorer in a single view method\\n function chainlinkOracleData()\\n public\\n view\\n returns (\\n uint256 chainlinkExchangeRate_,\\n IChainlinkAggregatorV3 chainlinkFeed1_,\\n bool chainlinkInvertRate1_,\\n uint256 chainlinkExchangeRate1_,\\n IChainlinkAggregatorV3 chainlinkFeed2_,\\n bool chainlinkInvertRate2_,\\n uint256 chainlinkExchangeRate2_,\\n IChainlinkAggregatorV3 chainlinkFeed3_,\\n bool chainlinkInvertRate3_,\\n uint256 chainlinkExchangeRate3_\\n )\\n {\\n return (\\n _getChainlinkExchangeRate(),\\n _CHAINLINK_FEED1,\\n _CHAINLINK_INVERT_RATE1,\\n _readFeedRate(\\n _CHAINLINK_FEED1,\\n _CHAINLINK_INVERT_RATE1,\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER1,\\n _CHAINLINK_INVERT_PRICE_DIVIDEND1\\n ),\\n _CHAINLINK_FEED2,\\n _CHAINLINK_INVERT_RATE2,\\n address(_CHAINLINK_FEED2) == address(0)\\n ? 0\\n : _readFeedRate(\\n _CHAINLINK_FEED2,\\n _CHAINLINK_INVERT_RATE2,\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER2,\\n _CHAINLINK_INVERT_PRICE_DIVIDEND2\\n ),\\n _CHAINLINK_FEED3,\\n _CHAINLINK_INVERT_RATE3,\\n address(_CHAINLINK_FEED3) == address(0)\\n ? 0\\n : _readFeedRate(\\n _CHAINLINK_FEED3,\\n _CHAINLINK_INVERT_RATE3,\\n _CHAINLINK_PRICE_SCALER_MULTIPLIER3,\\n _CHAINLINK_INVERT_PRICE_DIVIDEND3\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0xe7656c6a48277513acca3c891d53960682f949e1913a6377b2f4a7b1a6132772\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/chainlinkOracleImpl2.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { IChainlinkAggregatorV3 } from \\\"../interfaces/external/IChainlinkAggregatorV3.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\nimport { ChainlinkStructs } from \\\"./structs.sol\\\";\\n\\n// @dev Exact same contract as ChainlinkOracleImpl, just with all vars, immutables etc. renamed with a \\\"2\\\" to avoid\\n// conflicts when ChainlinkOracleImpl would have to be inherited twice.\\n\\n/// @title Chainlink Oracle implementation.\\n/// @notice This contract is used to get the exchange rate via up to 3 hops at Chainlink price feeds.\\n/// The rate is multiplied with the previous rate at each hop.\\n/// E.g. to go from wBTC to USDC (assuming rates for example):\\n/// 1. wBTC -> BTC https://data.chain.link/ethereum/mainnet/crypto-other/wbtc-btc, rate: 0.92.\\n/// 2. BTC -> USD https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd rate: 30,000.\\n/// 3. USD -> USDC https://data.chain.link/ethereum/mainnet/stablecoins/usdc-usd rate: 0.98. Must invert feed: 1.02\\n/// finale rate would be: 0.92 * 30,000 * 1.02 = 28,152\\nabstract contract ChainlinkOracleImpl2 is OracleError, ChainlinkStructs {\\n /// @notice Chainlink price feed 1 to check for the exchange rate\\n IChainlinkAggregatorV3 internal immutable _CHAINLINK2_FEED1;\\n /// @notice Chainlink price feed 2 to check for the exchange rate\\n IChainlinkAggregatorV3 internal immutable _CHAINLINK2_FEED2;\\n /// @notice Chainlink price feed 3 to check for the exchange rate\\n IChainlinkAggregatorV3 internal immutable _CHAINLINK2_FEED3;\\n\\n /// @notice Flag to invert the price or not for feed 1 (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)\\n bool internal immutable _CHAINLINK2_INVERT_RATE1;\\n /// @notice Flag to invert the price or not for feed 2 (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)\\n bool internal immutable _CHAINLINK2_INVERT_RATE2;\\n /// @notice Flag to invert the price or not for feed 3 (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)\\n bool internal immutable _CHAINLINK2_INVERT_RATE3;\\n\\n /// @notice constant value for price scaling to reduce gas usage for feed 1\\n uint256 internal immutable _CHAINLINK2_PRICE_SCALER_MULTIPLIER1;\\n /// @notice constant value for inverting price to reduce gas usage for feed 1\\n uint256 internal immutable _CHAINLINK2_INVERT_PRICE_DIVIDEND1;\\n\\n /// @notice constant value for price scaling to reduce gas usage for feed 2\\n uint256 internal immutable _CHAINLINK2_PRICE_SCALER_MULTIPLIER2;\\n /// @notice constant value for inverting price to reduce gas usage for feed 2\\n uint256 internal immutable _CHAINLINK2_INVERT_PRICE_DIVIDEND2;\\n\\n /// @notice constant value for price scaling to reduce gas usage for feed 3\\n uint256 internal immutable _CHAINLINK2_PRICE_SCALER_MULTIPLIER3;\\n /// @notice constant value for inverting price to reduce gas usage for feed 3\\n uint256 internal immutable _CHAINLINK2_INVERT_PRICE_DIVIDEND3;\\n\\n /// @notice constructor sets the Chainlink price feed and invertRate flag for each hop.\\n /// E.g. `invertRate_` should be true if for the USDC/ETH pool it's expected that the oracle returns USDC per 1 ETH\\n constructor(ChainlinkConstructorParams memory params_) {\\n if (\\n (params_.hops < 1 || params_.hops > 3) || // hops must be 1, 2 or 3\\n (address(params_.feed1.feed) == address(0) || params_.feed1.token0Decimals == 0) || // first feed must always be defined\\n (params_.hops > 1 && (address(params_.feed2.feed) == address(0) || params_.feed2.token0Decimals == 0)) || // if hops > 1, feed 2 must be defined\\n (params_.hops > 2 && (address(params_.feed3.feed) == address(0) || params_.feed3.token0Decimals == 0)) // if hops > 2, feed 3 must be defined\\n ) {\\n revert FluidOracleError(ErrorTypes.ChainlinkOracle__InvalidParams);\\n }\\n\\n _CHAINLINK2_FEED1 = params_.feed1.feed;\\n _CHAINLINK2_FEED2 = params_.feed2.feed;\\n _CHAINLINK2_FEED3 = params_.feed3.feed;\\n\\n _CHAINLINK2_INVERT_RATE1 = params_.feed1.invertRate;\\n _CHAINLINK2_INVERT_RATE2 = params_.feed2.invertRate;\\n _CHAINLINK2_INVERT_RATE3 = params_.feed3.invertRate;\\n\\n // Actual desired output rate example USDC/ETH (6 decimals / 18 decimals).\\n // Note ETH has 12 decimals more than USDC.\\n // 0.000515525322211842331991619857165357691 // 39 decimals. ETH for 1 USDC\\n // 1954.190000000000433 // 15 decimals. USDC for 1 ETH\\n\\n // to get to PRICE_SCLAER_MULTIPLIER and INVERT_PRICE_DIVIDEND:\\n // fetched Chainlink price is in token1Decimals per 1 token0Decimals.\\n // E.g. for an USDC/ETH price feed it's in ETH 18 decimals.\\n // for an BTC/USD price feed it's in USD 8 decimals.\\n // So to scale to 1e27 we need to multiply by 1e27 - token0Decimals.\\n // E.g. for USDC/ETH it would be: fetchedPrice * 1e21\\n //\\n // or for inverted (x token0 per 1 token1), formula would be:\\n // = 1e27 * 10**token0Decimals / fetchedPrice\\n // E.g. for USDC/ETH it would be: 1e33 / fetchedPrice\\n\\n // no support for token1Decimals with more than OracleUtils.RATE_OUTPUT_DECIMALS decimals for now as extremely unlikely case\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER1 = 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - params_.feed1.token0Decimals);\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND1 = 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS + params_.feed1.token0Decimals);\\n\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER2 = params_.hops > 1\\n ? 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - params_.feed2.token0Decimals)\\n : 1;\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND2 = params_.hops > 1\\n ? 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS + params_.feed2.token0Decimals)\\n : 1;\\n\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER3 = params_.hops > 2\\n ? 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - params_.feed3.token0Decimals)\\n : 1;\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND3 = params_.hops > 2\\n ? 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS + params_.feed3.token0Decimals)\\n : 1;\\n }\\n\\n /// @dev Get the exchange rate from Chainlike oracle price feed(s)\\n /// @return rate_ The exchange rate in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n function _getChainlinkExchangeRate2() internal view returns (uint256 rate_) {\\n rate_ = _readFeedRate2(\\n _CHAINLINK2_FEED1,\\n _CHAINLINK2_INVERT_RATE1,\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER1,\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND1\\n );\\n if (rate_ == 0 || address(_CHAINLINK2_FEED2) == address(0)) {\\n // rate 0 or only 1 hop -> return rate of price feed 1\\n return rate_;\\n }\\n rate_ =\\n (rate_ *\\n _readFeedRate2(\\n _CHAINLINK2_FEED2,\\n _CHAINLINK2_INVERT_RATE2,\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER2,\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND2\\n )) /\\n (10 ** OracleUtils.RATE_OUTPUT_DECIMALS);\\n\\n if (rate_ == 0 || address(_CHAINLINK2_FEED3) == address(0)) {\\n // rate 0 or 2 hops -> return rate of feed 1 combined with feed 2\\n return rate_;\\n }\\n\\n // 3 hops -> return rate of feed 1 combined with feed 2 & feed 3\\n rate_ =\\n (rate_ *\\n _readFeedRate2(\\n _CHAINLINK2_FEED3,\\n _CHAINLINK2_INVERT_RATE3,\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER3,\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND3\\n )) /\\n (10 ** OracleUtils.RATE_OUTPUT_DECIMALS);\\n }\\n\\n /// @dev reads the exchange `rate_` from a Chainlink price `feed_` taking into account scaling and `invertRate_`\\n function _readFeedRate2(\\n IChainlinkAggregatorV3 feed_,\\n bool invertRate_,\\n uint256 priceMultiplier_,\\n uint256 invertDividend_\\n ) private view returns (uint256 rate_) {\\n try feed_.latestRoundData() returns (uint80, int256 exchangeRate_, uint256, uint256, uint80) {\\n // Return the price in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n if (invertRate_) {\\n return invertDividend_ / uint256(exchangeRate_);\\n } else {\\n return uint256(exchangeRate_) * priceMultiplier_;\\n }\\n } catch {\\n return 0;\\n }\\n }\\n\\n /// @notice returns all Chainlink oracle related data as utility for easy off-chain use / block explorer in a single view method\\n function chainlinkOracleData2()\\n public\\n view\\n returns (\\n uint256 chainlinkExchangeRate_,\\n IChainlinkAggregatorV3 chainlinkFeed1_,\\n bool chainlinkInvertRate1_,\\n uint256 chainlinkExchangeRate1_,\\n IChainlinkAggregatorV3 chainlinkFeed2_,\\n bool chainlinkInvertRate2_,\\n uint256 chainlinkExchangeRate2_,\\n IChainlinkAggregatorV3 chainlinkFeed3_,\\n bool chainlinkInvertRate3_,\\n uint256 chainlinkExchangeRate3_\\n )\\n {\\n return (\\n _getChainlinkExchangeRate2(),\\n _CHAINLINK2_FEED1,\\n _CHAINLINK2_INVERT_RATE1,\\n _readFeedRate2(\\n _CHAINLINK2_FEED1,\\n _CHAINLINK2_INVERT_RATE1,\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER1,\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND1\\n ),\\n _CHAINLINK2_FEED2,\\n _CHAINLINK2_INVERT_RATE2,\\n address(_CHAINLINK2_FEED2) == address(0)\\n ? 0\\n : _readFeedRate2(\\n _CHAINLINK2_FEED2,\\n _CHAINLINK2_INVERT_RATE2,\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER2,\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND2\\n ),\\n _CHAINLINK2_FEED3,\\n _CHAINLINK2_INVERT_RATE3,\\n address(_CHAINLINK2_FEED3) == address(0)\\n ? 0\\n : _readFeedRate2(\\n _CHAINLINK2_FEED3,\\n _CHAINLINK2_INVERT_RATE3,\\n _CHAINLINK2_PRICE_SCALER_MULTIPLIER3,\\n _CHAINLINK2_INVERT_PRICE_DIVIDEND3\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0xd2ce1fdf8c3e95bc50db12ff238cee7c8734fd3b0392ca5cdec2ea10273cfcf8\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/fallbackOracleImpl.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { IRedstoneOracle } from \\\"../interfaces/external/IRedstoneOracle.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\nimport { ChainlinkOracleImpl } from \\\"./chainlinkOracleImpl.sol\\\";\\nimport { RedstoneOracleImpl } from \\\"./redstoneOracleImpl.sol\\\";\\n\\n/// @title Fallback Oracle implementation\\n/// @notice This contract is used to get the exchange rate from a main oracle feed and a fallback oracle feed.\\n//\\n// @dev inheriting contracts should implement a view method to expose `_FALLBACK_ORACLE_MAIN_SOURCE`\\nabstract contract FallbackOracleImpl is OracleError, RedstoneOracleImpl, ChainlinkOracleImpl {\\n /// @dev which oracle to use as main source:\\n /// - 1 = Chainlink ONLY (no fallback)\\n /// - 2 = Chainlink with Redstone Fallback\\n /// - 3 = Redstone with Chainlink Fallback\\n uint8 internal immutable _FALLBACK_ORACLE_MAIN_SOURCE;\\n\\n /// @notice sets the main source, Chainlink Oracle and Redstone Oracle data.\\n /// @param mainSource_ which oracle to use as main source:\\n /// - 1 = Chainlink ONLY (no fallback)\\n /// - 2 = Chainlink with Redstone Fallback\\n /// - 3 = Redstone with Chainlink Fallback\\n /// @param chainlinkParams_ chainlink Oracle constructor params struct.\\n /// @param redstoneOracle_ Redstone Oracle data. (address can be set to zero address if using Chainlink only)\\n constructor(\\n uint8 mainSource_,\\n ChainlinkConstructorParams memory chainlinkParams_,\\n RedstoneOracleData memory redstoneOracle_\\n )\\n ChainlinkOracleImpl(chainlinkParams_)\\n RedstoneOracleImpl(\\n address(redstoneOracle_.oracle) == address(0)\\n ? RedstoneOracleData(IRedstoneOracle(_REDSTONE_ORACLE_NOT_SET_ADDRESS), false, 1)\\n : redstoneOracle_\\n )\\n {\\n if (mainSource_ < 1 || mainSource_ > 3) {\\n revert FluidOracleError(ErrorTypes.FallbackOracle__InvalidParams);\\n }\\n _FALLBACK_ORACLE_MAIN_SOURCE = mainSource_;\\n }\\n\\n /// @dev returns the exchange rate for the main oracle source, or the fallback source (if configured) if the main exchange rate\\n /// fails to be fetched. If returned rate is 0, fetching rate failed or something went wrong.\\n /// @return exchangeRate_ exchange rate\\n /// @return fallback_ whether fallback was necessary or not\\n function _getRateWithFallback() internal view returns (uint256 exchangeRate_, bool fallback_) {\\n if (_FALLBACK_ORACLE_MAIN_SOURCE == 1) {\\n // 1 = Chainlink ONLY (no fallback)\\n exchangeRate_ = _getChainlinkExchangeRate();\\n } else if (_FALLBACK_ORACLE_MAIN_SOURCE == 2) {\\n // 2 = Chainlink with Redstone Fallback\\n exchangeRate_ = _getChainlinkExchangeRate();\\n if (exchangeRate_ == 0) {\\n fallback_ = true;\\n exchangeRate_ = _getRedstoneExchangeRate();\\n }\\n } else {\\n // 3 = Redstone with Chainlink Fallback\\n exchangeRate_ = _getRedstoneExchangeRate();\\n if (exchangeRate_ == 0) {\\n fallback_ = true;\\n exchangeRate_ = _getChainlinkExchangeRate();\\n }\\n }\\n }\\n\\n /// @dev returns the exchange rate for Chainlink, or Redstone if configured & Chainlink fails.\\n function _getChainlinkOrRedstoneAsFallback() internal view returns (uint256 exchangeRate_) {\\n exchangeRate_ = _getChainlinkExchangeRate();\\n\\n if (exchangeRate_ == 0 && _FALLBACK_ORACLE_MAIN_SOURCE != 1) {\\n // Chainlink failed but Redstone is configured too -> try Redstone\\n exchangeRate_ = _getRedstoneExchangeRate();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xff1e1ab767ff250777dcb7fb70dc5a0392bb666bf4f65d27d338aaceb76554bc\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/fallbackOracleImpl2.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { IRedstoneOracle } from \\\"../interfaces/external/IRedstoneOracle.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\nimport { ChainlinkOracleImpl2 } from \\\"./chainlinkOracleImpl2.sol\\\";\\nimport { RedstoneOracleImpl2 } from \\\"./redstoneOracleImpl2.sol\\\";\\n\\n// @dev Exact same contract as FallbackOracleImpl, just with all vars, immutables etc. renamed with a \\\"2\\\" and inheriting\\n// to ChainlinkOracleImpl2 and RedstoneOracleImpl2 to avoid conflicts when FallbackOracleImpl would have to be inherited twice.\\n\\n/// @title Fallback Oracle implementation\\n/// @notice This contract is used to get the exchange rate from a main oracle feed and a fallback oracle feed.\\n//\\n// @dev inheriting contracts should implement a view method to expose `_FALLBACK_ORACLE2_MAIN_SOURCE`\\nabstract contract FallbackOracleImpl2 is OracleError, RedstoneOracleImpl2, ChainlinkOracleImpl2 {\\n /// @dev which oracle to use as main source:\\n /// - 1 = Chainlink ONLY (no fallback)\\n /// - 2 = Chainlink with Redstone Fallback\\n /// - 3 = Redstone with Chainlink Fallback\\n uint8 internal immutable _FALLBACK_ORACLE2_MAIN_SOURCE;\\n\\n /// @notice sets the main source, Chainlink Oracle and Redstone Oracle data.\\n /// @param mainSource_ which oracle to use as main source:\\n /// - 1 = Chainlink ONLY (no fallback)\\n /// - 2 = Chainlink with Redstone Fallback\\n /// - 3 = Redstone with Chainlink Fallback\\n /// @param chainlinkParams_ chainlink Oracle constructor params struct.\\n /// @param redstoneOracle_ Redstone Oracle data. (address can be set to zero address if using Chainlink only)\\n constructor(\\n uint8 mainSource_,\\n ChainlinkConstructorParams memory chainlinkParams_,\\n RedstoneOracleData memory redstoneOracle_\\n )\\n ChainlinkOracleImpl2(chainlinkParams_)\\n RedstoneOracleImpl2(\\n address(redstoneOracle_.oracle) == address(0)\\n ? RedstoneOracleData(IRedstoneOracle(_REDSTONE2_ORACLE_NOT_SET_ADDRESS), false, 1)\\n : redstoneOracle_\\n )\\n {\\n if (mainSource_ < 1 || mainSource_ > 3) {\\n revert FluidOracleError(ErrorTypes.FallbackOracle__InvalidParams);\\n }\\n _FALLBACK_ORACLE2_MAIN_SOURCE = mainSource_;\\n }\\n\\n /// @dev returns the exchange rate for the main oracle source, or the fallback source (if configured) if the main exchange rate\\n /// fails to be fetched. If returned rate is 0, fetching rate failed or something went wrong.\\n /// @return exchangeRate_ exchange rate\\n /// @return fallback_ whether fallback was necessary or not\\n function _getRateWithFallback2() internal view returns (uint256 exchangeRate_, bool fallback_) {\\n if (_FALLBACK_ORACLE2_MAIN_SOURCE == 1) {\\n // 1 = Chainlink ONLY (no fallback)\\n exchangeRate_ = _getChainlinkExchangeRate2();\\n } else if (_FALLBACK_ORACLE2_MAIN_SOURCE == 2) {\\n // 2 = Chainlink with Redstone Fallback\\n exchangeRate_ = _getChainlinkExchangeRate2();\\n if (exchangeRate_ == 0) {\\n fallback_ = true;\\n exchangeRate_ = _getRedstoneExchangeRate2();\\n }\\n } else {\\n // 3 = Redstone with Chainlink Fallback\\n exchangeRate_ = _getRedstoneExchangeRate2();\\n if (exchangeRate_ == 0) {\\n fallback_ = true;\\n exchangeRate_ = _getChainlinkExchangeRate2();\\n }\\n }\\n }\\n\\n /// @dev returns the exchange rate for Chainlink, or Redstone if configured & Chainlink fails.\\n function _getChainlinkOrRedstoneAsFallback2() internal view returns (uint256 exchangeRate_) {\\n exchangeRate_ = _getChainlinkExchangeRate2();\\n\\n if (exchangeRate_ == 0 && _FALLBACK_ORACLE2_MAIN_SOURCE != 1) {\\n // Chainlink failed but Redstone is configured too -> try Redstone\\n exchangeRate_ = _getRedstoneExchangeRate2();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x825590898a56546ea087b730e094f68df62ad4c466a382a77d2ea07b7ed2526e\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/redstoneOracleImpl.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { IRedstoneOracle } from \\\"../interfaces/external/IRedstoneOracle.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\nimport { RedstoneStructs } from \\\"./structs.sol\\\";\\n\\n/// @title Redstone Oracle implementation\\n/// @notice This contract is used to get the exchange rate from a Redstone Oracle\\nabstract contract RedstoneOracleImpl is OracleError, RedstoneStructs {\\n /// @notice Redstone price oracle to check for the exchange rate\\n IRedstoneOracle internal immutable _REDSTONE_ORACLE;\\n /// @notice Flag to invert the price or not (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)\\n bool internal immutable _REDSTONE_INVERT_RATE;\\n\\n /// @notice constant value for price scaling to reduce gas usage\\n uint256 internal immutable _REDSTONE_PRICE_SCALER_MULTIPLIER;\\n /// @notice constant value for inverting price to reduce gas usage\\n uint256 internal immutable _REDSTONE_INVERT_PRICE_DIVIDEND;\\n\\n address internal immutable _REDSTONE_ORACLE_NOT_SET_ADDRESS = 0x000000000000000000000000000000000000dEaD;\\n\\n /// @notice constructor sets the Redstone oracle data\\n constructor(RedstoneOracleData memory oracleData_) {\\n if (address(oracleData_.oracle) == address(0) || oracleData_.token0Decimals == 0) {\\n revert FluidOracleError(ErrorTypes.RedstoneOracle__InvalidParams);\\n }\\n\\n _REDSTONE_ORACLE = oracleData_.oracle;\\n _REDSTONE_INVERT_RATE = oracleData_.invertRate;\\n\\n // for explanation on how to get to scaler multiplier and dividend see `chainlinkOracleImpl.sol`.\\n // no support for token1Decimals with more than OracleUtils.RATE_OUTPUT_DECIMALS decimals for now as extremely unlikely case\\n _REDSTONE_PRICE_SCALER_MULTIPLIER = address(oracleData_.oracle) == _REDSTONE_ORACLE_NOT_SET_ADDRESS\\n ? 1\\n : 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - oracleData_.token0Decimals);\\n _REDSTONE_INVERT_PRICE_DIVIDEND = address(oracleData_.oracle) == _REDSTONE_ORACLE_NOT_SET_ADDRESS\\n ? 1\\n : 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS + oracleData_.token0Decimals);\\n }\\n\\n /// @dev Get the exchange rate from Redstone oracle\\n /// @param rate_ The exchange rate in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n function _getRedstoneExchangeRate() internal view returns (uint256 rate_) {\\n try _REDSTONE_ORACLE.getExchangeRate() returns (uint256 exchangeRate_) {\\n if (_REDSTONE_INVERT_RATE) {\\n // invert the price\\n return _REDSTONE_INVERT_PRICE_DIVIDEND / exchangeRate_;\\n } else {\\n return exchangeRate_ * _REDSTONE_PRICE_SCALER_MULTIPLIER;\\n }\\n } catch {\\n return 0;\\n }\\n }\\n\\n /// @notice returns all Redstone oracle related data as utility for easy off-chain use / block explorer in a single view method\\n function redstoneOracleData()\\n public\\n view\\n returns (uint256 redstoneExchangeRate_, IRedstoneOracle redstoneOracle_, bool redstoneInvertRate_)\\n {\\n return (\\n address(_REDSTONE_ORACLE) == _REDSTONE_ORACLE_NOT_SET_ADDRESS ? 0 : _getRedstoneExchangeRate(),\\n _REDSTONE_ORACLE,\\n _REDSTONE_INVERT_RATE\\n );\\n }\\n}\\n\",\"keccak256\":\"0x49082d966015853f5fa8074a5ab209df61e8ec8353f3f08ced5dc77f8b578b4b\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/redstoneOracleImpl2.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { IRedstoneOracle } from \\\"../interfaces/external/IRedstoneOracle.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\nimport { RedstoneStructs } from \\\"./structs.sol\\\";\\n\\n// @dev Exact same contract as RedstoneOracleImpl, just with all vars, immutables etc. renamed with a \\\"2\\\" to avoid\\n// conflicts when RedstoneOracleImpl would have to be inherited twice.\\n\\n/// @title Redstone Oracle implementation\\n/// @notice This contract is used to get the exchange rate from a Redstone Oracle\\nabstract contract RedstoneOracleImpl2 is OracleError, RedstoneStructs {\\n /// @notice Redstone price oracle to check for the exchange rate\\n IRedstoneOracle internal immutable _REDSTONE2_ORACLE;\\n /// @notice Flag to invert the price or not (to e.g. for WETH/USDC pool return prive of USDC per 1 WETH)\\n bool internal immutable _REDSTONE2_INVERT_RATE;\\n\\n /// @notice constant value for price scaling to reduce gas usage\\n uint256 internal immutable _REDSTONE2_PRICE_SCALER_MULTIPLIER;\\n /// @notice constant value for inverting price to reduce gas usage\\n uint256 internal immutable _REDSTONE2_INVERT_PRICE_DIVIDEND;\\n\\n address internal immutable _REDSTONE2_ORACLE_NOT_SET_ADDRESS = 0x000000000000000000000000000000000000dEaD;\\n\\n /// @notice constructor sets the Redstone oracle data\\n constructor(RedstoneOracleData memory oracleData_) {\\n if (address(oracleData_.oracle) == address(0) || oracleData_.token0Decimals == 0) {\\n revert FluidOracleError(ErrorTypes.RedstoneOracle__InvalidParams);\\n }\\n\\n _REDSTONE2_ORACLE = oracleData_.oracle;\\n _REDSTONE2_INVERT_RATE = oracleData_.invertRate;\\n\\n // for explanation on how to get to scaler multiplier and dividend see `chainlinkOracleImpl.sol`.\\n // no support for token1Decimals with more than OracleUtils.RATE_OUTPUT_DECIMALS decimals for now as extremely unlikely case\\n _REDSTONE2_PRICE_SCALER_MULTIPLIER = address(oracleData_.oracle) == _REDSTONE2_ORACLE_NOT_SET_ADDRESS\\n ? 1\\n : 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - oracleData_.token0Decimals);\\n _REDSTONE2_INVERT_PRICE_DIVIDEND = address(oracleData_.oracle) == _REDSTONE2_ORACLE_NOT_SET_ADDRESS\\n ? 1\\n : 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS + oracleData_.token0Decimals);\\n }\\n\\n /// @dev Get the exchange rate from Redstone oracle\\n /// @param rate_ The exchange rate in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n function _getRedstoneExchangeRate2() internal view returns (uint256 rate_) {\\n try _REDSTONE2_ORACLE.getExchangeRate() returns (uint256 exchangeRate_) {\\n if (_REDSTONE2_INVERT_RATE) {\\n // invert the price\\n return _REDSTONE2_INVERT_PRICE_DIVIDEND / exchangeRate_;\\n } else {\\n return exchangeRate_ * _REDSTONE2_PRICE_SCALER_MULTIPLIER;\\n }\\n } catch {\\n return 0;\\n }\\n }\\n\\n /// @notice returns all Redstone oracle related data as utility for easy off-chain use / block explorer in a single view method\\n function redstoneOracleData2()\\n public\\n view\\n returns (uint256 redstoneExchangeRate_, IRedstoneOracle redstoneOracle_, bool redstoneInvertRate_)\\n {\\n return (\\n address(_REDSTONE2_ORACLE) == _REDSTONE2_ORACLE_NOT_SET_ADDRESS ? 0 : _getRedstoneExchangeRate2(),\\n _REDSTONE2_ORACLE,\\n _REDSTONE2_INVERT_RATE\\n );\\n }\\n}\\n\",\"keccak256\":\"0x72e2b90a56eff49e2e81208002f80ee8ad678ed1572358d5807713eeb30c5c11\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/structs.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IChainlinkAggregatorV3 } from \\\"../interfaces/external/IChainlinkAggregatorV3.sol\\\";\\nimport { IRedstoneOracle } from \\\"../interfaces/external/IRedstoneOracle.sol\\\";\\n\\nabstract contract ChainlinkStructs {\\n struct ChainlinkFeedData {\\n /// @param feed address of Chainlink feed.\\n IChainlinkAggregatorV3 feed;\\n /// @param invertRate true if rate read from price feed must be inverted.\\n bool invertRate;\\n /// @param token0Decimals decimals of asset 0. E.g. for a USDC/ETH feed, USDC is token0 and has 6 decimals.\\n /// (token1Decimals are available directly via Chainlink `FEED.decimals()`)\\n uint256 token0Decimals;\\n }\\n\\n struct ChainlinkConstructorParams {\\n /// @param param hops count of hops, used for sanity checks. Must be 1, 2 or 3.\\n uint8 hops;\\n /// @param feed1 Chainlink feed 1 data. Required.\\n ChainlinkFeedData feed1;\\n /// @param feed2 Chainlink feed 2 data. Required if hops > 1.\\n ChainlinkFeedData feed2;\\n /// @param feed3 Chainlink feed 3 data. Required if hops > 2.\\n ChainlinkFeedData feed3;\\n }\\n}\\n\\nabstract contract RedstoneStructs {\\n struct RedstoneOracleData {\\n /// @param oracle address of Redstone oracle.\\n IRedstoneOracle oracle;\\n /// @param invertRate true if rate read from price feed must be inverted.\\n bool invertRate;\\n /// @param token0Decimals decimals of asset 0. E.g. for a USDC/ETH feed, USDC is token0 and has 6 decimals.\\n /// (token1Decimals are available directly via Redstone `Oracle.decimals()`)\\n uint256 token0Decimals;\\n }\\n}\\n\",\"keccak256\":\"0x90d026dc5f1762c704f30eaaf485c0e8eb6314832a311db3ec73759e81dbde33\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/interfaces/external/IChainlinkAggregatorV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\n/// from https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol\\n/// Copyright (c) 2018 SmartContract ChainLink, Ltd.\\n\\ninterface IChainlinkAggregatorV3 {\\n /// @notice represents the number of decimals the aggregator responses represent.\\n function decimals() external view returns (uint8);\\n\\n function description() external view returns (string memory);\\n\\n function version() external view returns (uint256);\\n\\n function getRoundData(\\n uint80 _roundId\\n )\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function latestRoundData()\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n}\\n\",\"keccak256\":\"0xaeea1f12d1c381bde8418eab05206d6472b246158584190fce0d09913912a7ef\",\"license\":\"MIT\"},\"contracts/oracle/interfaces/external/IRedstoneOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\ninterface IRedstoneOracle {\\n /// @notice Get the `exchangeRate_` between the underlying asset and the peg asset\\n // @dev custom Redstone adapter for Instadapp implementation\\n function getExchangeRate() external view returns (uint256 exchangeRate_);\\n\\n /**\\n * @notice Returns the number of decimals for the price feed\\n * @dev By default, RedStone uses 8 decimals for data feeds\\n * @return decimals The number of decimals in the price feed values\\n */\\n // see https://github.com/redstone-finance/redstone-oracles-monorepo/blob/main/packages/on-chain-relayer/contracts/price-feeds/PriceFeedBase.sol#L51C12-L51C20\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xd9a844e86035a935fe06c5937d2fb8796fd150771716246b77c6226e32c9d129\",\"license\":\"MIT\"},\"contracts/oracle/interfaces/iFluidOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\ninterface IFluidOracle {\\n /// @dev Deprecated. Use `getExchangeRateOperate()` and `getExchangeRateLiquidate()` instead. Only implemented for\\n /// backwards compatibility.\\n function getExchangeRate() external view returns (uint256 exchangeRate_);\\n\\n /// @notice Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for operates\\n function getExchangeRateOperate() external view returns (uint256 exchangeRate_);\\n\\n /// @notice Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for liquidations\\n function getExchangeRateLiquidate() external view returns (uint256 exchangeRate_);\\n\\n /// @notice helper string to easily identify the oracle. E.g. token symbols\\n function infoName() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeba2e991e41f8b68e2d639935931aadf39e15ea94ea7aa65b2fb3039d27dca63\",\"license\":\"MIT\"},\"contracts/oracle/libraries/oracleUtils.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\n/// @title Oracle utils library\\n/// @notice implements common utility methods for Fluid Oracles\\nlibrary OracleUtils {\\n /// @dev The scaler for max delta point math (100%)\\n uint256 internal constant HUNDRED_PERCENT_DELTA_SCALER = 10_000;\\n /// @dev output precision of rates\\n uint256 internal constant RATE_OUTPUT_DECIMALS = 27;\\n\\n /// @dev checks if `mainSourceRate_` is within a `maxDeltaPercent_` of `checkSourceRate_`. Returns true if so.\\n function isRateOutsideDelta(\\n uint256 mainSourceRate_,\\n uint256 checkSourceRate_,\\n uint256 maxDeltaPercent_\\n ) internal pure returns (bool) {\\n uint256 offset_ = (checkSourceRate_ * maxDeltaPercent_) / HUNDRED_PERCENT_DELTA_SCALER;\\n return (mainSourceRate_ > (checkSourceRate_ + offset_) || mainSourceRate_ < (checkSourceRate_ - offset_));\\n }\\n}\\n\",\"keccak256\":\"0x968b1a0606875abd523895c5075cf6c34c296919e77b0da7dd952374398e2a4c\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/oracles/fallbackCLRSOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { FluidOracle } from \\\"../fluidOracle.sol\\\";\\nimport { FallbackOracleImpl } from \\\"../implementations/fallbackOracleImpl.sol\\\";\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\n\\n/// @title Chainlink / Redstone Oracle (with fallback)\\n/// @notice Gets the exchange rate between the underlying asset and the peg asset by using:\\n/// the price from a Chainlink price feed or a Redstone Oracle with one of them being used as main source and\\n/// the other one acting as a fallback if the main source fails for any reason. Reverts if fetched rate is 0.\\ncontract FallbackCLRSOracle is FluidOracle, FallbackOracleImpl {\\n /// @notice sets the main source, Chainlink Oracle and Redstone Oracle data.\\n /// @param infoName_ Oracle identify helper name.\\n /// @param mainSource_ which oracle to use as main source: 1 = Chainlink, 2 = Redstone (other one is fallback).\\n /// @param chainlinkParams_ chainlink Oracle constructor params struct.\\n /// @param redstoneOracle_ Redstone Oracle data. (address can be set to zero address if using Chainlink only)\\n constructor(\\n string memory infoName_,\\n uint8 mainSource_,\\n ChainlinkConstructorParams memory chainlinkParams_,\\n RedstoneOracleData memory redstoneOracle_\\n ) FallbackOracleImpl(mainSource_, chainlinkParams_, redstoneOracle_) FluidOracle(infoName_) {}\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRateOperate() public view virtual override returns (uint256 exchangeRate_) {\\n (exchangeRate_, ) = _getRateWithFallback();\\n\\n if (exchangeRate_ == 0) {\\n revert FluidOracleError(ErrorTypes.FallbackCLRSOracle__ExchangeRateZero);\\n }\\n }\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRateLiquidate() public view virtual override returns (uint256 exchangeRate_) {\\n (exchangeRate_, ) = _getRateWithFallback();\\n\\n if (exchangeRate_ == 0) {\\n revert FluidOracleError(ErrorTypes.FallbackCLRSOracle__ExchangeRateZero);\\n }\\n }\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRate() public view virtual override returns (uint256 exchangeRate_) {\\n return getExchangeRateOperate();\\n }\\n\\n /// @notice which oracle to use as main source:\\n /// - 1 = Chainlink ONLY (no fallback)\\n /// - 2 = Chainlink with Redstone Fallback\\n /// - 3 = Redstone with Chainlink Fallback\\n function FALLBACK_ORACLE_MAIN_SOURCE() public view returns (uint8) {\\n return _FALLBACK_ORACLE_MAIN_SOURCE;\\n }\\n}\\n\",\"keccak256\":\"0x2387ea4548e05dd50d632597cadf041629465cba8816870ac90322d492574506\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/oraclesL2/fallbackCLRSOracleL2.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { FluidOracleL2 } from \\\"../fluidOracleL2.sol\\\";\\nimport { FallbackCLRSOracle } from \\\"../oracles/fallbackCLRSOracle.sol\\\";\\n\\n/// @title Chainlink / Redstone Oracle (with fallback) for Layer 2 (with sequencer outage detection)\\n/// @notice Gets the exchange rate between the underlying asset and the peg asset by using:\\n/// the price from a Chainlink price feed or a Redstone Oracle with one of them being used as main source and\\n/// the other one acting as a fallback if the main source fails for any reason. Reverts if fetched rate is 0.\\ncontract FallbackCLRSOracleL2 is FluidOracleL2, FallbackCLRSOracle {\\n struct CLRSConstructorParams {\\n /// @param mainSource which oracle to use as main source for wstETH <> CLRS: 1 = Chainlink, 2 = Redstone (other one is fallback).\\n uint8 mainSource;\\n /// @param chainlinkParams chainlink Oracle constructor params struct for wstETH <> CLRS.\\n ChainlinkConstructorParams chainlinkParams;\\n /// @param redstoneOracle Redstone Oracle data for wstETH <> CLRS. (address can be set to zero address if using Chainlink only)\\n RedstoneOracleData redstoneOracle;\\n }\\n\\n /// @notice sets the main source, Chainlink Oracle and Redstone Oracle data.\\n /// @param infoName_ Oracle identify helper name.\\n /// @param cLRSParams_ CLRS Fallback Oracle data\\n /// @param sequencerUptimeFeed_ L2 sequencer uptime Chainlink feed\\n constructor(\\n string memory infoName_,\\n CLRSConstructorParams memory cLRSParams_,\\n address sequencerUptimeFeed_\\n )\\n FallbackCLRSOracle(infoName_, cLRSParams_.mainSource, cLRSParams_.chainlinkParams, cLRSParams_.redstoneOracle)\\n FluidOracleL2(sequencerUptimeFeed_)\\n {}\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRateOperate()\\n public\\n view\\n virtual\\n override(FallbackCLRSOracle, FluidOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n _ensureSequencerUpAndValid();\\n return super.getExchangeRateOperate();\\n }\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRateLiquidate()\\n public\\n view\\n virtual\\n override(FallbackCLRSOracle, FluidOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n _ensureSequencerUpAndValid();\\n return super.getExchangeRateLiquidate();\\n }\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRate()\\n public\\n view\\n virtual\\n override(FallbackCLRSOracle, FluidOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n return getExchangeRateOperate();\\n }\\n}\\n\",\"keccak256\":\"0x68afc66ee3eb7dc3c93304c6a55d5eab7fe65e8f8a81fb39caed06b8d5665559\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/oraclesL2/ratio2xFallbackCLRSOracleL2.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { FluidOracleL2 } from \\\"../fluidOracleL2.sol\\\";\\nimport { FallbackCLRSOracleL2 } from \\\"./fallbackCLRSOracleL2.sol\\\";\\nimport { FallbackOracleImpl2 } from \\\"../implementations/fallbackOracleImpl2.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\n\\n/// @title Ratio of 2 Chainlink / Redstone Oracles (with fallback) for Layer 2 (with sequencer outage detection)\\n/// @notice Gets the exchange rate between the underlying asset and the peg asset by using:\\n/// 1. the price from a Chainlink price feed or a Redstone Oracle with one of them being used as main source and\\n/// the other one acting as a fallback if the main source fails for any reason. Reverts if fetched rate is 0.\\n/// 2. set into ratio with another price fetched the same way.\\n/// I.e. it is possible to do Chainlink Oracle / Chainlink Oracle. E.g. wstETH per 1 weETH on a L2 via CL feeds.\\ncontract Ratio2xFallbackCLRSOracleL2 is FluidOracleL2, FallbackOracleImpl2, FallbackCLRSOracleL2 {\\n /// @notice sets the two CLRS oracle configs\\n /// @param infoName_ Oracle identify helper name.\\n /// @param cLRSParams1_ CLRS Fallback Oracle data for ratio dividend\\n /// @param cLRSParams2_ CLRS Fallback Oracle data for ratio divisor\\n /// @param sequencerUptimeFeed_ L2 sequencer uptime Chainlink feed\\n constructor(\\n string memory infoName_,\\n FallbackCLRSOracleL2.CLRSConstructorParams memory cLRSParams1_,\\n FallbackCLRSOracleL2.CLRSConstructorParams memory cLRSParams2_,\\n address sequencerUptimeFeed_\\n )\\n FallbackCLRSOracleL2(infoName_, cLRSParams1_, sequencerUptimeFeed_)\\n FallbackOracleImpl2(cLRSParams2_.mainSource, cLRSParams2_.chainlinkParams, cLRSParams2_.redstoneOracle)\\n {}\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRateOperate()\\n public\\n view\\n override(FluidOracleL2, FallbackCLRSOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n // 1. get CLRS Oracle rate from FallbackOracleImpl2 for divisor (cLRSParams2_)\\n (exchangeRate_, ) = _getRateWithFallback2();\\n if (exchangeRate_ == 0) {\\n // revert if fetched exchange rate is 0\\n revert FluidOracleError(ErrorTypes.Ratio2xFallbackCLRSOracleL2__ExchangeRateZero);\\n }\\n\\n // 2. get rate from FallbackCLRSOracleL2 (cLRSParams1_). This already checks and reverts in case of price being 0.\\n // (super.getExchangeRate returns FallbackCLRSOracleL2 rate, no other inherited contract has this.)\\n // includes _ensureSequencerUpAndValid();\\n\\n // 3. Setting into ratio cLRSParams1_ rate / cLRSParams2_ rate\\n exchangeRate_ = (super.getExchangeRateOperate() * (10 ** OracleUtils.RATE_OUTPUT_DECIMALS)) / exchangeRate_;\\n // e.g. FallbackCLRSOracleL2 configured to return weETH rate, _getRateWithFallback2 configured to return wstETH:\\n // result is wstETH per weETH\\n }\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRateLiquidate()\\n public\\n view\\n override(FluidOracleL2, FallbackCLRSOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n // 1. get CLRS Oracle rate from FallbackOracleImpl2 for divisor\\n (exchangeRate_, ) = _getRateWithFallback2();\\n if (exchangeRate_ == 0) {\\n // revert if fetched exchange rate is 0\\n revert FluidOracleError(ErrorTypes.Ratio2xFallbackCLRSOracleL2__ExchangeRateZero);\\n }\\n\\n // 2. get rate from FallbackCLRSOracleL2. This already checks and reverts in case of price being 0.\\n // (super.getExchangeRate returns FallbackCLRSOracleL2 rate, no other inherited contract has this.)\\n // includes _ensureSequencerUpAndValid();\\n exchangeRate_ = (super.getExchangeRateLiquidate() * (10 ** OracleUtils.RATE_OUTPUT_DECIMALS)) / exchangeRate_;\\n }\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRate()\\n public\\n view\\n override(FluidOracleL2, FallbackCLRSOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n return getExchangeRateOperate();\\n }\\n\\n /// @notice which oracle to use as main source:\\n /// - 1 = Chainlink ONLY (no fallback)\\n /// - 2 = Chainlink with Redstone Fallback\\n /// - 3 = Redstone with Chainlink Fallback\\n function FALLBACK_ORACLE2_MAIN_SOURCE() public view returns (uint8) {\\n return _FALLBACK_ORACLE2_MAIN_SOURCE;\\n }\\n}\\n\",\"keccak256\":\"0x4cfdc55b0cb8d9130456527096c9f8bff1773617ba02f3a0e269726fcde0f7c3\",\"license\":\"BUSL-1.1\"}},\"version\":1}", "bytecode": "0x61052060405261dead6101208190526101c0523480156200001f57600080fd5b5060405162002dc738038062002dc7833981016040819052620000429162000a7d565b83838282826000015183602001518460400151828282818c600001518d602001518e604001518160006001600160a01b031686600001516001600160a01b0316146200008f5785620000bb565b60405180606001604052806101c0516001600160a01b0316815260200160001515815260200160018152505b82516001600160a01b031615620000d35782620000ff565b6040518060600160405280610120516001600160a01b0316815260200160001515815260200160018152505b8d8f806000806101000a8154816001600160a01b0302191690836001600160a01b03160217905550506020815111806200013857508051155b15620001605760405163c82fc46560e01b815261ea6a60048201526024015b60405180910390fd5b6020015160805280516001600160a01b031615806200018157506040810151155b15620001a55760405163c82fc46560e01b815261fa01600482015260240162000157565b80516001600160a01b0390811660a0526020820151151560c0526101205182518216911614620001f4576040810151620001e190601b62000b86565b620001ee90600a62000c9f565b620001f7565b60015b60e0526101205181516001600160a01b03908116911614620002385760408101516200022590601b62000cb4565b6200023290600a62000c9f565b6200023b565b60015b610100525080516001600160a01b031615806200025a57506040810151155b156200027e5760405163c82fc46560e01b815261fa01600482015260240162000157565b80516001600160a01b039081166101405260208201511515610160526101c05182518216911614620002cf576040810151620002bc90601b62000b86565b620002c990600a62000c9f565b620002d2565b60015b610180526101c05181516001600160a01b03908116911614620003145760408101516200030190601b62000cb4565b6200030e90600a62000c9f565b62000317565b60015b6101a052508051600160ff90911610806200033957506003816000015160ff16115b806200036257506020810151516001600160a01b03161580620003625750602081015160400151155b806200039d57506001816000015160ff161180156200039d57506040810151516001600160a01b031615806200039d57506040808201510151155b80620003d957506002816000015160ff16118015620003d957506060810151516001600160a01b03161580620003d95750606081015160400151155b15620003fd5760405163c82fc46560e01b815261ee49600482015260240162000157565b60208082018051516001600160a01b039081166101e052604080850180515183166102005260608601805151909316610220528351850151151561024052518401511515610260529051909201511515610280525101516200046190601b62000b86565b6200046e90600a62000c9f565b6102a0526020810151604001516200048890601b62000cb4565b6200049590600a62000c9f565b6102c0528051600160ff90911611620004b0576001620004d2565b6040808201510151620004c590601b62000b86565b620004d290600a62000c9f565b6102e0528051600160ff90911611620004ed5760016200050f565b60408082015101516200050290601b62000cb4565b6200050f90600a62000c9f565b610300528051600260ff909116116200052a5760016200054d565b6060810151604001516200054090601b62000b86565b6200054d90600a62000c9f565b610320528051600260ff90911611620005685760016200058b565b6060810151604001516200057e90601b62000cb4565b6200058b90600a62000c9f565b6103405250600160ff84161080620005a6575060038360ff16115b15620005ca5760405163c82fc46560e01b815261fde9600482015260240162000157565b505060ff908116610360528151600191161080620005ef57506003816000015160ff16115b806200061857506020810151516001600160a01b03161580620006185750602081015160400151155b806200065357506001816000015160ff161180156200065357506040810151516001600160a01b031615806200065357506040808201510151155b806200068f57506002816000015160ff161180156200068f57506060810151516001600160a01b031615806200068f5750606081015160400151155b15620006b35760405163c82fc46560e01b815261ee49600482015260240162000157565b60208082018051516001600160a01b0390811661038052604080850180515183166103a052606086018051519093166103c052835185015115156103e052518401511515610400529051909201511515610420525101516200071790601b62000b86565b6200072490600a62000c9f565b610440526020810151604001516200073e90601b62000cb4565b6200074b90600a62000c9f565b610460528051600160ff909116116200076657600162000788565b60408082015101516200077b90601b62000b86565b6200078890600a62000c9f565b610480528051600160ff90911611620007a3576001620007c5565b6040808201510151620007b890601b62000cb4565b620007c590600a62000c9f565b6104a0528051600260ff90911611620007e057600162000803565b606081015160400151620007f690601b62000b86565b6200080390600a62000c9f565b6104c0528051600260ff909116116200081e57600162000841565b6060810151604001516200083490601b62000cb4565b6200084190600a62000c9f565b6104e05250600160ff841610806200085c575060038360ff16115b15620008805760405163c82fc46560e01b815261fde9600482015260240162000157565b505060ff16610500525062000cca9950505050505050505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715620008d657620008d66200089b565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200090757620009076200089b565b604052919050565b805160ff811681146200092157600080fd5b919050565b6001600160a01b03811681146200093c57600080fd5b50565b6000606082840312156200095257600080fd5b6200095c620008b1565b905081516200096b8162000926565b8152602082015180151581146200098157600080fd5b806020830152506040820151604082015292915050565b60008183036101c0811215620009ad57600080fd5b620009b7620008b1565b9150620009c4836200090f565b8252610140601f1982011215620009da57600080fd5b50604051608081016001600160401b038111828210171562000a005762000a006200089b565b60405262000a11602084016200090f565b815262000a2284604085016200093f565b602082015262000a368460a085016200093f565b604082015262000a4b8461010085016200093f565b6060820152602082015262000a658361016084016200093f565b604082015292915050565b8051620009218162000926565b6000806000806103c0858703121562000a9557600080fd5b84516001600160401b038082111562000aad57600080fd5b818701915087601f83011262000ac257600080fd5b81518181111562000ad75762000ad76200089b565b6020915062000aef601f8201601f19168301620008dc565b818152898383860101111562000b0457600080fd5b60005b8281101562000b2457848101840151828201850152830162000b07565b506000838383010152809750505062000b408882890162000998565b9450505062000b54866101e0870162000998565b915062000b656103a0860162000a70565b905092959194509250565b634e487b7160e01b600052601160045260246000fd5b8181038181111562000b9c5762000b9c62000b70565b92915050565b600181815b8085111562000be357816000190482111562000bc75762000bc762000b70565b8085161562000bd557918102915b93841c939080029062000ba7565b509250929050565b60008262000bfc5750600162000b9c565b8162000c0b5750600062000b9c565b816001811462000c24576002811462000c2f5762000c4f565b600191505062000b9c565b60ff84111562000c435762000c4362000b70565b50506001821b62000b9c565b5060208310610133831016604e8410600b841016171562000c74575081810a62000b9c565b62000c80838362000ba2565b806000190482111562000c975762000c9762000b70565b029392505050565b600062000cad838362000beb565b9392505050565b8082018082111562000b9c5762000b9c62000b70565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e05161030051610320516103405161036051610380516103a0516103c0516103e05161040051610420516104405161046051610480516104a0516104c0516104e05161050051611df462000fd3600039600081816101430152818161198f01526119c20152600081816105f1015261106d0152600081816105d0015261104c0152600081816104ff0152610f760152600081816104de0152610f550152600081816104150152610e930152600081816103f40152610e7201526000818161054e015281816105af015261102b01526000818161045c015281816104bd0152610f3401526000818161038e015281816103d30152610e5101526000818161052d0152818161058e01528181610fba015261100a01526000818161043b0152818161049c01528181610ec30152610f1301526000818161036d015281816103b20152610e3001526000818160d00152818161128c01526112c5015260008181610cd1015261187a015260008181610cb00152611859015260008181610bdf0152611783015260008181610bbe0152611762015260008181610af501526116a0015260008181610ad4015261167f015260008181610c2e01528181610c8f0152611838015260008181610b3c01528181610b9d0152611741015260008181610a6e01528181610ab3015261165e015260008181610c0d01528181610c6e015281816117c70152611817015260008181610b1b01528181610b7c015281816116d00152611720015260008181610a4d01528181610a92015261163d0152600061064401526000611239015260006112620152600081816106eb015261120f01526000818161067b015281816106c801526111600152600061028801526000610dd201526000610e0101526000818161032f0152610da80152600081816102bf0152818161030c0152610cf90152600081816107a101526108660152611df46000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638e7bfbc011610081578063e6aa216c1161005b578063e6aa216c14610271578063f3190c89146101e2578063f5be67a51461027957600080fd5b80638e7bfbc0146101e2578063abd5f95d146101f8578063dc4595121461020d57600080fd5b80633437eac4116100b25780633437eac4146101415780637557ca411461016757806388c35209146101da57600080fd5b80632faeaacb146100ce57806331b037a214610107575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b60405160ff90911681526020015b60405180910390f35b61010f610281565b6040805193845273ffffffffffffffffffffffffffffffffffffffff90921660208401521515908201526060016100fe565b7f00000000000000000000000000000000000000000000000000000000000000006100f0565b61016f610354565b604080519a8b5273ffffffffffffffffffffffffffffffffffffffff998a1660208c0152971515978a01979097526060890195909552928616608088015290151560a087015260c086015290921660e0840152901515610100830152610120820152610140016100fe565b61010f61063d565b6101ea610710565b6040519081526020016100fe565b61020061078f565b6040516100fe9190611a25565b6102156108f4565b6040805173ffffffffffffffffffffffffffffffffffffffff909916895260208901979097529415159587019590955260608601929092526080850152151560a084015260c0830191909152151560e0820152610100016100fe565b6101ea610a2a565b61016f610a34565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff161461030657610301610cf5565b610309565b60005b937f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b60008060008060008060008060008061036b610e29565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006104397f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610528576105237f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b61052b565b60005b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff82161561061a576106157f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b61061d565b60005b995099509950995099509950995099509950995090919293949596979899565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146106c2576106bd61115c565b6106c5565b60005b937f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b600061071a611287565b5090506000819003610761576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261eb9760048201526024015b60405180910390fd5b8061076e601b600a611be2565b61077661132c565b6107809190611bf5565b61078a9190611c0c565b905090565b606060005b6020811080156107fa57507f000000000000000000000000000000000000000000000000000000000000000081602081106107d1576107d1611c47565b1a60f81b7fff000000000000000000000000000000000000000000000000000000000000001615155b15610811578061080981611c76565b915050610794565b60008167ffffffffffffffff81111561082c5761082c611cae565b6040519080825280601f01601f191660200182016040528015610856576020820181803683370190505b50905060005b828110156108ed577f0000000000000000000000000000000000000000000000000000000000000000816020811061089657610896611c47565b1a60f81b8282815181106108ac576108ac611c47565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350806108e581611c76565b91505061085c565b5092915050565b600080600080600080600080600061090a61133e565b9198509096509050861561092e5761092281876114eb565b919650945092506109e4565b610a8c945060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c59190611cfc565b5050505090506109e08160016109db9190611d4c565b611555565b9350505b60005473ffffffffffffffffffffffffffffffffffffffff16610a8c8888888888848015610a0f57508a5b98509850985098509850985098509850509091929394959697565b600061078a610710565b600080600080600080600080600080610a4b611636565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610b197f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610c0857610c037f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b610c0b565b60005b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff82161561061a576106157f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610d9c575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610d9991810190611d6f565b60015b610da65750600090565b7f000000000000000000000000000000000000000000000000000000000000000015610dfc57610df6817f0000000000000000000000000000000000000000000000000000000000000000611c0c565b91505090565b610df67f000000000000000000000000000000000000000000000000000000000000000082611bf5565b90565b6000610eb77f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b9050801580610efa57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b15610f025790565b610f0e601b600a611be2565b610f9a7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b610fa49083611bf5565b610fae9190611c0c565b9050801580610ff157507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b15610ff95790565b611005601b600a611be2565b6110917f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b6107809083611bf5565b60008473ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa925050508015611122575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261111f91810190611cfc565b60015b61112e57506000611154565b881561114a5761113e8488611c0c565b95505050505050611154565b61113e8885611bf5565b949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611203575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261120091810190611d6f565b60015b61120d5750600090565b7f00000000000000000000000000000000000000000000000000000000000000001561125d57610df6817f0000000000000000000000000000000000000000000000000000000000000000611c0c565b610df67f000000000000000000000000000000000000000000000000000000000000000082611bf5565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff166001036112c3576112bd611636565b91509091565b7f000000000000000000000000000000000000000000000000000000000000000060ff1660020361130f576112f6611636565b91508160000361130b575060016112bd610cf5565b9091565b611317610cf5565b91508160000361130b575060016112bd611636565b600061133661189e565b61078a61193d565b60008060008060008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156113b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d69190611cfc565b5050925092509250816000146113f6575060009586955085945092505050565b6001955082945080935060008411156114e3575b60005473ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5611433600186611d88565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815269ffffffffffffffffffff909116600482015260240160a060405180830381865afa158015611492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b69190611cfc565b5092955090935091505060008290036114d0578294508093505b811580156114de5750600081115b61140a575b505050909192565b60008080806114fa8542611dab565b905084158061150a5750610a8c81115b1561152257610a8c600160009350935093505061154e565b61152b86611555565b91506115378286611dab565b9350610a8c84111561154957610a8c93505b831091505b9250925092565b60008181805b60005473ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5611584600186611d88565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815269ffffffffffffffffffff909116600482015260240160a060405180830381865afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116079190611cfc565b50929550909350915050811561161b578093505b811580159061162a5750600081115b61155b57505050919050565b60006116c47f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b905080158061170757507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b1561170f5790565b61171b601b600a611be2565b6117a77f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b6117b19083611bf5565b6117bb9190611c0c565b90508015806117fe57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b156118065790565b611812601b600a611be2565b6110917f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b60008060006118ab61133e565b925092509250826118ec576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea606004820152602401610758565b60006118f883836114eb565b5091505080611937576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea606004820152602401610758565b50505050565b600061194761198a565b5090506000819003610e26576040517fc82fc465000000000000000000000000000000000000000000000000000000008152620101d16004820152602401610758565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff166001036119c0576112bd610e29565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600203611a08576119f3610e29565b91508160000361130b575060016112bd61115c565b611a1061115c565b91508160000361130b575060016112bd610e29565b600060208083528351808285015260005b81811015611a5257858101830151858201604001528201611a36565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600181815b80851115611b1957817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611aff57611aff611a91565b80851615611b0c57918102915b93841c9390800290611ac5565b509250929050565b600082611b3057506001611bdc565b81611b3d57506000611bdc565b8160018114611b535760028114611b5d57611b79565b6001915050611bdc565b60ff841115611b6e57611b6e611a91565b50506001821b611bdc565b5060208310610133831016604e8410600b8410161715611b9c575081810a611bdc565b611ba68383611ac0565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611bd857611bd8611a91565b0290505b92915050565b6000611bee8383611b21565b9392505050565b8082028115828204841417611bdc57611bdc611a91565b600082611c42577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ca757611ca7611a91565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b805169ffffffffffffffffffff81168114611cf757600080fd5b919050565b600080600080600060a08688031215611d1457600080fd5b611d1d86611cdd565b9450602086015193506040860151925060608601519150611d4060808701611cdd565b90509295509295909350565b69ffffffffffffffffffff8181168382160190808211156108ed576108ed611a91565b600060208284031215611d8157600080fd5b5051919050565b69ffffffffffffffffffff8281168282160390808211156108ed576108ed611a91565b81810381811115611bdc57611bdc611a9156fea264697066735822122020ba0832f98cd8e75669e8aec2d128f652fdf46f83b497f8319fb4999cd8aa1464736f6c63430008150033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100c95760003560e01c80638e7bfbc011610081578063e6aa216c1161005b578063e6aa216c14610271578063f3190c89146101e2578063f5be67a51461027957600080fd5b80638e7bfbc0146101e2578063abd5f95d146101f8578063dc4595121461020d57600080fd5b80633437eac4116100b25780633437eac4146101415780637557ca411461016757806388c35209146101da57600080fd5b80632faeaacb146100ce57806331b037a214610107575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b60405160ff90911681526020015b60405180910390f35b61010f610281565b6040805193845273ffffffffffffffffffffffffffffffffffffffff90921660208401521515908201526060016100fe565b7f00000000000000000000000000000000000000000000000000000000000000006100f0565b61016f610354565b604080519a8b5273ffffffffffffffffffffffffffffffffffffffff998a1660208c0152971515978a01979097526060890195909552928616608088015290151560a087015260c086015290921660e0840152901515610100830152610120820152610140016100fe565b61010f61063d565b6101ea610710565b6040519081526020016100fe565b61020061078f565b6040516100fe9190611a25565b6102156108f4565b6040805173ffffffffffffffffffffffffffffffffffffffff909916895260208901979097529415159587019590955260608601929092526080850152151560a084015260c0830191909152151560e0820152610100016100fe565b6101ea610a2a565b61016f610a34565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff161461030657610301610cf5565b610309565b60005b937f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b60008060008060008060008060008061036b610e29565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006104397f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610528576105237f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b61052b565b60005b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff82161561061a576106157f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b61061d565b60005b995099509950995099509950995099509950995090919293949596979899565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146106c2576106bd61115c565b6106c5565b60005b937f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b600061071a611287565b5090506000819003610761576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261eb9760048201526024015b60405180910390fd5b8061076e601b600a611be2565b61077661132c565b6107809190611bf5565b61078a9190611c0c565b905090565b606060005b6020811080156107fa57507f000000000000000000000000000000000000000000000000000000000000000081602081106107d1576107d1611c47565b1a60f81b7fff000000000000000000000000000000000000000000000000000000000000001615155b15610811578061080981611c76565b915050610794565b60008167ffffffffffffffff81111561082c5761082c611cae565b6040519080825280601f01601f191660200182016040528015610856576020820181803683370190505b50905060005b828110156108ed577f0000000000000000000000000000000000000000000000000000000000000000816020811061089657610896611c47565b1a60f81b8282815181106108ac576108ac611c47565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350806108e581611c76565b91505061085c565b5092915050565b600080600080600080600080600061090a61133e565b9198509096509050861561092e5761092281876114eb565b919650945092506109e4565b610a8c945060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c59190611cfc565b5050505090506109e08160016109db9190611d4c565b611555565b9350505b60005473ffffffffffffffffffffffffffffffffffffffff16610a8c8888888888848015610a0f57508a5b98509850985098509850985098509850509091929394959697565b600061078a610710565b600080600080600080600080600080610a4b611636565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610b197f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610c0857610c037f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b610c0b565b60005b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff82161561061a576106157f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610d9c575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610d9991810190611d6f565b60015b610da65750600090565b7f000000000000000000000000000000000000000000000000000000000000000015610dfc57610df6817f0000000000000000000000000000000000000000000000000000000000000000611c0c565b91505090565b610df67f000000000000000000000000000000000000000000000000000000000000000082611bf5565b90565b6000610eb77f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b9050801580610efa57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b15610f025790565b610f0e601b600a611be2565b610f9a7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b610fa49083611bf5565b610fae9190611c0c565b9050801580610ff157507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b15610ff95790565b611005601b600a611be2565b6110917f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b6107809083611bf5565b60008473ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa925050508015611122575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261111f91810190611cfc565b60015b61112e57506000611154565b881561114a5761113e8488611c0c565b95505050505050611154565b61113e8885611bf5565b949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611203575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261120091810190611d6f565b60015b61120d5750600090565b7f00000000000000000000000000000000000000000000000000000000000000001561125d57610df6817f0000000000000000000000000000000000000000000000000000000000000000611c0c565b610df67f000000000000000000000000000000000000000000000000000000000000000082611bf5565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff166001036112c3576112bd611636565b91509091565b7f000000000000000000000000000000000000000000000000000000000000000060ff1660020361130f576112f6611636565b91508160000361130b575060016112bd610cf5565b9091565b611317610cf5565b91508160000361130b575060016112bd611636565b600061133661189e565b61078a61193d565b60008060008060008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156113b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d69190611cfc565b5050925092509250816000146113f6575060009586955085945092505050565b6001955082945080935060008411156114e3575b60005473ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5611433600186611d88565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815269ffffffffffffffffffff909116600482015260240160a060405180830381865afa158015611492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b69190611cfc565b5092955090935091505060008290036114d0578294508093505b811580156114de5750600081115b61140a575b505050909192565b60008080806114fa8542611dab565b905084158061150a5750610a8c81115b1561152257610a8c600160009350935093505061154e565b61152b86611555565b91506115378286611dab565b9350610a8c84111561154957610a8c93505b831091505b9250925092565b60008181805b60005473ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5611584600186611d88565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815269ffffffffffffffffffff909116600482015260240160a060405180830381865afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116079190611cfc565b50929550909350915050811561161b578093505b811580159061162a5750600081115b61155b57505050919050565b60006116c47f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b905080158061170757507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b1561170f5790565b61171b601b600a611be2565b6117a77f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b6117b19083611bf5565b6117bb9190611c0c565b90508015806117fe57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b156118065790565b611812601b600a611be2565b6110917f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061109b565b60008060006118ab61133e565b925092509250826118ec576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea606004820152602401610758565b60006118f883836114eb565b5091505080611937576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea606004820152602401610758565b50505050565b600061194761198a565b5090506000819003610e26576040517fc82fc465000000000000000000000000000000000000000000000000000000008152620101d16004820152602401610758565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff166001036119c0576112bd610e29565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600203611a08576119f3610e29565b91508160000361130b575060016112bd61115c565b611a1061115c565b91508160000361130b575060016112bd610e29565b600060208083528351808285015260005b81811015611a5257858101830151858201604001528201611a36565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600181815b80851115611b1957817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611aff57611aff611a91565b80851615611b0c57918102915b93841c9390800290611ac5565b509250929050565b600082611b3057506001611bdc565b81611b3d57506000611bdc565b8160018114611b535760028114611b5d57611b79565b6001915050611bdc565b60ff841115611b6e57611b6e611a91565b50506001821b611bdc565b5060208310610133831016604e8410600b8410161715611b9c575081810a611bdc565b611ba68383611ac0565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611bd857611bd8611a91565b0290505b92915050565b6000611bee8383611b21565b9392505050565b8082028115828204841417611bdc57611bdc611a91565b600082611c42577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ca757611ca7611a91565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b805169ffffffffffffffffffff81168114611cf757600080fd5b919050565b600080600080600060a08688031215611d1457600080fd5b611d1d86611cdd565b9450602086015193506040860151925060608601519150611d4060808701611cdd565b90509295509295909350565b69ffffffffffffffffffff8181168382160190808211156108ed576108ed611a91565b600060208284031215611d8157600080fd5b5051919050565b69ffffffffffffffffffff8281168282160390808211156108ed576108ed611a91565b81810381811115611bdc57611bdc611a9156fea264697066735822122020ba0832f98cd8e75669e8aec2d128f652fdf46f83b497f8319fb4999cd8aa1464736f6c63430008150033", "devdoc": { "kind": "dev", "methods": { "constructor": { "params": { "cLRSParams1_": "CLRS Fallback Oracle data for ratio dividend", "cLRSParams2_": "CLRS Fallback Oracle data for ratio divisor", "infoName_": "Oracle identify helper name.", "sequencerUptimeFeed_": "L2 sequencer uptime Chainlink feed" } }, "getExchangeRate()": { "details": "Deprecated. Use `getExchangeRateOperate()` and `getExchangeRateLiquidate()` instead. Only implemented for backwards compatibility." } }, "title": "Ratio of 2 Chainlink / Redstone Oracles (with fallback) for Layer 2 (with sequencer outage detection)", "version": 1 }, "userdoc": { "kind": "user", "methods": { "FALLBACK_ORACLE2_MAIN_SOURCE()": { "notice": "which oracle to use as main source: - 1 = Chainlink ONLY (no fallback) - 2 = Chainlink with Redstone Fallback - 3 = Redstone with Chainlink Fallback" }, "FALLBACK_ORACLE_MAIN_SOURCE()": { "notice": "which oracle to use as main source: - 1 = Chainlink ONLY (no fallback) - 2 = Chainlink with Redstone Fallback - 3 = Redstone with Chainlink Fallback" }, "chainlinkOracleData()": { "notice": "returns all Chainlink oracle related data as utility for easy off-chain use / block explorer in a single view method" }, "chainlinkOracleData2()": { "notice": "returns all Chainlink oracle related data as utility for easy off-chain use / block explorer in a single view method" }, "constructor": { "notice": "sets the two CLRS oracle configs" }, "getExchangeRateLiquidate()": { "notice": "Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for liquidations" }, "getExchangeRateOperate()": { "notice": "Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for operates" }, "infoName()": { "notice": "helper string to easily identify the oracle. E.g. token symbols" }, "redstoneOracleData()": { "notice": "returns all Redstone oracle related data as utility for easy off-chain use / block explorer in a single view method" }, "redstoneOracleData2()": { "notice": "returns all Redstone oracle related data as utility for easy off-chain use / block explorer in a single view method" }, "sequencerL2Data()": { "notice": "returns all sequencer uptime feed related data" } }, "notice": "Gets the exchange rate between the underlying asset and the peg asset by using: 1. 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. 2. set into ratio with another price fetched the same way. I.e. it is possible to do Chainlink Oracle / Chainlink Oracle. E.g. wstETH per 1 weETH on a L2 via CL feeds.", "version": 1 }, "storageLayout": { "storage": [ { "astId": 250, "contract": "contracts/oracle/oraclesL2/ratio2xFallbackCLRSOracleL2.sol:Ratio2xFallbackCLRSOracleL2", "label": "_SEQUENCER_ORACLE", "offset": 0, "slot": "0", "type": "t_contract(IChainlinkAggregatorV3)2375" } ], "types": { "t_contract(IChainlinkAggregatorV3)2375": { "encoding": "inplace", "label": "contract IChainlinkAggregatorV3", "numberOfBytes": "20" } } } }