{ "address": "0x6bDf305BfD96C1eD1a04DB8871A254E2EF961c14", "abi": [ { "inputs": [ { "internalType": "string", "name": "infoName_", "type": "string" }, { "components": [ { "internalType": "uint8", "name": "fallbackMainSource", "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 CLRS2UniV3CheckCLRSOracleL2.CLRS2ConstructorParams", "name": "cLRS2Params_", "type": "tuple" }, { "components": [ { "components": [ { "internalType": "contract IUniswapV3Pool", "name": "pool", "type": "address" }, { "internalType": "bool", "name": "invertRate", "type": "bool" }, { "internalType": "uint256[3]", "name": "tWAPMaxDeltaPercents", "type": "uint256[3]" }, { "internalType": "uint32[5]", "name": "secondsAgos", "type": "uint32[5]" } ], "internalType": "struct UniV3OracleImpl.UniV3ConstructorParams", "name": "uniV3Params", "type": "tuple" }, { "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": "uint8", "name": "rateSource", "type": "uint8" }, { "internalType": "uint8", "name": "fallbackMainSource", "type": "uint8" }, { "internalType": "uint256", "name": "rateCheckMaxDeltaPercent", "type": "uint256" } ], "internalType": "struct UniV3CheckCLRSOracle.UniV3CheckCLRSConstructorParams", "name": "uniV3CheckCLRSParams_", "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": "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" }, { "inputs": [], "name": "uniV3CheckOracleData", "outputs": [ { "internalType": "uint256", "name": "rateCheckMaxDelta_", "type": "uint256" }, { "internalType": "uint256", "name": "rateSource_", "type": "uint256" }, { "internalType": "uint256", "name": "fallbackMainSource_", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "uniV3OracleData", "outputs": [ { "internalType": "contract IUniswapV3Pool", "name": "uniV3Pool_", "type": "address" }, { "internalType": "bool", "name": "uniV3InvertRate_", "type": "bool" }, { "internalType": "uint32[]", "name": "uniV3secondsAgos_", "type": "uint32[]" }, { "internalType": "uint256[]", "name": "uniV3TwapDeltas_", "type": "uint256[]" }, { "internalType": "uint256", "name": "uniV3exchangeRateUnsafe_", "type": "uint256" }, { "internalType": "uint256", "name": "uniV3exchangeRate_", "type": "uint256" } ], "stateMutability": "view", "type": "function" } ], "transactionHash": "0x19bf2b614a0ff4288107fe79c17f867081ed77280b6ab4e96f505c9580d069e1", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A", "contractAddress": null, "transactionIndex": 2, "gasUsed": "5844695", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "blockHash": "0x556ea172708222ad31d0aaab68972db28c096519065b4f6b800ad2fc5e56157b", "transactionHash": "0x19bf2b614a0ff4288107fe79c17f867081ed77280b6ab4e96f505c9580d069e1", "logs": [], "blockNumber": 229059855, "cumulativeGasUsed": "5905500", "status": 1, "byzantium": true }, "args": [ "USDT for 1 WEETH", { "chainlinkParams": { "hops": 1, "feed1": { "feed": "0xE141425bc1594b8039De6390db1cDaf4397EA22b", "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 }, "fallbackMainSource": 1 }, { "chainlinkParams": { "hops": 2, "feed1": { "feed": "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612", "invertRate": false, "token0Decimals": 18 }, "feed2": { "feed": "0x3f3f5dF88dC9F13eac63DF89EC16ef6e7E25DdE7", "invertRate": true, "token0Decimals": 6 }, "feed3": { "feed": "0x0000000000000000000000000000000000000000", "invertRate": false, "token0Decimals": 0 } }, "uniV3Params": { "pool": "0xC6962004f452bE9203591991D15f6b388e09E8D0", "secondsAgos": [ 240, 60, 15, 1, 0 ], "tWAPMaxDeltaPercents": [ 200, 50, 20 ], "invertRate": false }, "redstoneOracle": { "oracle": "0x0000000000000000000000000000000000000000", "invertRate": false, "token0Decimals": 0 }, "rateSource": 2, "fallbackMainSource": 1, "rateCheckMaxDeltaPercent": 300 }, "0xFdB631F5EE196F0ed6FAa767959853A9F217697D" ], "numDeployments": 1, "solcInputHash": "ca9e5aa54012862807c9d9299b1ce928", "metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"infoName_\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"fallbackMainSource\",\"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 CLRS2UniV3CheckCLRSOracleL2.CLRS2ConstructorParams\",\"name\":\"cLRS2Params_\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invertRate\",\"type\":\"bool\"},{\"internalType\":\"uint256[3]\",\"name\":\"tWAPMaxDeltaPercents\",\"type\":\"uint256[3]\"},{\"internalType\":\"uint32[5]\",\"name\":\"secondsAgos\",\"type\":\"uint32[5]\"}],\"internalType\":\"struct UniV3OracleImpl.UniV3ConstructorParams\",\"name\":\"uniV3Params\",\"type\":\"tuple\"},{\"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\":\"uint8\",\"name\":\"rateSource\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"fallbackMainSource\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"rateCheckMaxDeltaPercent\",\"type\":\"uint256\"}],\"internalType\":\"struct UniV3CheckCLRSOracle.UniV3CheckCLRSConstructorParams\",\"name\":\"uniV3CheckCLRSParams_\",\"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\":\"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\"},{\"inputs\":[],\"name\":\"uniV3CheckOracleData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rateCheckMaxDelta_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rateSource_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackMainSource_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniV3OracleData\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"uniV3Pool_\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"uniV3InvertRate_\",\"type\":\"bool\"},{\"internalType\":\"uint32[]\",\"name\":\"uniV3secondsAgos_\",\"type\":\"uint32[]\"},{\"internalType\":\"uint256[]\",\"name\":\"uniV3TwapDeltas_\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"uniV3exchangeRateUnsafe_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"uniV3exchangeRate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"cLRS2Params_\":\"CLRS2ConstructorParams for wstETH <> CLRS Token2 conversion\",\"infoName_\":\"Oracle identify helper name.\",\"sequencerUptimeFeed_\":\"L2 sequencer uptime Chainlink feed\",\"uniV3CheckCLRSParams_\":\"UniV3CheckCLRSOracle constructor params\"}},\"getExchangeRate()\":{\"details\":\"Deprecated. Use `getExchangeRateOperate()` and `getExchangeRateLiquidate()` instead. Only implemented for backwards compatibility.\"}},\"title\":\"CLRSOracle combined with a uniV3CheckCLRSOracle.\",\"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\"},\"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\":\"constructs a CLRS2UniV3CheckCLRSOracleL2 with all inherited contracts\"},\"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\"},\"uniV3CheckOracleData()\":{\"notice\":\"returns all oracle related data as utility for easy off-chain / block explorer use in a single view method\"},\"uniV3OracleData()\":{\"notice\":\"returns all UniV3 oracle related data as utility for easy off-chain use / block explorer in a single view method\"}},\"notice\":\"Gets the exchange rate between the underlying asset and the peg asset by using: 1. rate from Chainlink price feeds (or Redstone as fallback). 2. result from 1. combined with a uniV3CheckCLRSOracle to get from someToken <> someToken2 e.g. when going from wstETH to USDC: 1. wstETH -> stETH -> ETH Chainlink feed. 2. ETH -> USDC via UniV3 ETH <> USDC pool checked against ETH -> USDC Chainlink feed.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracle/oraclesL2/cLRS2UniV3CheckCLRSOracleL2.sol\":\"CLRS2UniV3CheckCLRSOracleL2\"},\"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/implementations/uniV3OracleImpl.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { FullMath } from \\\"../libraries/FullMath.sol\\\";\\nimport { TickMath } from \\\"../libraries/TickMath.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\nimport { IUniswapV3Pool } from \\\"../interfaces/external/IUniswapV3Pool.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\n\\n/// @title Uniswap V3 Oracle implementation\\n/// @notice This contract is used to get the exchange rate from from a Uniswap V3 Pool,\\n/// including logic to check against TWAP max deltas.\\n/// @dev Uses 5 secondsAgos[] values and 3 TWAP maxDeltas:\\n/// e.g. [240, 60, 15, 1, 0] -> [price240to60, price60to15, price 15to1, currentPrice]\\n/// delta checks: price240to60 vs currentPrice, price60to15 vs currentPrice and 15to1 vs currentPrice.\\nabstract contract UniV3OracleImpl is OracleError {\\n /// @dev Uniswap V3 Pool to check for the exchange rate\\n IUniswapV3Pool internal immutable _POOL;\\n\\n /// @dev 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 _UNIV3_INVERT_RATE;\\n\\n /// @dev Uniswap oracle delta for TWAP1 in 1e2 percent. If uniswap price TWAP1 is out of this delta,\\n /// current price fetching reverts. E.g. for delta of TWAP 240 -> 60 vs current price\\n uint256 internal immutable _UNI_TWAP1_MAX_DELTA_PERCENT;\\n /// @dev Uniswap oracle delta for TWAP2 in 1e2 percent. If uniswap price TWAP2 is out of this delta,\\n /// current price fetching reverts. E.g. for delta of TWAP 60 -> 15 vs current price\\n uint256 internal immutable _UNI_TWAP2_MAX_DELTA_PERCENT;\\n /// @dev Uniswap oracle delta for TWAP3 in 1e2 percent. If uniswap price TWAP3 is out of this delta,\\n /// current price fetching reverts. E.g. for delta of TWAP 15 -> 1 vs current price\\n uint256 internal immutable _UNI_TWAP3_MAX_DELTA_PERCENT;\\n\\n /// @dev Uniswap oracle seconds ago for twap, 1. value, e.g. 240\\n uint256 internal immutable _UNI_SECONDS_AGO_1;\\n /// @dev Uniswap oracle seconds ago for twap, 2. value, e.g. 60\\n uint256 internal immutable _UNI_SECONDS_AGO_2;\\n /// @dev Uniswap oracle seconds ago for twap, 3. value, e.g. 15\\n uint256 internal immutable _UNI_SECONDS_AGO_3;\\n /// @dev Uniswap oracle seconds ago for twap, 4. value, e.g. 1\\n uint256 internal immutable _UNI_SECONDS_AGO_4;\\n /// @dev Uniswap oracle seconds ago for twap, 5. value, e.g. 0\\n uint256 internal immutable _UNI_SECONDS_AGO_5;\\n\\n /// @dev Uniswap TWAP1 interval duration.\\n int256 internal immutable _UNI_TWAP1_INTERVAL;\\n /// @dev Uniswap TWAP2 interval duration.\\n int256 internal immutable _UNI_TWAP2_INTERVAL;\\n /// @dev Uniswap TWAP3 interval duration.\\n int256 internal immutable _UNI_TWAP3_INTERVAL;\\n /// @dev Uniswap TWAP4 interval duration.\\n int256 internal immutable _UNI_TWAP4_INTERVAL;\\n\\n /// @dev stored array lengths to optimize gas\\n uint256 internal constant _SECONDS_AGOS_LENGTH = 5;\\n uint256 internal constant _TWAP_DELTAS_LENGTH = 3;\\n\\n /// @dev constant value for price scaling to reduce gas usage\\n uint256 internal immutable _UNIV3_PRICE_SCALER_MULTIPLIER;\\n /// @dev constant value for inverting price to reduce gas usage\\n uint256 internal immutable _UNIV3_INVERT_PRICE_DIVIDEND;\\n\\n struct UniV3ConstructorParams {\\n /// @param pool Uniswap V3 Pool to check for the exchange rate\\n IUniswapV3Pool pool;\\n /// @param invertRate Flag to invert the Uniswap price or not\\n bool invertRate;\\n /// @param tWAPMaxDeltaPercents Uniswap oracle delta for TWAP1-2-3 in 1e2 percent\\n uint256[_TWAP_DELTAS_LENGTH] tWAPMaxDeltaPercents;\\n /// @param secondsAgos Uniswap oracle seconds ago for the 3 TWAP values, from oldest to newest, e.g. [240, 60, 15, 1, 0]\\n uint32[_SECONDS_AGOS_LENGTH] secondsAgos;\\n }\\n\\n /// @notice constructor sets the Uniswap V3 `pool_` to check for the exchange rate and the `invertRate_` flag.\\n /// E.g. `invertRate_` should be true if for the WETH/USDC pool it's expected that the oracle returns USDC per 1 WETH\\n constructor(UniV3ConstructorParams memory params_) {\\n if (address(params_.pool) == address(0)) {\\n revert FluidOracleError(ErrorTypes.UniV3Oracle__InvalidParams);\\n }\\n // sanity check that seconds agos values are ordered ascending, e.g. [240, 60, 15, 1, 0]\\n if (\\n params_.secondsAgos[0] <= params_.secondsAgos[1] ||\\n params_.secondsAgos[1] <= params_.secondsAgos[2] ||\\n params_.secondsAgos[2] <= params_.secondsAgos[3] ||\\n params_.secondsAgos[3] <= params_.secondsAgos[4]\\n ) {\\n revert FluidOracleError(ErrorTypes.UniV3Oracle__InvalidSecondsAgos);\\n }\\n // sanity check that deltas are less than 100% and decreasing (as timespan is closer to current price):\\n // 1. delta must < 100%\\n // all following deltas must be <= than the previous one\\n if (\\n params_.tWAPMaxDeltaPercents[0] >= OracleUtils.HUNDRED_PERCENT_DELTA_SCALER ||\\n params_.tWAPMaxDeltaPercents[1] > params_.tWAPMaxDeltaPercents[0] ||\\n params_.tWAPMaxDeltaPercents[2] > params_.tWAPMaxDeltaPercents[1]\\n ) {\\n revert FluidOracleError(ErrorTypes.UniV3Oracle__InvalidDeltas);\\n }\\n\\n _UNI_SECONDS_AGO_1 = uint256(params_.secondsAgos[0]);\\n _UNI_SECONDS_AGO_2 = uint256(params_.secondsAgos[1]);\\n _UNI_SECONDS_AGO_3 = uint256(params_.secondsAgos[2]);\\n _UNI_SECONDS_AGO_4 = uint256(params_.secondsAgos[3]);\\n _UNI_SECONDS_AGO_5 = uint256(params_.secondsAgos[4]);\\n\\n _UNI_TWAP1_INTERVAL = int256(uint256(params_.secondsAgos[0] - params_.secondsAgos[1]));\\n _UNI_TWAP2_INTERVAL = int256(uint256(params_.secondsAgos[1] - params_.secondsAgos[2]));\\n _UNI_TWAP3_INTERVAL = int256(uint256(params_.secondsAgos[2] - params_.secondsAgos[3]));\\n _UNI_TWAP4_INTERVAL = int256(uint256(params_.secondsAgos[3] - params_.secondsAgos[4]));\\n\\n _UNI_TWAP1_MAX_DELTA_PERCENT = params_.tWAPMaxDeltaPercents[0]; // e.g. for TWAP 240 -> 60 vs current price\\n _UNI_TWAP2_MAX_DELTA_PERCENT = params_.tWAPMaxDeltaPercents[1]; // e.g. for TWAP 60 -> 15 vs current price\\n _UNI_TWAP3_MAX_DELTA_PERCENT = params_.tWAPMaxDeltaPercents[2]; // e.g. for TWAP 15 -> 1 vs current price\\n\\n _POOL = params_.pool;\\n _UNIV3_INVERT_RATE = params_.invertRate;\\n\\n // uniswapV3 returned price is already scaled to token decimals.\\n _UNIV3_PRICE_SCALER_MULTIPLIER = 10 ** OracleUtils.RATE_OUTPUT_DECIMALS;\\n // uniV3 invert price dividend happens on the already scaled by 1e27 result for price in token1 per 1 token0\\n _UNIV3_INVERT_PRICE_DIVIDEND = 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS * 2);\\n }\\n\\n /// @dev Get the last exchange rate from the pool's last observed value without any checks\\n /// @return exchangeRateUnsafe_ The exchange rate between the underlying asset and the peg asset in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n function _getUniV3ExchangeRateUnsafe() internal view returns (uint256 exchangeRateUnsafe_) {\\n (uint160 sqrtPriceX96_, , , , , , ) = _POOL.slot0();\\n\\n exchangeRateUnsafe_ = _UNIV3_INVERT_RATE\\n ? _invertUniV3Price(_getPriceFromSqrtPriceX96(sqrtPriceX96_))\\n : _getPriceFromSqrtPriceX96(sqrtPriceX96_);\\n }\\n\\n /// @dev Get the last exchange rate from the pool's last observed value, checked against TWAP deviations.\\n /// @return exchangeRate_ The exchange rate between the underlying asset and the peg asset in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n /// If 0 then the fetching the price failed or a delta was invalid.\\n function _getUniV3ExchangeRate() internal view returns (uint256 exchangeRate_) {\\n // build calldata bytes in a gas-optimized way without having to build an array / using abi.encode.\\n // gas efficient work around for Solidity not supporting immutable non-value types.\\n bytes memory data_ = abi.encodePacked(\\n hex\\\"883bdbfd\\\", // pack function selector\\n hex\\\"0000000000000000000000000000000000000000000000000000000000000020\\\", // pack start offset of dynamic array\\n _SECONDS_AGOS_LENGTH, // pack length of dynamic array\\n // pack seconds agos values:\\n _UNI_SECONDS_AGO_1,\\n _UNI_SECONDS_AGO_2,\\n _UNI_SECONDS_AGO_3,\\n _UNI_SECONDS_AGO_4,\\n _UNI_SECONDS_AGO_5\\n );\\n\\n // get the tickCumulatives from Pool.observe()\\n (bool success_, bytes memory result_) = address(_POOL).staticcall(data_);\\n\\n if (!success_) {\\n return 0;\\n }\\n int56[] memory tickCumulatives_ = abi.decode(result_, (int56[]));\\n\\n unchecked {\\n int24 exchangeRateTick_;\\n {\\n int56 tickCumulativesDelta_ = (tickCumulatives_[_TWAP_DELTAS_LENGTH + 1] -\\n tickCumulatives_[_TWAP_DELTAS_LENGTH]);\\n // _UNI_TWAP4_INTERVAL can not be 0 because of constructor sanity checks\\n exchangeRateTick_ = int24(tickCumulativesDelta_ / _UNI_TWAP4_INTERVAL);\\n // Always round to negative infinity, see UniV3 OracleLibrary\\n // https://github.com/Uniswap/v3-periphery/blob/697c2474757ea89fec12a4e6db16a574fe259610/contracts/libraries/OracleLibrary.sol#L36\\n if (tickCumulativesDelta_ < 0 && (tickCumulativesDelta_ % _UNI_TWAP4_INTERVAL != 0)) {\\n exchangeRateTick_--;\\n }\\n }\\n\\n // Check the latest Uniswap price is within the acceptable delta from each TWAP range\\n // TWAP 1 check\\n if (\\n _isInvalidTWAPDelta(\\n int256(exchangeRateTick_),\\n tickCumulatives_[1] - tickCumulatives_[0],\\n _UNI_TWAP1_INTERVAL,\\n int256(_UNI_TWAP1_MAX_DELTA_PERCENT)\\n )\\n ) {\\n return 0;\\n }\\n\\n // TWAP 2 check\\n if (\\n _isInvalidTWAPDelta(\\n int256(exchangeRateTick_),\\n tickCumulatives_[2] - tickCumulatives_[1],\\n _UNI_TWAP2_INTERVAL,\\n int256(_UNI_TWAP2_MAX_DELTA_PERCENT)\\n )\\n ) {\\n return 0;\\n }\\n\\n // TWAP 3 check\\n if (\\n _isInvalidTWAPDelta(\\n int256(exchangeRateTick_),\\n tickCumulatives_[3] - tickCumulatives_[2],\\n _UNI_TWAP3_INTERVAL,\\n int256(_UNI_TWAP3_MAX_DELTA_PERCENT)\\n )\\n ) {\\n return 0;\\n }\\n\\n // get the current uniswap price, which is the last tick cumulatives interval, usually [..., 1, 0]\\n exchangeRate_ = _getPriceFromSqrtPriceX96(TickMath.getSqrtRatioAtTick(exchangeRateTick_));\\n if (_UNIV3_INVERT_RATE) {\\n exchangeRate_ = _invertUniV3Price(exchangeRate_);\\n }\\n }\\n }\\n\\n /// @dev verifies that `exchangeRate_` is within `maxDelta_` for derived price from `tickCumulativesDelta_` and `interval_`.\\n /// returns true if delta is invalid\\n function _isInvalidTWAPDelta(\\n int256 exchangeRateTick_,\\n int256 tickCumulativesDelta_,\\n int256 interval_, // can not be 0 because of constructor sanity checks\\n int256 maxDelta_\\n ) internal pure returns (bool) {\\n unchecked {\\n int256 arithmeticMeanTick_ = int256(tickCumulativesDelta_ / interval_);\\n // Always round to negative infinity, see UniV3 OracleLibrary\\n // https://github.com/Uniswap/v3-periphery/blob/697c2474757ea89fec12a4e6db16a574fe259610/contracts/libraries/OracleLibrary.sol#L36\\n if (tickCumulativesDelta_ < 0 && (tickCumulativesDelta_ % interval_ != 0)) {\\n arithmeticMeanTick_--;\\n }\\n\\n // Check that the uniswapPrice is within DELTA of the Uniswap TWAP (via tick)\\n // each univ3 tick is 0.01% increase or decrease in price. `maxDelta_` has near to same precision.\\n // Note: near to the same because each Uniswap tick is 0.01% away so price of ticks are if current one is 100 then next will be:\\n // 100 + 100 * 0.01% = 100.01\\n // 100.01 + 100.01 * 0.01% = 100.020001\\n if (\\n exchangeRateTick_ > (arithmeticMeanTick_ + maxDelta_) ||\\n exchangeRateTick_ < (arithmeticMeanTick_ - maxDelta_)\\n ) {\\n // Uniswap last price is NOT within the delta\\n return true;\\n }\\n }\\n return false;\\n }\\n\\n /// @notice returns all UniV3 oracle related data as utility for easy off-chain use / block explorer in a single view method\\n function uniV3OracleData()\\n public\\n view\\n returns (\\n IUniswapV3Pool uniV3Pool_,\\n bool uniV3InvertRate_,\\n uint32[] memory uniV3secondsAgos_,\\n uint256[] memory uniV3TwapDeltas_,\\n uint256 uniV3exchangeRateUnsafe_,\\n uint256 uniV3exchangeRate_\\n )\\n {\\n // Get the latest TWAP prices from the Uniswap Oracle for second intervals\\n uniV3secondsAgos_ = new uint32[](_SECONDS_AGOS_LENGTH);\\n uniV3secondsAgos_[0] = uint32(_UNI_SECONDS_AGO_1);\\n uniV3secondsAgos_[1] = uint32(_UNI_SECONDS_AGO_2);\\n uniV3secondsAgos_[2] = uint32(_UNI_SECONDS_AGO_3);\\n uniV3secondsAgos_[3] = uint32(_UNI_SECONDS_AGO_4);\\n uniV3secondsAgos_[4] = uint32(_UNI_SECONDS_AGO_5);\\n\\n // Check the latest Uniswap price is within the acceptable delta from each TWAP range\\n uniV3TwapDeltas_ = new uint256[](_TWAP_DELTAS_LENGTH);\\n uniV3TwapDeltas_[0] = _UNI_TWAP1_MAX_DELTA_PERCENT;\\n uniV3TwapDeltas_[1] = _UNI_TWAP2_MAX_DELTA_PERCENT;\\n uniV3TwapDeltas_[2] = _UNI_TWAP3_MAX_DELTA_PERCENT;\\n\\n return (\\n _POOL,\\n _UNIV3_INVERT_RATE,\\n uniV3secondsAgos_,\\n uniV3TwapDeltas_,\\n _getUniV3ExchangeRateUnsafe(),\\n _getUniV3ExchangeRate()\\n );\\n }\\n\\n /// @dev Get the price from the sqrt price in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n /// (see https://blog.uniswap.org/uniswap-v3-math-primer)\\n /// @param sqrtPriceX96_ The sqrt price to convert\\n function _getPriceFromSqrtPriceX96(uint160 sqrtPriceX96_) private view returns (uint256 priceX96_) {\\n return\\n FullMath.mulDiv(\\n uint256(sqrtPriceX96_) * uint256(sqrtPriceX96_),\\n _UNIV3_PRICE_SCALER_MULTIPLIER,\\n 1 << 192 // 2^96 * 2\\n );\\n }\\n\\n /// @dev Invert the price\\n /// @param price_ The price to invert\\n /// @return invertedPrice_ The inverted price in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n function _invertUniV3Price(uint256 price_) private view returns (uint256 invertedPrice_) {\\n return _UNIV3_INVERT_PRICE_DIVIDEND / price_;\\n }\\n}\\n\",\"keccak256\":\"0x133b9b611f3ff4f78ebff8f711a186c4e771c5c8305a4598b79f84657417bcc9\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/wstETHOracleImpl.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IWstETH } from \\\"../interfaces/external/IWstETH.sol\\\";\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\n\\n/// @title wstETH Oracle Implementation\\n/// @notice This contract is used to get the exchange rate between wstETH and stETH\\nabstract contract WstETHOracleImpl is OracleError {\\n /// @notice constant value for price scaling to reduce gas usage\\n uint256 internal immutable _WSTETH_PRICE_SCALER_MULTIPLIER;\\n\\n /// @notice WSTETH contract, e.g. on mainnet 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0\\n IWstETH internal immutable _WSTETH;\\n\\n /// @notice constructor sets the wstETH `wstETH_` token address.\\n constructor(IWstETH wstETH_) {\\n if (address(wstETH_) == address(0)) {\\n revert FluidOracleError(ErrorTypes.WstETHOracle__InvalidParams);\\n }\\n\\n _WSTETH = wstETH_;\\n\\n _WSTETH_PRICE_SCALER_MULTIPLIER = 10 ** (OracleUtils.RATE_OUTPUT_DECIMALS - 18); // e.g. 1e9\\n }\\n\\n /// @notice Get the exchange rate from wstETH contract\\n /// @return rate_ The exchange rate in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n function _getWstETHExchangeRate() internal view returns (uint256 rate_) {\\n return _WSTETH.stEthPerToken() * _WSTETH_PRICE_SCALER_MULTIPLIER;\\n }\\n\\n /// @notice returns all wWtETH oracle related data as utility for easy off-chain use / block explorer in a single view method\\n function wstETHOracleData() public view returns (uint256 wstETHExchangeRate_, IWstETH wstETH_) {\\n return (_getWstETHExchangeRate(), _WSTETH);\\n }\\n}\\n\",\"keccak256\":\"0x2c923e9fc9107a469e55dfa9a6a1d02f44be696cfafdb078d76fc6d3ef5695bc\",\"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/external/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity 0.8.21;\\n\\n/// from https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces.\\n/// Copyright (c) 2022 Uniswap Labs\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(\\n uint32[] calldata secondsAgos\\n ) external view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(\\n int24 tickLower,\\n int24 tickUpper\\n ) external view returns (int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside);\\n}\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(\\n int24 tick\\n )\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(\\n bytes32 key\\n )\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(\\n uint256 index\\n )\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState, IUniswapV3PoolDerivedState {\\n\\n}\\n\",\"keccak256\":\"0x43b27a5e907ac32e5627b1f0cc9d456ce9575fd7cb7168913997ec35eae91e20\",\"license\":\"GPL-2.0-or-later\"},\"contracts/oracle/interfaces/external/IWstETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\ninterface IWstETH {\\n /**\\n * @notice Get amount of stETH for 1 wstETH\\n * @return Amount of stETH for 1 wstETH\\n */\\n function stEthPerToken() external view returns (uint256);\\n\\n /**\\n * @notice Get amount of wstETH for 1 stETH\\n * @return Amount of wstETH for 1 stETH\\n */\\n function tokensPerStEth() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xfe6c8477bea4b01e693d5a8ca635e795e203fe53ddee0fb30f3dcf9a0e5f4f61\",\"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/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\n/// @dev Modified from the original UniswapV3 library to support v0.8\\n/// From: uint256 twos = -denominator & denominator;\\n/// To: uint256 twos = (type(uint256).max - denominator + 1) & denominator;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(uint256 a, uint256 b, uint256 denominator) internal pure returns (uint256 result) {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n /// @dev This line was modified for v0.8.x\\n // uint256 twos = -denominator & denominator;\\n uint256 twos = (type(uint256).max - denominator + 1) & denominator;\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(uint256 a, uint256 b, uint256 denominator) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb16b2da5b29a45e3861e59f7f938a76c7439d3e0d27f0b022d234f5df1c67d92\",\"license\":\"MIT\"},\"contracts/oracle/libraries/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity 0.8.21;\\n\\n/// @dev Modified from the original UniswapV3 library to support v0.8\\n/// From: require(absTick <= uint256(MAX_TICK), 'T');\\n/// To: require(absTick <= uint256(int(MAX_TICK)), 'T');\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {\\n uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n /// @dev This line was modified for v0.8.x\\n // require(absTick <= uint256(MAX_TICK), 'T');\\n require(absTick <= uint256(int(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, \\\"R\\\");\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);\\n int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);\\n\\n tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0x90a908cb8fd4aad9cb79a79b13fdf223c13f990f444e17ead54d50ffd0dadaa6\",\"license\":\"GPL-2.0-or-later\"},\"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/uniV3CheckCLRSOracle.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 { UniV3OracleImpl } from \\\"../implementations/uniV3OracleImpl.sol\\\";\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\n\\n/// @title UniswapV3 checked against Chainlink / Redstone Oracle. Either one reported as exchange rate.\\n/// @notice Gets the exchange rate between the underlying asset and the peg asset by using:\\n/// the price from a UniV3 pool (compared against 3 TWAPs) and (optionally) comparing it against a Chainlink\\n/// or Redstone price (one of Chainlink or Redstone being the main source and the other one the fallback source).\\n/// Alternatively it can also use Chainlink / Redstone as main price and use UniV3 as check price.\\n/// @dev The process for getting the aggregate oracle price is:\\n/// 1. Fetch the UniV3 TWAPS, the latest interval is used as the current price\\n/// 2. Verify this price is within an acceptable DELTA from the Uniswap TWAPS e.g.:\\n/// a. 240 to 60s\\n/// b. 60 to 15s\\n/// c. 15 to 1s (last block)\\n/// d. 1 to 0s (current)\\n/// 3. (unless UniV3 only mode): Verify this price is within an acceptable DELTA from the Chainlink / Redstone Oracle\\n/// 4. If it passes all checks, return the price. Otherwise use fallbacks, usually to Chainlink. In extreme edge-cases revert.\\n/// @dev For UniV3 with check mode, if fetching the check price fails, the UniV3 rate is used directly.\\ncontract UniV3CheckCLRSOracle is FluidOracle, UniV3OracleImpl, FallbackOracleImpl {\\n /// @dev Rate check oracle delta percent in 1e2 percent. If current uniswap price is out of this delta,\\n /// current price fetching reverts.\\n uint256 internal immutable _RATE_CHECK_MAX_DELTA_PERCENT;\\n\\n /// @dev which oracle to use as final rate source:\\n /// - 1 = UniV3 ONLY (no check),\\n /// - 2 = UniV3 with Chainlink / Redstone check\\n /// - 3 = Chainlink / Redstone with UniV3 used as check.\\n uint8 internal immutable _RATE_SOURCE;\\n\\n struct UniV3CheckCLRSConstructorParams {\\n /// @param uniV3Params UniV3Oracle constructor params struct.\\n UniV3ConstructorParams uniV3Params;\\n /// @param chainlinkParams ChainlinkOracle constructor params struct for UniV3CheckCLRSOracle.\\n ChainlinkConstructorParams chainlinkParams;\\n /// @param redstoneOracle Redstone Oracle data for UniV3CheckCLRSOracle. (address can be set to zero address if using Chainlink only)\\n RedstoneOracleData redstoneOracle;\\n /// @param rateSource which oracle to use as final rate source for UniV3CheckCLRSOracle:\\n /// - 1 = UniV3 ONLY (no check),\\n /// - 2 = UniV3 with Chainlink / Redstone check\\n /// - 3 = Chainlink / Redstone with UniV3 used as check.\\n uint8 rateSource;\\n /// @param fallbackMainSource which oracle to use as CL/RS main source for UniV3CheckCLRSOracle: see FallbackOracleImpl constructor `mainSource_`\\n uint8 fallbackMainSource;\\n /// @param rateCheckMaxDeltaPercent Rate check oracle delta in 1e2 percent for UniV3CheckCLRSOracle\\n uint256 rateCheckMaxDeltaPercent;\\n }\\n\\n constructor(\\n string memory infoName_,\\n UniV3CheckCLRSConstructorParams memory params_\\n )\\n UniV3OracleImpl(params_.uniV3Params)\\n FallbackOracleImpl(params_.fallbackMainSource, params_.chainlinkParams, params_.redstoneOracle)\\n FluidOracle(infoName_)\\n {\\n if (\\n params_.rateSource < 1 ||\\n params_.rateSource > 3 ||\\n params_.rateCheckMaxDeltaPercent > OracleUtils.HUNDRED_PERCENT_DELTA_SCALER ||\\n // Chainlink only Oracle with UniV3 check. Delta would be ignored so revert this type of Oracle setup.\\n (params_.fallbackMainSource == 1 && params_.rateSource == 3)\\n ) {\\n revert FluidOracleError(ErrorTypes.UniV3CheckCLRSOracle__InvalidParams);\\n }\\n\\n _RATE_CHECK_MAX_DELTA_PERCENT = params_.rateCheckMaxDeltaPercent;\\n _RATE_SOURCE = params_.rateSource;\\n }\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRateOperate() public view virtual override returns (uint256 exchangeRate_) {\\n return _getExchangeRate();\\n }\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRateLiquidate() public view virtual override returns (uint256 exchangeRate_) {\\n return _getExchangeRate();\\n }\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRate() public view virtual override returns (uint256 exchangeRate_) {\\n return _getExchangeRate();\\n }\\n\\n /// @notice returns all oracle related data as utility for easy off-chain / block explorer use in a single view method\\n function uniV3CheckOracleData()\\n public\\n view\\n returns (uint256 rateCheckMaxDelta_, uint256 rateSource_, uint256 fallbackMainSource_)\\n {\\n return (_RATE_CHECK_MAX_DELTA_PERCENT, _RATE_SOURCE, _FALLBACK_ORACLE_MAIN_SOURCE);\\n }\\n\\n function _getExchangeRate() internal view returns (uint256 exchangeRate_) {\\n if (_RATE_SOURCE == 1) {\\n // uniswap is the only main source without check:\\n // 1. get uniV3 rate.\\n // 2. If that fails (outside delta range) -> revert (no other Oracle configured).\\n exchangeRate_ = _getUniV3ExchangeRate();\\n\\n if (exchangeRate_ == 0) {\\n // fetching UniV3 failed or invalid delta -> revert\\n revert FluidOracleError(ErrorTypes.UniV3CheckCLRSOracle__ExchangeRateZero);\\n }\\n\\n return exchangeRate_;\\n }\\n\\n uint256 checkRate_;\\n bool fallback_;\\n if (_RATE_SOURCE == 2) {\\n // uniswap is main source, with Chainlink / Redstone as check\\n // 1. get uniV3 rate\\n\\n // case uniV3 rate fails (outside delta range):\\n // 2. get Chainlink rate. -> if successful, use Chainlink as result\\n // 3. if Chainlink fails too, get Redstone -> if successful, use Redstone as result\\n // 4. if Redstone fails too, revert\\n\\n // case if uniV3 rate is ok\\n // 2. get Chainlink or Redstone rate for check (one is configured as main check source, other one is fallback source)\\n // -> if both fail to fetch, use uniV3 rate directly.\\n // 3. check the delta for uniV3 rate against the check soure rate. -> if ok, return uniV3 rate\\n // 4. if delta check fails, check delta against the fallback check source. -> if ok, return uniV3 rate\\n // 5. if delta check fails for both sources, return Chainlink price\\n\\n exchangeRate_ = _getUniV3ExchangeRate();\\n\\n if (exchangeRate_ == 0) {\\n // uniV3 failed or invalid delta -> use (Chainlink with Redstone as fallback)\\n exchangeRate_ = _getChainlinkOrRedstoneAsFallback();\\n if (exchangeRate_ == 0) {\\n // Chainlink / Redstone failed too -> revert\\n revert FluidOracleError(ErrorTypes.UniV3CheckCLRSOracle__ExchangeRateZero);\\n }\\n return exchangeRate_;\\n }\\n\\n (checkRate_, fallback_) = _getRateWithFallback();\\n if (checkRate_ == 0) {\\n // check price source failed to fetch -> directly use uniV3 TWAP checked price\\n // Note uniV3 price fetching was successful, would have been caught otherwise above.\\n return exchangeRate_;\\n }\\n } else {\\n // Chainlink / Redstone is main source, with uniV3 as check.\\n // 1. get Chainlink / Redstone rate (one is configured as main source, other one is fallback source)\\n\\n // case when both Chainlink & Redstone fail:\\n // 2. get uniV3 rate. if successful, use uniV3 rate. otherwise, revert (all oracles failed).\\n\\n // case when Chainlink / Redstone fetch is successful:\\n // 2. get uniV3 rate for check.\\n // 3. if uniV3 rate fails to fetch (outside delta), use Chainlink / Redstone directly (skip check).\\n // 4. if uniV3 rate is ok, check the delta for Chainlink / Redstone rate against uniV3 rate.\\n // -> if ok, return Chainlink / Redstone (main) rate\\n // 5. if delta check fails, check delta against the fallback main source.\\n // -> if ok, return fallback main rate\\n // 6. if delta check fails for both sources, return Chainlink price.\\n\\n (exchangeRate_, fallback_) = _getRateWithFallback();\\n checkRate_ = _getUniV3ExchangeRate();\\n\\n if (exchangeRate_ == 0) {\\n if (checkRate_ == 0) {\\n // all oracles failed, revert\\n revert FluidOracleError(ErrorTypes.UniV3CheckCLRSOracle__ExchangeRateZero);\\n }\\n\\n // Both Chainlink & Redstone failed -> directly use uniV3 TWAP checked price\\n // Note uniV3 price fetching was successful, would have been caught otherwise above.\\n return checkRate_;\\n }\\n\\n if (checkRate_ == 0) {\\n // uniV3 failed -> skip check against Uniswap price.\\n\\n return exchangeRate_;\\n }\\n }\\n\\n if (OracleUtils.isRateOutsideDelta(exchangeRate_, checkRate_, _RATE_CHECK_MAX_DELTA_PERCENT)) {\\n if (fallback_) {\\n // fallback already used, no other rate available to check.\\n\\n // if price is chainlink price -> return it.\\n if (_FALLBACK_ORACLE_MAIN_SOURCE == 3) {\\n // redstone with Chainlink as fallback\\n return _RATE_SOURCE == 2 ? checkRate_ : exchangeRate_; // if rate source is 2, Chainlink rate is in checkRate_\\n }\\n\\n // if price is redstone price -> revert\\n revert FluidOracleError(ErrorTypes.UniV3CheckCLRSOracle__InvalidPrice);\\n }\\n\\n if (_FALLBACK_ORACLE_MAIN_SOURCE == 1) {\\n // 1 = only chainlink and UniV3 is configured and delta check failed. no fallback available.\\n if (_RATE_SOURCE == 2) {\\n // case where uniV3 is main source with only Chainlink as check rate Oracle configured.\\n // delta check failed -> return Chainlink price (instead of uniV3 price).\\n return checkRate_;\\n }\\n\\n // here: if (_FALLBACK_ORACLE_MAIN_SOURCE == 1 && _RATE_SOURCE == 3)\\n // rate source is 3: Chainlink as main, uniV3 as delta. delta check failed.\\n // this Oracle type would basically be a more expensive Chainlink-only Oracle because the delta check against UniV3 is ignored.\\n // this setup is reverted in constructor, but in any case returning Chainlink price here even though this code should never be reached.\\n return exchangeRate_; // exchangeRate_ here is chainlink price\\n }\\n\\n // fallback not done yet -> check against fallback price.\\n // So if originally Chainlink was fetched and delta failed, check against Redstone.\\n // if originally Redstone was fetched and delta failed, check against Chainlink.\\n if (_FALLBACK_ORACLE_MAIN_SOURCE == 2) {\\n // 2 = Chainlink with Redstone Fallback. delta check against Chainlink failed. try against Redstone.\\n uint256 redstoneRate_ = _getRedstoneExchangeRate();\\n uint256 chainlinkRate_;\\n if (_RATE_SOURCE == 2) {\\n // uniV3 main source. -> update checkRate_ with Redstone price\\n chainlinkRate_ = checkRate_;\\n checkRate_ = redstoneRate_;\\n } else {\\n // uniV3 is check source. -> update exchangeRate_ with Redstone price\\n chainlinkRate_ = exchangeRate_;\\n exchangeRate_ = redstoneRate_;\\n }\\n\\n if (redstoneRate_ == 0) {\\n // fetching Redstone failed. So delta UniV3 <> Chainlink failed, fetching Redstone as backup failed.\\n // -> return chainlink price (for both cases when Chainlink is main and when UniV3 is the main source).\\n return chainlinkRate_;\\n }\\n\\n if (OracleUtils.isRateOutsideDelta(exchangeRate_, checkRate_, _RATE_CHECK_MAX_DELTA_PERCENT)) {\\n // delta check against Redstone failed too. return Chainlink price\\n return chainlinkRate_;\\n }\\n\\n // delta check against Redstone passed. if uniV3 main source -> return uniV3, else return Redstone.\\n // exchangeRate_ is already set correctly for this.\\n } else {\\n // 3 = Redstone with Chainlink Fallback. delta check against Redstone failed. try against Chainlink.\\n uint256 chainlinkRate_ = _getChainlinkExchangeRate();\\n if (chainlinkRate_ == 0) {\\n // fetching Chainlink failed. So delta UniV3 <> Redstone failed, fetching Chainlink as backup check failed.\\n // -> revert.\\n revert FluidOracleError(ErrorTypes.UniV3CheckCLRSOracle__InvalidPrice);\\n }\\n\\n if (_RATE_SOURCE == 3) {\\n // uniV3 is check source. -> update exchangeRate_ with Chainlink price.\\n // Optimization: in this case we can directly return chainlink price, because if delta check between\\n // Chainlink (new main source) and uniV3 (check source) fails, we anyway return Chainlink price still.\\n return chainlinkRate_;\\n }\\n\\n // uniV3 main source. -> update checkRate_ with Chainlink price and compare delta again\\n checkRate_ = chainlinkRate_;\\n\\n if (OracleUtils.isRateOutsideDelta(exchangeRate_, checkRate_, _RATE_CHECK_MAX_DELTA_PERCENT)) {\\n // delta check against Chainlink failed too. case here can only be where uniV3 would have been\\n // main source and Chainlink check source. -> return Chainlink as price instead of uniV3\\n return checkRate_;\\n }\\n\\n // delta check against Chainlink passed. if uniV3 main source -> return uniV3, else return Chainlink.\\n // exchangeRate_ is already set correctly for this.\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x38547b1096ac7694075e9fad37d7376588efeb670e553df4dfe930173926ba65\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/oraclesL2/cLRS2UniV3CheckCLRSOracleL2.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { FluidOracleL2 } from \\\"../fluidOracleL2.sol\\\";\\nimport { UniV3CheckCLRSOracleL2 } from \\\"./uniV3CheckCLRSOracleL2.sol\\\";\\nimport { WstETHOracleImpl } from \\\"../implementations/wstETHOracleImpl.sol\\\";\\nimport { FallbackOracleImpl2 } from \\\"../implementations/fallbackOracleImpl2.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\n\\n// @dev uses FallbackOracleImpl2 to avoid conflicts with already used ChainlinkOracleImpl, RedstoneOracleImpl and\\n// FallbackOracleImpl in UniV3CheckCLRSOracle.\\n\\n/// @title CLRSOracle combined with a uniV3CheckCLRSOracle.\\n/// @notice Gets the exchange rate between the underlying asset and the peg asset by using:\\n/// 1. rate from Chainlink price feeds (or Redstone as fallback).\\n/// 2. result from 1. combined with a uniV3CheckCLRSOracle to get from someToken <> someToken2\\n/// e.g. when going from wstETH to USDC:\\n/// 1. wstETH -> stETH -> ETH Chainlink feed.\\n/// 2. ETH -> USDC via UniV3 ETH <> USDC pool checked against ETH -> USDC Chainlink feed.\\ncontract CLRS2UniV3CheckCLRSOracleL2 is FluidOracleL2, FallbackOracleImpl2, UniV3CheckCLRSOracleL2 {\\n struct CLRS2ConstructorParams {\\n /// @param fallbackMainSource which oracle to use as main source for wstETH <> CLRS: 1 = Chainlink, 2 = Redstone (other one is fallback).\\n uint8 fallbackMainSource;\\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 constructs a CLRS2UniV3CheckCLRSOracleL2 with all inherited contracts\\n /// @param infoName_ Oracle identify helper name.\\n /// @param cLRS2Params_ CLRS2ConstructorParams for wstETH <> CLRS Token2 conversion\\n /// @param uniV3CheckCLRSParams_ UniV3CheckCLRSOracle constructor params\\n /// @param sequencerUptimeFeed_ L2 sequencer uptime Chainlink feed\\n constructor(\\n string memory infoName_,\\n CLRS2ConstructorParams memory cLRS2Params_,\\n UniV3CheckCLRSConstructorParams memory uniV3CheckCLRSParams_,\\n address sequencerUptimeFeed_\\n )\\n FallbackOracleImpl2(cLRS2Params_.fallbackMainSource, cLRS2Params_.chainlinkParams, cLRS2Params_.redstoneOracle)\\n UniV3CheckCLRSOracleL2(infoName_, uniV3CheckCLRSParams_, sequencerUptimeFeed_)\\n {}\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRateOperate()\\n public\\n view\\n override(FluidOracleL2, UniV3CheckCLRSOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n // 1. get CLRS Oracle rate for wstETH <> CLRS feed. uses FallbackOracleImpl2\\n (exchangeRate_, ) = _getRateWithFallback2();\\n if (exchangeRate_ == 0) {\\n // revert if fetched exchange rate is 0\\n revert FluidOracleError(ErrorTypes.CLRS2UniV3CheckCLRSOracleL2__ExchangeRateZero);\\n }\\n\\n // 2. get rate from UniV3Check Oracle (likely uniV3 / Chainlink checked against for delta). This always returns\\n // a price if some rate is valid, with multiple fallbacks. Can not return 0. Combine this rate with existing.\\n // (super.getExchangeRate returns UniV3CheckCLRSOracleL2 rate, no other inherited contract has this.)\\n // includes _ensureSequencerUpAndValid();\\n exchangeRate_ = (super.getExchangeRateOperate() * exchangeRate_) / (10 ** OracleUtils.RATE_OUTPUT_DECIMALS);\\n }\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRateLiquidate()\\n public\\n view\\n override(FluidOracleL2, UniV3CheckCLRSOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n // 1. get CLRS Oracle rate for wstETH <> CLRS feed. uses FallbackOracleImpl2\\n (exchangeRate_, ) = _getRateWithFallback2();\\n if (exchangeRate_ == 0) {\\n // revert if fetched exchange rate is 0\\n revert FluidOracleError(ErrorTypes.CLRS2UniV3CheckCLRSOracleL2__ExchangeRateZero);\\n }\\n\\n // 2. get rate from UniV3Check Oracle (likely uniV3 / Chainlink checked against for delta). This always returns\\n // a price if some rate is valid, with multiple fallbacks. Can not return 0. Combine this rate with existing.\\n // (super.getExchangeRate returns UniV3CheckCLRSOracleL2 rate, no other inherited contract has this.)\\n // includes _ensureSequencerUpAndValid();\\n exchangeRate_ = (super.getExchangeRateLiquidate() * exchangeRate_) / (10 ** OracleUtils.RATE_OUTPUT_DECIMALS);\\n }\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRate()\\n public\\n view\\n override(FluidOracleL2, UniV3CheckCLRSOracleL2)\\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\":\"0xd16514fa645e7d746880e5da29af609dc5e2d221890145b4c6fccf1e08fed777\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/oraclesL2/uniV3CheckCLRSOracleL2.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { FluidOracleL2 } from \\\"../fluidOracleL2.sol\\\";\\nimport { UniV3CheckCLRSOracle } from \\\"../oracles/uniV3CheckCLRSOracle.sol\\\";\\n\\n/// @title UniswapV3 checked against Chainlink / Redstone Oracle for Layer 2 (with sequencer outage detection). Either one reported as exchange rate.\\n/// @notice Gets the exchange rate between the underlying asset and the peg asset by using:\\n/// the price from a UniV3 pool (compared against 3 TWAPs) and (optionally) comparing it against a Chainlink\\n/// or Redstone price (one of Chainlink or Redstone being the main source and the other one the fallback source).\\n/// Alternatively it can also use Chainlink / Redstone as main price and use UniV3 as check price.\\n/// @dev The process for getting the aggregate oracle price is:\\n/// 1. Fetch the UniV3 TWAPS, the latest interval is used as the current price\\n/// 2. Verify this price is within an acceptable DELTA from the Uniswap TWAPS e.g.:\\n/// a. 240 to 60s\\n/// b. 60 to 15s\\n/// c. 15 to 1s (last block)\\n/// d. 1 to 0s (current)\\n/// 3. (unless UniV3 only mode): Verify this price is within an acceptable DELTA from the Chainlink / Redstone Oracle\\n/// 4. If it passes all checks, return the price. Otherwise use fallbacks, usually to Chainlink. In extreme edge-cases revert.\\n/// @dev For UniV3 with check mode, if fetching the check price fails, the UniV3 rate is used directly.\\ncontract UniV3CheckCLRSOracleL2 is FluidOracleL2, UniV3CheckCLRSOracle {\\n constructor(\\n string memory infoName_,\\n UniV3CheckCLRSConstructorParams memory params_,\\n address sequencerUptimeFeed_\\n ) UniV3CheckCLRSOracle(infoName_, params_) FluidOracleL2(sequencerUptimeFeed_) {}\\n\\n /// @inheritdoc FluidOracleL2\\n function getExchangeRateOperate()\\n public\\n view\\n virtual\\n override(UniV3CheckCLRSOracle, 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(UniV3CheckCLRSOracle, 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(UniV3CheckCLRSOracle, FluidOracleL2)\\n returns (uint256 exchangeRate_)\\n {\\n return getExchangeRateOperate();\\n }\\n}\\n\",\"keccak256\":\"0xb756dfb0ea90582d650436738be464c09ee743388ac3e79ca5d4515311c8b8dd\",\"license\":\"BUSL-1.1\"}},\"version\":1}", "bytecode": "0x61076060405261dead6103208190526103c0523480156200001f57600080fd5b5060405162004ce938038062004ce9833981016040819052620000429162000f81565b8382828282806080015181602001518260400151818b600001518c602001518d604001518160006001600160a01b031686600001516001600160a01b0316146200008d5785620000b9565b60405180606001604052806103c0516001600160a01b0316815260200160001515815260200160018152505b82516001600160a01b031615620000d15782620000fd565b6040518060600160405280610320516001600160a01b0316815260200160001515815260200160018152505b8a600001518c8e806000806101000a8154816001600160a01b0302191690836001600160a01b03160217905550506020815111806200013b57508051155b15620001635760405163c82fc46560e01b815261ea6a60048201526024015b60405180910390fd5b6020015160805280516001600160a01b0316620001985760405163c82fc46560e01b815261f23160048201526024016200015a565b60608101516020810151905163ffffffff9182169116111580620001d857506060810151604081015163ffffffff16906001602002015163ffffffff1611155b806200020057506060818101519081015163ffffffff16906002602002015163ffffffff1611155b806200022857506060810151608081015163ffffffff16906003602002015163ffffffff1611155b156200024c5760405163c82fc46560e01b815261f23260048201526024016200015a565b6040810151516127101115806200026d575060408101518051602090910151115b806200028457506040818101516020810151910151115b15620002a85760405163c82fc46560e01b815261f23360048201526024016200015a565b606081810180515163ffffffff90811661014052815160209081015182166101605282516040015182166101805282519093015181166101a052815160800151166101c052519081015190516200030091906200108a565b63ffffffff166101e052606081015160408101516020909101516200032691906200108a565b63ffffffff1661020052606081810151908101516040909101516200034c91906200108a565b63ffffffff166102205260608181015160808101519101516200037091906200108a565b63ffffffff1661024052604081810180515160e0528051602090810151610100529051909101516101205281516001600160a01b031660a052810151151560c052620003bf601b600a620011b0565b61026052620003d1601b6002620011c5565b620003de90600a620011b0565b610280525080516001600160a01b03161580620003fd57506040810151155b15620004215760405163c82fc46560e01b815261fa0160048201526024016200015a565b80516001600160a01b039081166102a052602082015115156102c0526103205182518216911614620004725760408101516200045f90601b620011df565b6200046c90600a620011b0565b62000475565b60015b6102e0526103205181516001600160a01b03908116911614620004b7576040810151620004a490601b620011f5565b620004b190600a620011b0565b620004ba565b60015b610300525080516001600160a01b03161580620004d957506040810151155b15620004fd5760405163c82fc46560e01b815261fa0160048201526024016200015a565b80516001600160a01b039081166103405260208201511515610360526103c051825182169116146200054e5760408101516200053b90601b620011df565b6200054890600a620011b0565b62000551565b60015b610380526103c05181516001600160a01b03908116911614620005935760408101516200058090601b620011f5565b6200058d90600a620011b0565b62000596565b60015b6103a052508051600160ff9091161080620005b857506003816000015160ff16115b80620005e157506020810151516001600160a01b03161580620005e15750602081015160400151155b806200061c57506001816000015160ff161180156200061c57506040810151516001600160a01b031615806200061c57506040808201510151155b806200065857506002816000015160ff161180156200065857506060810151516001600160a01b03161580620006585750606081015160400151155b156200067c5760405163c82fc46560e01b815261ee4960048201526024016200015a565b60208082018051516001600160a01b039081166103e05260408085018051518316610400526060860180515190931661042052835185015115156104405251840151151561046052905190920151151561048052510151620006e090601b620011df565b620006ed90600a620011b0565b6104a0526020810151604001516200070790601b620011f5565b6200071490600a620011b0565b6104c0528051600160ff909116116200072f57600162000751565b60408082015101516200074490601b620011df565b6200075190600a620011b0565b6104e0528051600160ff909116116200076c5760016200078e565b60408082015101516200078190601b620011f5565b6200078e90600a620011b0565b610500528051600260ff90911611620007a9576001620007cc565b606081015160400151620007bf90601b620011df565b620007cc90600a620011b0565b610520528051600260ff90911611620007e75760016200080a565b606081015160400151620007fd90601b620011f5565b6200080a90600a620011b0565b6105405250600160ff8416108062000825575060038360ff16115b15620008495760405163c82fc46560e01b815261fde960048201526024016200015a565b505060ff9081166105605281516001911610806200086e57506003816000015160ff16115b806200089757506020810151516001600160a01b03161580620008975750602081015160400151155b80620008d257506001816000015160ff16118015620008d257506040810151516001600160a01b03161580620008d257506040808201510151155b806200090e57506002816000015160ff161180156200090e57506060810151516001600160a01b031615806200090e5750606081015160400151155b15620009325760405163c82fc46560e01b815261ee4960048201526024016200015a565b60208082018051516001600160a01b0390811661058052604080850180515183166105a052606086018051519093166105c052835185015115156105e052518401511515610600529051909201511515610620525101516200099690601b620011df565b620009a390600a620011b0565b61064052602081015160400151620009bd90601b620011f5565b620009ca90600a620011b0565b610660528051600160ff90911611620009e557600162000a07565b6040808201510151620009fa90601b620011df565b62000a0790600a620011b0565b610680528051600160ff9091161162000a2257600162000a44565b604080820151015162000a3790601b620011f5565b62000a4490600a620011b0565b6106a0528051600260ff9091161162000a5f57600162000a82565b60608101516040015162000a7590601b620011df565b62000a8290600a620011b0565b6106c0528051600260ff9091161162000a9d57600162000ac0565b60608101516040015162000ab390601b620011f5565b62000ac090600a620011b0565b6106e05250600160ff8416108062000adb575060038360ff16115b1562000aff5760405163c82fc46560e01b815261fde960048201526024016200015a565b505060ff90811661070052606082015160019116108062000b2757506003816060015160ff16115b8062000b3857506127108160a00151115b8062000b5e5750806080015160ff16600114801562000b5e5750806060015160ff166003145b1562000b825760405163c82fc46560e01b815261ea6260048201526024016200015a565b60a0810151610720526060015160ff1661074052506200120b9650505050505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b038111828210171562000be05762000be062000ba5565b60405290565b604051608081016001600160401b038111828210171562000be05762000be062000ba5565b60405160c081016001600160401b038111828210171562000be05762000be062000ba5565b604051601f8201601f191681016001600160401b038111828210171562000c5b5762000c5b62000ba5565b604052919050565b805160ff8116811462000c7557600080fd5b919050565b6001600160a01b038116811462000c9057600080fd5b50565b8051801515811462000c7557600080fd5b60006060828403121562000cb757600080fd5b62000cc162000bbb565b9050815162000cd08162000c7a565b815262000ce06020830162000c93565b60208201526040820151604082015292915050565b6000610140828403121562000d0957600080fd5b62000d1362000be6565b905062000d208262000c63565b815262000d31836020840162000ca4565b602082015262000d45836080840162000ca4565b604082015262000d598360e0840162000ca4565b606082015292915050565b60006101c0828403121562000d7857600080fd5b62000d8262000bbb565b905062000d8f8262000c63565b815262000da0836020840162000cf5565b602082015262000db583610160840162000ca4565b604082015292915050565b600082601f83011262000dd257600080fd5b60405160a081016001600160401b038111828210171562000df75762000df762000ba5565b6040528060a084018581111562000e0d57600080fd5b845b8181101562000e3d57805163ffffffff8116811462000e2e5760008081fd5b83526020928301920162000e0f565b509195945050505050565b600081830361034081121562000e5d57600080fd5b62000e6762000c0b565b91506101408082121562000e7a57600080fd5b62000e8462000be6565b9150835162000e938162000c7a565b8252602062000ea485820162000c93565b8184015285605f86011262000eb857600080fd5b62000ec262000bbb565b8060a087018881111562000ed557600080fd5b604088015b8181101562000ef3578051845292840192840162000eda565b5081604087015262000f06898262000dc0565b606087015250505082845262000f1f8683870162000cf5565b8185015250505062000f3683610280840162000ca4565b604082015262000f4a6102e0830162000c63565b606082015262000f5e610300830162000c63565b608082015261032082015160a082015292915050565b805162000c758162000c7a565b600080600080610540858703121562000f9957600080fd5b84516001600160401b038082111562000fb157600080fd5b818701915087601f83011262000fc657600080fd5b81518181111562000fdb5762000fdb62000ba5565b6020915062000ff3601f8201601f1916830162000c30565b81815289838386010111156200100857600080fd5b60005b82811015620010285784810184015182820185015283016200100b565b5060008383830101528097505050620010448882890162000d64565b9450505062001058866101e0870162000e48565b915062001069610520860162000f74565b905092959194509250565b634e487b7160e01b600052601160045260246000fd5b63ffffffff828116828216039080821115620010aa57620010aa62001074565b5092915050565b600181815b80851115620010f2578160001904821115620010d657620010d662001074565b80851615620010e457918102915b93841c9390800290620010b6565b509250929050565b6000826200110b57506001620011aa565b816200111a57506000620011aa565b81600181146200113357600281146200113e576200115e565b6001915050620011aa565b60ff84111562001152576200115262001074565b50506001821b620011aa565b5060208310610133831016604e8410600b841016171562001183575081810a620011aa565b6200118f8383620010b1565b8060001904821115620011a657620011a662001074565b0290505b92915050565b6000620011be8383620010fa565b9392505050565b8082028115828204841417620011aa57620011aa62001074565b81810381811115620011aa57620011aa62001074565b80820180821115620011aa57620011aa62001074565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e05161030051610320516103405161036051610380516103a0516103c0516103e05161040051610420516104405161046051610480516104a0516104c0516104e05161050051610520516105405161056051610580516105a0516105c0516105e05161060051610620516106405161066051610680516106a0516106c0516106e05161070051610720516107405161365962001690600039600081816101e7015281816128180152818161288e01528181612a0901528181612a9a01528181612b040152612bd60152600081816101c2015281816129ad01528181612b520152612c1001526000818161020f015281816129de01528181612a6f01528181612acb01528181612e2001528181612e590152612e8c01526000818161066f01526113e801526000818161064e01526113c701526000818161057d01526112f101526000818161055c01526112d0015260008181610493015261120e01526000818161047201526111ed0152600081816105cc0152818161062d01526113a60152600081816104da0152818161053b01526112af01526000818161040c0152818161045101526111cc0152600081816105ab0152818161060c0152818161133501526113850152600081816104b90152818161051a0152818161123e015261128e0152600081816103eb0152818161043001526111ab01526000818160e001528181611607015261164001526000818161104c015261219401526000818161102b0152612173015260008181610f5a015261209d015260008181610f39015261207c015260008181610e700152611fba015260008181610e4f0152611f99015260008181610fa90152818161100a0152612152015260008181610eb701528181610f18015261205b015260008181610de901528181610e2e0152611f78015260008181610f8801528181610fe9015281816120e10152612131015260008181610e9601528181610ef701528181611fea015261203a015260008181610dc801528181610e0d0152611f57015260006106c2015260006115b4015260006115dd015260008181610769015261158a0152600081816106f90152818161074601526114db015260006103060152600061114d0152600061117c0152600081816103ad015261112301526000818161033d0152818161038a0152611074015260006122d40152600061228801526000818161199d01526119e001526000611bb501526000611b1c01526000611a8301526000818161097d015261186a01526000818161092f01526118440152600081816108e1015261181e01526000818161089301526117f801526000818161084501526117d2015260008181610a650152611bd6015260008181610a250152611b3d0152600081816109e50152611aa4015260008181610ac6015281816117550152611c20015260008181610aa5015281816116be01526118ad015260008181610b1c0152610be101526136596000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c8063a6ac913411610081578063e6aa216c1161005b578063e6aa216c146102ef578063f3190c8914610246578063f5be67a5146102f757600080fd5b8063a6ac91341461025c578063abd5f95d14610276578063dc4595121461028b57600080fd5b80637cebd7c5116100b25780637cebd7c5146101bc57806388c352091461023e5780638e7bfbc01461024657600080fd5b80632faeaacb146100d957806331b037a21461010f5780637557ca4114610149575b600080fd5b60405160ff7f00000000000000000000000000000000000000000000000000000000000000001681526020015b60405180910390f35b6101176102ff565b6040805193845273ffffffffffffffffffffffffffffffffffffffff9092166020840152151590820152606001610106565b6101516103d2565b604080519a8b5273ffffffffffffffffffffffffffffffffffffffff998a1660208c0152971515978a01979097526060890195909552928616608088015290151560a087015260c086015290921660e084015290151561010083015261012082015261014001610106565b604080517f0000000000000000000000000000000000000000000000000000000000000000815260ff7f0000000000000000000000000000000000000000000000000000000000000000811660208301527f00000000000000000000000000000000000000000000000000000000000000001691810191909152606001610106565b6101176106bb565b61024e61078e565b604051908152602001610106565b61026461080d565b60405161010696959493929190612f6e565b61027e610b0a565b6040516101069190613023565b610293610c6f565b6040805173ffffffffffffffffffffffffffffffffffffffff909916895260208901979097529415159587019590955260608601929092526080850152151560a084015260c0830191909152151560e082015261010001610106565b61024e610da5565b610151610daf565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146103845761037f611070565b610387565b60005b937f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b6000806000806000806000806000806103e96111a4565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006104b77f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff8216156105a6576105a17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b6105a9565b60005b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610698576106937f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b61069b565b60005b995099509950995099509950995099509950995090919293949596979899565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146107405761073b6114d7565b610743565b60005b937f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b6000610798611602565b50905060008190036107df576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261eb8d60048201526024015b60405180910390fd5b6107eb601b600a6131c3565b816107f46116a7565b6107fe91906131cf565b6108089190613215565b905090565b60008060608082806005604051908082528060200260200182016040528015610840578160200160208202803683370190505b5093507f00000000000000000000000000000000000000000000000000000000000000008460008151811061087757610877613258565b602002602001019063ffffffff16908163ffffffff16815250507f0000000000000000000000000000000000000000000000000000000000000000846001815181106108c5576108c5613258565b602002602001019063ffffffff16908163ffffffff16815250507f00000000000000000000000000000000000000000000000000000000000000008460028151811061091357610913613258565b602002602001019063ffffffff16908163ffffffff16815250507f00000000000000000000000000000000000000000000000000000000000000008460038151811061096157610961613258565b602002602001019063ffffffff16908163ffffffff16815250507f0000000000000000000000000000000000000000000000000000000000000000846004815181106109af576109af613258565b63ffffffff92909216602092830291909101820152604080516003808252608082019092529182016060803683370190505092507f000000000000000000000000000000000000000000000000000000000000000083600081518110610a1757610a17613258565b6020026020010181815250507f000000000000000000000000000000000000000000000000000000000000000083600181518110610a5757610a57613258565b6020026020010181815250507f000000000000000000000000000000000000000000000000000000000000000083600281518110610a9757610a97613258565b6020026020010181815250507f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008585610aef6116b9565b610af7611797565b949b939a50919850965094509092509050565b606060005b602081108015610b7557507f00000000000000000000000000000000000000000000000000000000000000008160208110610b4c57610b4c613258565b1a60f81b7fff000000000000000000000000000000000000000000000000000000000000001615155b15610b8c5780610b8481613287565b915050610b0f565b60008167ffffffffffffffff811115610ba757610ba7613229565b6040519080825280601f01601f191660200182016040528015610bd1576020820181803683370190505b50905060005b82811015610c68577f00000000000000000000000000000000000000000000000000000000000000008160208110610c1157610c11613258565b1a60f81b828281518110610c2757610c27613258565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080610c6081613287565b915050610bd7565b5092915050565b6000806000806000806000806000610c85611c58565b91985090965090508615610ca957610c9d8187611e05565b91965094509250610d5f565b610a8c945060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4091906132de565b505050509050610d5b816001610d56919061332e565b611e6f565b9350505b60005473ffffffffffffffffffffffffffffffffffffffff16610a8c8888888888848015610d8a57508a5b98509850985098509850985098509850509091929394959697565b600061080861078e565b600080600080600080600080600080610dc6611f50565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610e947f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610f8357610f7e7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b610f86565b60005b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610698576106937f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611117575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261111491810190613351565b60015b6111215750600090565b7f00000000000000000000000000000000000000000000000000000000000000001561117757611171817f0000000000000000000000000000000000000000000000000000000000000000613215565b91505090565b6111717f0000000000000000000000000000000000000000000000000000000000000000826131cf565b90565b60006112327f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b905080158061127557507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b1561127d5790565b611289601b600a6131c3565b6113157f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b61131f90836131cf565b6113299190613215565b905080158061136c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b156113745790565b611380601b600a6131c3565b61140c7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b6107fe90836131cf565b60008473ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa92505050801561149d575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261149a918101906132de565b60015b6114a9575060006114cf565b88156114c5576114b98488613215565b955050505050506114cf565b6114b988856131cf565b949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561157e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261157b91810190613351565b60015b6115885750600090565b7f0000000000000000000000000000000000000000000000000000000000000000156115d857611171817f0000000000000000000000000000000000000000000000000000000000000000613215565b6111717f0000000000000000000000000000000000000000000000000000000000000000826131cf565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff1660010361163e57611638611f50565b91509091565b7f000000000000000000000000000000000000000000000000000000000000000060ff1660020361168a57611671611f50565b91508160000361168657506001611638611070565b9091565b611692611070565b91508160000361168657506001611638611f50565b60006116b16121b8565b610808612257565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174b919061338c565b50505050505090507f00000000000000000000000000000000000000000000000000000000000000006117865761178181612261565b611171565b61117161179282612261565b6122cc565b6040517f883bdbfd000000000000000000000000000000000000000000000000000000006020808301919091526024820152600560448201527f000000000000000000000000000000000000000000000000000000000000000060648201527f000000000000000000000000000000000000000000000000000000000000000060848201527f000000000000000000000000000000000000000000000000000000000000000060a48201527f000000000000000000000000000000000000000000000000000000000000000060c48201527f000000000000000000000000000000000000000000000000000000000000000060e482015260009081906101040160405160208183030381529060405290506000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16836040516118f0919061343f565b600060405180830381855afa9150503d806000811461192b576040519150601f19603f3d011682016040523d82523d6000602084013e611930565b606091505b509150915081611944576000935050505090565b60008180602001905181019061195a919061346d565b90506000808260038151811061197257611972613258565b60200260200101518360036001018151811061199057611990613258565b60200260200101510390507f00000000000000000000000000000000000000000000000000000000000000008160060b816119cd576119cd6131e6565b05915060008160060b128015611a1457507f00000000000000000000000000000000000000000000000000000000000000008160060b81611a1057611a106131e6565b0715155b15611a3f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909101905b50611ac88160020b83600081518110611a5a57611a5a613258565b602002602001015184600181518110611a7557611a75613258565b60200260200101510360060b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006122f8565b15611ad95760009550505050505090565b611b618160020b83600181518110611af357611af3613258565b602002602001015184600281518110611b0e57611b0e613258565b60200260200101510360060b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006122f8565b15611b725760009550505050505090565b611bfa8160020b83600281518110611b8c57611b8c613258565b602002602001015184600381518110611ba757611ba7613258565b60200260200101510360060b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006122f8565b15611c0b5760009550505050505090565b611c1c611c178261237f565b612261565b95507f000000000000000000000000000000000000000000000000000000000000000015611c5057611c4d866122cc565b95505b505050505090565b60008060008060008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015611ccc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf091906132de565b505092509250925081600014611d10575060009586955085945092505050565b600195508294508093506000841115611dfd575b60005473ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5611d4d600186613550565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815269ffffffffffffffffffff909116600482015260240160a060405180830381865afa158015611dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd091906132de565b509295509093509150506000829003611dea578294508093505b81158015611df85750600081115b611d24575b505050909192565b6000808080611e148542613573565b9050841580611e245750610a8c81115b15611e3c57610a8c6001600093509350935050611e68565b611e4586611e6f565b9150611e518286613573565b9350610a8c841115611e6357610a8c93505b831091505b9250925092565b60008181805b60005473ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5611e9e600186613550565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815269ffffffffffffffffffff909116600482015260240160a060405180830381865afa158015611efd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2191906132de565b509295509093509150508115611f35578093505b8115801590611f445750600081115b611e7557505050919050565b6000611fde7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b905080158061202157507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b156120295790565b612035601b600a6131c3565b6120c17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b6120cb90836131cf565b6120d59190613215565b905080158061211857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b156121205790565b61212c601b600a6131c3565b61140c7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b60008060006121c5611c58565b92509250925082612206576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6060048201526024016107d6565b60006122128383611e05565b5091505080612251576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6060048201526024016107d6565b50505050565b6000610808612814565b60006122c661228673ffffffffffffffffffffffffffffffffffffffff8416806131cf565b7f00000000000000000000000000000000000000000000000000000000000000007801000000000000000000000000000000000000000000000000612c47565b92915050565b60006122c6827f0000000000000000000000000000000000000000000000000000000000000000613215565b60008083858161230a5761230a6131e6565b05905060008512801561232b5750838581612327576123276131e6565b0715155b15612353577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b828101861380612364575082810386125b156123735760019150506114cf565b50600095945050505050565b60008060008360020b12612396578260020b6123a3565b8260020b6123a390613586565b90506123ce7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff276186135be565b60020b81111561243a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600160248201527f540000000000000000000000000000000000000000000000000000000000000060448201526064016107d6565b60008160011660000361245e57700100000000000000000000000000000000612470565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff16905060028216156124af5760806124aa826ffff97272373d413259a46990580e213a6131cf565b901c90505b60048216156124d95760806124d4826ffff2e50f5f656932ef12357cf3c7fdcc6131cf565b901c90505b60088216156125035760806124fe826fffe5caca7e10e4e61c3624eaa0941cd06131cf565b901c90505b601082161561252d576080612528826fffcb9843d60f6159c9db58835c9266446131cf565b901c90505b6020821615612557576080612552826fff973b41fa98c081472e6896dfb254c06131cf565b901c90505b604082161561258157608061257c826fff2ea16466c96a3843ec78b326b528616131cf565b901c90505b60808216156125ab5760806125a6826ffe5dee046a99a2a811c461f1969c30536131cf565b901c90505b6101008216156125d65760806125d1826ffcbe86c7900a88aedcffc83b479aa3a46131cf565b901c90505b6102008216156126015760806125fc826ff987a7253ac413176f2b074cf7815e546131cf565b901c90505b61040082161561262c576080612627826ff3392b0822b70005940c7a398e4b70f36131cf565b901c90505b610800821615612657576080612652826fe7159475a2c29b7443b29c7fa6e889d96131cf565b901c90505b61100082161561268257608061267d826fd097f3bdfd2022b8845ad8f792aa58256131cf565b901c90505b6120008216156126ad5760806126a8826fa9f746462d870fdf8a65dc1f90e061e56131cf565b901c90505b6140008216156126d85760806126d3826f70d869a156d2a1b890bb3df62baf32f76131cf565b901c90505b6180008216156127035760806126fe826f31be135f97d08fd981231505542fcfa66131cf565b901c90505b6201000082161561272f57608061272a826f09aa508b5b7a84e1c677de54f3e99bc96131cf565b901c90505b6202000082161561275a576080612755826e5d6af8dedb81196699c329225ee6046131cf565b901c90505b6204000082161561278457608061277f826d2216e584f5fa1ea926041bedfe986131cf565b901c90505b620800008216156127ac5760806127a7826b048a170391f7dc42444e8fa26131cf565b901c90505b60008460020b13156127e5576127e2817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613215565b90505b6127f4640100000000826135fc565b15612800576001612803565b60005b6114cf9060ff16602083901c613610565b60007f000000000000000000000000000000000000000000000000000000000000000060ff1660010361288957612849611797565b9050806000036111a1576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6360048201526024016107d6565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff16600203612936576128bf611797565b925082600003612916576128d1612e09565b925082600003612911576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6360048201526024016107d6565b505090565b61291e612e54565b9092509050600082900361293157505090565b6129a6565b61293e612e54565b909350905061294b611797565b9150826000036129995781600003612993576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6360048201526024016107d6565b50919050565b816000036129a657505090565b6129d183837f0000000000000000000000000000000000000000000000000000000000000000612eef565b15612911578015612a6d577f000000000000000000000000000000000000000000000000000000000000000060ff16600303612a37577f000000000000000000000000000000000000000000000000000000000000000060ff1660021461299357505090565b6040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6160048201526024016107d6565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600103612ac9577f000000000000000000000000000000000000000000000000000000000000000060ff166002036129115750919050565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600203612b8a576000612afe6114d7565b905060007f000000000000000000000000000000000000000000000000000000000000000060ff16600203612b365750918290612b3b565b509283905b81600003612b4b57949350505050565b612b7685857f0000000000000000000000000000000000000000000000000000000000000000612eef565b15612b8357949350505050565b5050505090565b6000612b946111a4565b905080600003612bd4576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6160048201526024016107d6565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600303612c06579392505050565b809250612c3484847f0000000000000000000000000000000000000000000000000000000000000000612eef565b15612c4157509092915050565b50505090565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870985870292508281108382030391505080600003612c9e5760008411612c9357600080fd5b508290049050612e02565b808411612caa57600080fd5b600084868809808403938111909203919050600085612ce9817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613573565b612cf4906001613610565b16958690049593849004936000819003046001019050612d1481846131cf565b909317926000612d258760036131cf565b6002189050612d3481886131cf565b612d3f906002613573565b612d4990826131cf565b9050612d5581886131cf565b612d60906002613573565b612d6a90826131cf565b9050612d7681886131cf565b612d81906002613573565b612d8b90826131cf565b9050612d9781886131cf565b612da2906002613573565b612dac90826131cf565b9050612db881886131cf565b612dc3906002613573565b612dcd90826131cf565b9050612dd981886131cf565b612de4906002613573565b612dee90826131cf565b9050612dfa81866131cf565b955050505050505b9392505050565b6000612e136111a4565b905080158015612e4757507f000000000000000000000000000000000000000000000000000000000000000060ff16600114155b156111a1576108086114d7565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff16600103612e8a576116386111a4565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600203612ed257612ebd6111a4565b915081600003611686575060016116386114d7565b612eda6114d7565b915081600003611686575060016116386111a4565b600080612710612eff84866131cf565b612f099190613215565b9050612f158185613610565b851180612f2a5750612f278185613573565b85105b95945050505050565b600081518084526020808501945080840160005b83811015612f6357815187529582019590820190600101612f47565b509495945050505050565b600060c0820173ffffffffffffffffffffffffffffffffffffffff8916835260208815158185015260c0604085015281885180845260e086019150828a01935060005b81811015612fd357845163ffffffff1683529383019391830191600101612fb1565b50508481036060860152612fe78189612f33565b60808601979097525050505060a00152949350505050565b60005b8381101561301a578181015183820152602001613002565b50506000910152565b6020815260008251806020840152613042816040850160208701612fff565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600181815b808511156130fc57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156130e2576130e2613074565b808516156130ef57918102915b93841c93908002906130a8565b509250929050565b600082613113575060016122c6565b81613120575060006122c6565b816001811461313657600281146131405761315c565b60019150506122c6565b60ff84111561315157613151613074565b50506001821b6122c6565b5060208310610133831016604e8410600b841016171561317f575081810a6122c6565b61318983836130a3565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156131bb576131bb613074565b029392505050565b6000612e028383613104565b80820281158282048414176122c6576122c6613074565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613224576132246131e6565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036132b8576132b8613074565b5060010190565b805169ffffffffffffffffffff811681146132d957600080fd5b919050565b600080600080600060a086880312156132f657600080fd5b6132ff866132bf565b9450602086015193506040860151925060608601519150613322608087016132bf565b90509295509295909350565b69ffffffffffffffffffff818116838216019080821115610c6857610c68613074565b60006020828403121561336357600080fd5b5051919050565b805161ffff811681146132d957600080fd5b805180151581146132d957600080fd5b600080600080600080600060e0888a0312156133a757600080fd5b875173ffffffffffffffffffffffffffffffffffffffff811681146133cb57600080fd5b8097505060208801518060020b81146133e357600080fd5b95506133f16040890161336a565b94506133ff6060890161336a565b935061340d6080890161336a565b925060a088015160ff8116811461342357600080fd5b915061343160c0890161337c565b905092959891949750929550565b60008251613451818460208701612fff565b9190910192915050565b8051600681900b81146132d957600080fd5b6000602080838503121561348057600080fd5b825167ffffffffffffffff8082111561349857600080fd5b818501915085601f8301126134ac57600080fd5b8151818111156134be576134be613229565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561350157613501613229565b60405291825284820192508381018501918883111561351f57600080fd5b938501935b82851015613544576135358561345b565b84529385019392850192613524565b98975050505050505050565b69ffffffffffffffffffff828116828216039080821115610c6857610c68613074565b818103818111156122c6576122c6613074565b60007f800000000000000000000000000000000000000000000000000000000000000082036135b7576135b7613074565b5060000390565b60008160020b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000081036135f3576135f3613074565b60000392915050565b60008261360b5761360b6131e6565b500690565b808201808211156122c6576122c661307456fea2646970667358221220b41b709cc8ce266b7ceb311c12953bb29c59ed8e735f49b4156df7e9795090e064736f6c63430008150033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c8063a6ac913411610081578063e6aa216c1161005b578063e6aa216c146102ef578063f3190c8914610246578063f5be67a5146102f757600080fd5b8063a6ac91341461025c578063abd5f95d14610276578063dc4595121461028b57600080fd5b80637cebd7c5116100b25780637cebd7c5146101bc57806388c352091461023e5780638e7bfbc01461024657600080fd5b80632faeaacb146100d957806331b037a21461010f5780637557ca4114610149575b600080fd5b60405160ff7f00000000000000000000000000000000000000000000000000000000000000001681526020015b60405180910390f35b6101176102ff565b6040805193845273ffffffffffffffffffffffffffffffffffffffff9092166020840152151590820152606001610106565b6101516103d2565b604080519a8b5273ffffffffffffffffffffffffffffffffffffffff998a1660208c0152971515978a01979097526060890195909552928616608088015290151560a087015260c086015290921660e084015290151561010083015261012082015261014001610106565b604080517f0000000000000000000000000000000000000000000000000000000000000000815260ff7f0000000000000000000000000000000000000000000000000000000000000000811660208301527f00000000000000000000000000000000000000000000000000000000000000001691810191909152606001610106565b6101176106bb565b61024e61078e565b604051908152602001610106565b61026461080d565b60405161010696959493929190612f6e565b61027e610b0a565b6040516101069190613023565b610293610c6f565b6040805173ffffffffffffffffffffffffffffffffffffffff909916895260208901979097529415159587019590955260608601929092526080850152151560a084015260c0830191909152151560e082015261010001610106565b61024e610da5565b610151610daf565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146103845761037f611070565b610387565b60005b937f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b6000806000806000806000806000806103e96111a4565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006104b77f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff8216156105a6576105a17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b6105a9565b60005b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610698576106937f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b61069b565b60005b995099509950995099509950995099509950995090919293949596979899565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146107405761073b6114d7565b610743565b60005b937f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b6000610798611602565b50905060008190036107df576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261eb8d60048201526024015b60405180910390fd5b6107eb601b600a6131c3565b816107f46116a7565b6107fe91906131cf565b6108089190613215565b905090565b60008060608082806005604051908082528060200260200182016040528015610840578160200160208202803683370190505b5093507f00000000000000000000000000000000000000000000000000000000000000008460008151811061087757610877613258565b602002602001019063ffffffff16908163ffffffff16815250507f0000000000000000000000000000000000000000000000000000000000000000846001815181106108c5576108c5613258565b602002602001019063ffffffff16908163ffffffff16815250507f00000000000000000000000000000000000000000000000000000000000000008460028151811061091357610913613258565b602002602001019063ffffffff16908163ffffffff16815250507f00000000000000000000000000000000000000000000000000000000000000008460038151811061096157610961613258565b602002602001019063ffffffff16908163ffffffff16815250507f0000000000000000000000000000000000000000000000000000000000000000846004815181106109af576109af613258565b63ffffffff92909216602092830291909101820152604080516003808252608082019092529182016060803683370190505092507f000000000000000000000000000000000000000000000000000000000000000083600081518110610a1757610a17613258565b6020026020010181815250507f000000000000000000000000000000000000000000000000000000000000000083600181518110610a5757610a57613258565b6020026020010181815250507f000000000000000000000000000000000000000000000000000000000000000083600281518110610a9757610a97613258565b6020026020010181815250507f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008585610aef6116b9565b610af7611797565b949b939a50919850965094509092509050565b606060005b602081108015610b7557507f00000000000000000000000000000000000000000000000000000000000000008160208110610b4c57610b4c613258565b1a60f81b7fff000000000000000000000000000000000000000000000000000000000000001615155b15610b8c5780610b8481613287565b915050610b0f565b60008167ffffffffffffffff811115610ba757610ba7613229565b6040519080825280601f01601f191660200182016040528015610bd1576020820181803683370190505b50905060005b82811015610c68577f00000000000000000000000000000000000000000000000000000000000000008160208110610c1157610c11613258565b1a60f81b828281518110610c2757610c27613258565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080610c6081613287565b915050610bd7565b5092915050565b6000806000806000806000806000610c85611c58565b91985090965090508615610ca957610c9d8187611e05565b91965094509250610d5f565b610a8c945060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4091906132de565b505050509050610d5b816001610d56919061332e565b611e6f565b9350505b60005473ffffffffffffffffffffffffffffffffffffffff16610a8c8888888888848015610d8a57508a5b98509850985098509850985098509850509091929394959697565b600061080861078e565b600080600080600080600080600080610dc6611f50565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610e947f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610f8357610f7e7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b610f86565b60005b7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff821615610698576106937f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611117575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261111491810190613351565b60015b6111215750600090565b7f00000000000000000000000000000000000000000000000000000000000000001561117757611171817f0000000000000000000000000000000000000000000000000000000000000000613215565b91505090565b6111717f0000000000000000000000000000000000000000000000000000000000000000826131cf565b90565b60006112327f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b905080158061127557507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b1561127d5790565b611289601b600a6131c3565b6113157f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b61131f90836131cf565b6113299190613215565b905080158061136c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b156113745790565b611380601b600a6131c3565b61140c7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b6107fe90836131cf565b60008473ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa92505050801561149d575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261149a918101906132de565b60015b6114a9575060006114cf565b88156114c5576114b98488613215565b955050505050506114cf565b6114b988856131cf565b949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561157e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261157b91810190613351565b60015b6115885750600090565b7f0000000000000000000000000000000000000000000000000000000000000000156115d857611171817f0000000000000000000000000000000000000000000000000000000000000000613215565b6111717f0000000000000000000000000000000000000000000000000000000000000000826131cf565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff1660010361163e57611638611f50565b91509091565b7f000000000000000000000000000000000000000000000000000000000000000060ff1660020361168a57611671611f50565b91508160000361168657506001611638611070565b9091565b611692611070565b91508160000361168657506001611638611f50565b60006116b16121b8565b610808612257565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174b919061338c565b50505050505090507f00000000000000000000000000000000000000000000000000000000000000006117865761178181612261565b611171565b61117161179282612261565b6122cc565b6040517f883bdbfd000000000000000000000000000000000000000000000000000000006020808301919091526024820152600560448201527f000000000000000000000000000000000000000000000000000000000000000060648201527f000000000000000000000000000000000000000000000000000000000000000060848201527f000000000000000000000000000000000000000000000000000000000000000060a48201527f000000000000000000000000000000000000000000000000000000000000000060c48201527f000000000000000000000000000000000000000000000000000000000000000060e482015260009081906101040160405160208183030381529060405290506000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16836040516118f0919061343f565b600060405180830381855afa9150503d806000811461192b576040519150601f19603f3d011682016040523d82523d6000602084013e611930565b606091505b509150915081611944576000935050505090565b60008180602001905181019061195a919061346d565b90506000808260038151811061197257611972613258565b60200260200101518360036001018151811061199057611990613258565b60200260200101510390507f00000000000000000000000000000000000000000000000000000000000000008160060b816119cd576119cd6131e6565b05915060008160060b128015611a1457507f00000000000000000000000000000000000000000000000000000000000000008160060b81611a1057611a106131e6565b0715155b15611a3f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909101905b50611ac88160020b83600081518110611a5a57611a5a613258565b602002602001015184600181518110611a7557611a75613258565b60200260200101510360060b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006122f8565b15611ad95760009550505050505090565b611b618160020b83600181518110611af357611af3613258565b602002602001015184600281518110611b0e57611b0e613258565b60200260200101510360060b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006122f8565b15611b725760009550505050505090565b611bfa8160020b83600281518110611b8c57611b8c613258565b602002602001015184600381518110611ba757611ba7613258565b60200260200101510360060b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006122f8565b15611c0b5760009550505050505090565b611c1c611c178261237f565b612261565b95507f000000000000000000000000000000000000000000000000000000000000000015611c5057611c4d866122cc565b95505b505050505090565b60008060008060008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015611ccc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf091906132de565b505092509250925081600014611d10575060009586955085945092505050565b600195508294508093506000841115611dfd575b60005473ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5611d4d600186613550565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815269ffffffffffffffffffff909116600482015260240160a060405180830381865afa158015611dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd091906132de565b509295509093509150506000829003611dea578294508093505b81158015611df85750600081115b611d24575b505050909192565b6000808080611e148542613573565b9050841580611e245750610a8c81115b15611e3c57610a8c6001600093509350935050611e68565b611e4586611e6f565b9150611e518286613573565b9350610a8c841115611e6357610a8c93505b831091505b9250925092565b60008181805b60005473ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5611e9e600186613550565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815269ffffffffffffffffffff909116600482015260240160a060405180830381865afa158015611efd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2191906132de565b509295509093509150508115611f35578093505b8115801590611f445750600081115b611e7557505050919050565b6000611fde7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b905080158061202157507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b156120295790565b612035601b600a6131c3565b6120c17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b6120cb90836131cf565b6120d59190613215565b905080158061211857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16155b156121205790565b61212c601b600a6131c3565b61140c7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611416565b60008060006121c5611c58565b92509250925082612206576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6060048201526024016107d6565b60006122128383611e05565b5091505080612251576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6060048201526024016107d6565b50505050565b6000610808612814565b60006122c661228673ffffffffffffffffffffffffffffffffffffffff8416806131cf565b7f00000000000000000000000000000000000000000000000000000000000000007801000000000000000000000000000000000000000000000000612c47565b92915050565b60006122c6827f0000000000000000000000000000000000000000000000000000000000000000613215565b60008083858161230a5761230a6131e6565b05905060008512801561232b5750838581612327576123276131e6565b0715155b15612353577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b828101861380612364575082810386125b156123735760019150506114cf565b50600095945050505050565b60008060008360020b12612396578260020b6123a3565b8260020b6123a390613586565b90506123ce7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff276186135be565b60020b81111561243a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600160248201527f540000000000000000000000000000000000000000000000000000000000000060448201526064016107d6565b60008160011660000361245e57700100000000000000000000000000000000612470565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff16905060028216156124af5760806124aa826ffff97272373d413259a46990580e213a6131cf565b901c90505b60048216156124d95760806124d4826ffff2e50f5f656932ef12357cf3c7fdcc6131cf565b901c90505b60088216156125035760806124fe826fffe5caca7e10e4e61c3624eaa0941cd06131cf565b901c90505b601082161561252d576080612528826fffcb9843d60f6159c9db58835c9266446131cf565b901c90505b6020821615612557576080612552826fff973b41fa98c081472e6896dfb254c06131cf565b901c90505b604082161561258157608061257c826fff2ea16466c96a3843ec78b326b528616131cf565b901c90505b60808216156125ab5760806125a6826ffe5dee046a99a2a811c461f1969c30536131cf565b901c90505b6101008216156125d65760806125d1826ffcbe86c7900a88aedcffc83b479aa3a46131cf565b901c90505b6102008216156126015760806125fc826ff987a7253ac413176f2b074cf7815e546131cf565b901c90505b61040082161561262c576080612627826ff3392b0822b70005940c7a398e4b70f36131cf565b901c90505b610800821615612657576080612652826fe7159475a2c29b7443b29c7fa6e889d96131cf565b901c90505b61100082161561268257608061267d826fd097f3bdfd2022b8845ad8f792aa58256131cf565b901c90505b6120008216156126ad5760806126a8826fa9f746462d870fdf8a65dc1f90e061e56131cf565b901c90505b6140008216156126d85760806126d3826f70d869a156d2a1b890bb3df62baf32f76131cf565b901c90505b6180008216156127035760806126fe826f31be135f97d08fd981231505542fcfa66131cf565b901c90505b6201000082161561272f57608061272a826f09aa508b5b7a84e1c677de54f3e99bc96131cf565b901c90505b6202000082161561275a576080612755826e5d6af8dedb81196699c329225ee6046131cf565b901c90505b6204000082161561278457608061277f826d2216e584f5fa1ea926041bedfe986131cf565b901c90505b620800008216156127ac5760806127a7826b048a170391f7dc42444e8fa26131cf565b901c90505b60008460020b13156127e5576127e2817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613215565b90505b6127f4640100000000826135fc565b15612800576001612803565b60005b6114cf9060ff16602083901c613610565b60007f000000000000000000000000000000000000000000000000000000000000000060ff1660010361288957612849611797565b9050806000036111a1576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6360048201526024016107d6565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff16600203612936576128bf611797565b925082600003612916576128d1612e09565b925082600003612911576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6360048201526024016107d6565b505090565b61291e612e54565b9092509050600082900361293157505090565b6129a6565b61293e612e54565b909350905061294b611797565b9150826000036129995781600003612993576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6360048201526024016107d6565b50919050565b816000036129a657505090565b6129d183837f0000000000000000000000000000000000000000000000000000000000000000612eef565b15612911578015612a6d577f000000000000000000000000000000000000000000000000000000000000000060ff16600303612a37577f000000000000000000000000000000000000000000000000000000000000000060ff1660021461299357505090565b6040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6160048201526024016107d6565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600103612ac9577f000000000000000000000000000000000000000000000000000000000000000060ff166002036129115750919050565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600203612b8a576000612afe6114d7565b905060007f000000000000000000000000000000000000000000000000000000000000000060ff16600203612b365750918290612b3b565b509283905b81600003612b4b57949350505050565b612b7685857f0000000000000000000000000000000000000000000000000000000000000000612eef565b15612b8357949350505050565b5050505090565b6000612b946111a4565b905080600003612bd4576040517fc82fc46500000000000000000000000000000000000000000000000000000000815261ea6160048201526024016107d6565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600303612c06579392505050565b809250612c3484847f0000000000000000000000000000000000000000000000000000000000000000612eef565b15612c4157509092915050565b50505090565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870985870292508281108382030391505080600003612c9e5760008411612c9357600080fd5b508290049050612e02565b808411612caa57600080fd5b600084868809808403938111909203919050600085612ce9817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613573565b612cf4906001613610565b16958690049593849004936000819003046001019050612d1481846131cf565b909317926000612d258760036131cf565b6002189050612d3481886131cf565b612d3f906002613573565b612d4990826131cf565b9050612d5581886131cf565b612d60906002613573565b612d6a90826131cf565b9050612d7681886131cf565b612d81906002613573565b612d8b90826131cf565b9050612d9781886131cf565b612da2906002613573565b612dac90826131cf565b9050612db881886131cf565b612dc3906002613573565b612dcd90826131cf565b9050612dd981886131cf565b612de4906002613573565b612dee90826131cf565b9050612dfa81866131cf565b955050505050505b9392505050565b6000612e136111a4565b905080158015612e4757507f000000000000000000000000000000000000000000000000000000000000000060ff16600114155b156111a1576108086114d7565b6000807f000000000000000000000000000000000000000000000000000000000000000060ff16600103612e8a576116386111a4565b7f000000000000000000000000000000000000000000000000000000000000000060ff16600203612ed257612ebd6111a4565b915081600003611686575060016116386114d7565b612eda6114d7565b915081600003611686575060016116386111a4565b600080612710612eff84866131cf565b612f099190613215565b9050612f158185613610565b851180612f2a5750612f278185613573565b85105b95945050505050565b600081518084526020808501945080840160005b83811015612f6357815187529582019590820190600101612f47565b509495945050505050565b600060c0820173ffffffffffffffffffffffffffffffffffffffff8916835260208815158185015260c0604085015281885180845260e086019150828a01935060005b81811015612fd357845163ffffffff1683529383019391830191600101612fb1565b50508481036060860152612fe78189612f33565b60808601979097525050505060a00152949350505050565b60005b8381101561301a578181015183820152602001613002565b50506000910152565b6020815260008251806020840152613042816040850160208701612fff565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600181815b808511156130fc57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156130e2576130e2613074565b808516156130ef57918102915b93841c93908002906130a8565b509250929050565b600082613113575060016122c6565b81613120575060006122c6565b816001811461313657600281146131405761315c565b60019150506122c6565b60ff84111561315157613151613074565b50506001821b6122c6565b5060208310610133831016604e8410600b841016171561317f575081810a6122c6565b61318983836130a3565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156131bb576131bb613074565b029392505050565b6000612e028383613104565b80820281158282048414176122c6576122c6613074565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613224576132246131e6565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036132b8576132b8613074565b5060010190565b805169ffffffffffffffffffff811681146132d957600080fd5b919050565b600080600080600060a086880312156132f657600080fd5b6132ff866132bf565b9450602086015193506040860151925060608601519150613322608087016132bf565b90509295509295909350565b69ffffffffffffffffffff818116838216019080821115610c6857610c68613074565b60006020828403121561336357600080fd5b5051919050565b805161ffff811681146132d957600080fd5b805180151581146132d957600080fd5b600080600080600080600060e0888a0312156133a757600080fd5b875173ffffffffffffffffffffffffffffffffffffffff811681146133cb57600080fd5b8097505060208801518060020b81146133e357600080fd5b95506133f16040890161336a565b94506133ff6060890161336a565b935061340d6080890161336a565b925060a088015160ff8116811461342357600080fd5b915061343160c0890161337c565b905092959891949750929550565b60008251613451818460208701612fff565b9190910192915050565b8051600681900b81146132d957600080fd5b6000602080838503121561348057600080fd5b825167ffffffffffffffff8082111561349857600080fd5b818501915085601f8301126134ac57600080fd5b8151818111156134be576134be613229565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561350157613501613229565b60405291825284820192508381018501918883111561351f57600080fd5b938501935b82851015613544576135358561345b565b84529385019392850192613524565b98975050505050505050565b69ffffffffffffffffffff828116828216039080821115610c6857610c68613074565b818103818111156122c6576122c6613074565b60007f800000000000000000000000000000000000000000000000000000000000000082036135b7576135b7613074565b5060000390565b60008160020b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000081036135f3576135f3613074565b60000392915050565b60008261360b5761360b6131e6565b500690565b808201808211156122c6576122c661307456fea2646970667358221220b41b709cc8ce266b7ceb311c12953bb29c59ed8e735f49b4156df7e9795090e064736f6c63430008150033", "devdoc": { "kind": "dev", "methods": { "constructor": { "params": { "cLRS2Params_": "CLRS2ConstructorParams for wstETH <> CLRS Token2 conversion", "infoName_": "Oracle identify helper name.", "sequencerUptimeFeed_": "L2 sequencer uptime Chainlink feed", "uniV3CheckCLRSParams_": "UniV3CheckCLRSOracle constructor params" } }, "getExchangeRate()": { "details": "Deprecated. Use `getExchangeRateOperate()` and `getExchangeRateLiquidate()` instead. Only implemented for backwards compatibility." } }, "title": "CLRSOracle combined with a uniV3CheckCLRSOracle.", "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" }, "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": "constructs a CLRS2UniV3CheckCLRSOracleL2 with all inherited contracts" }, "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" }, "uniV3CheckOracleData()": { "notice": "returns all oracle related data as utility for easy off-chain / block explorer use in a single view method" }, "uniV3OracleData()": { "notice": "returns all UniV3 oracle related data as utility for easy off-chain use / block explorer in a single view method" } }, "notice": "Gets the exchange rate between the underlying asset and the peg asset by using: 1. rate from Chainlink price feeds (or Redstone as fallback). 2. result from 1. combined with a uniV3CheckCLRSOracle to get from someToken <> someToken2 e.g. when going from wstETH to USDC: 1. wstETH -> stETH -> ETH Chainlink feed. 2. ETH -> USDC via UniV3 ETH <> USDC pool checked against ETH -> USDC Chainlink feed.", "version": 1 }, "storageLayout": { "storage": [ { "astId": 21741, "contract": "contracts/oracle/oraclesL2/cLRS2UniV3CheckCLRSOracleL2.sol:CLRS2UniV3CheckCLRSOracleL2", "label": "_SEQUENCER_ORACLE", "offset": 0, "slot": "0", "type": "t_contract(IChainlinkAggregatorV3)25368" } ], "types": { "t_contract(IChainlinkAggregatorV3)25368": { "encoding": "inplace", "label": "contract IChainlinkAggregatorV3", "numberOfBytes": "20" } } } }