{"file_path":"contracts/oracle/BackedOracleFactory.sol","creation_status":"success","source_code":"/**\n * SPDX-License-Identifier: MIT\n *\n * Copyright (c) 2021-2023 Backed Finance AG\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\npragma solidity 0.8.9;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/governance/TimelockController.sol\";\nimport \"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol\";\nimport \"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\";\n\nimport \"./BackedOracle.sol\";\nimport \"./BackedOracleForwarder.sol\";\n\n/**\n * @dev\n * TransparentUpgradeableProxy contract, renamed as BackedOracleProxy.\n */\ncontract BackedOracleProxy is TransparentUpgradeableProxy {\n    constructor(\n        address _logic,\n        address _admin,\n        bytes memory _data\n    ) payable TransparentUpgradeableProxy(_logic, _admin, _data) {}\n}\n\ncontract BackedOracleFactory is Ownable {\n    ProxyAdmin public proxyAdmin;\n    TimelockController public timelockController;\n    BackedOracle public implementation;\n\n    event NewOracle(address indexed newOracle);\n    event NewOracleForwarder(address indexed newOracleForwarder);\n    event NewImplementation(address indexed newImplementation);\n\n    /**\n     * @param admin- The address of the account that will be set as owner of the deployed ProxyAdmin and will have the\n     *      timelock admin role for the timelock contract\n     */\n    constructor(address admin, address[] memory timelockWorkers) {\n        require(\n            admin != address(0),\n            \"Factory: address should not be 0\"\n        );\n\n        implementation = new BackedOracle();\n\n        proxyAdmin = new ProxyAdmin();\n\n        timelockController = new TimelockController(\n            7 days,\n            timelockWorkers,\n            timelockWorkers\n        );\n\n        proxyAdmin.transferOwnership(address(timelockController));\n        timelockController.grantRole(timelockController.TIMELOCK_ADMIN_ROLE(), admin);\n    }\n\n    function deployOracle(\n        uint8 decimals,\n        string memory description,\n        address oracleUpdater\n    ) external onlyOwner returns (address) {\n        bytes32 salt = keccak256(abi.encodePacked(description));\n\n        BackedOracleProxy proxy = new BackedOracleProxy{salt: salt}(\n            address(implementation),\n            address(proxyAdmin),\n            abi.encodeWithSelector(\n                BackedOracle(address(0)).initialize.selector,\n                decimals,\n                description,\n                address(timelockController),\n                oracleUpdater\n            )\n        );\n\n        emit NewOracle(address(proxy));\n\n        BackedOracleForwarder forwarder = new BackedOracleForwarder{salt: salt}(\n            address(proxy),\n            address(timelockController)\n        );\n        emit NewOracleForwarder(address(forwarder));\n\n        return address(forwarder);\n    }\n\n    /**\n     * @dev Update the implementation for future deployments\n     *\n     * Emits a { NewImplementation } event\n     *\n     * @param newImplementation - the address of the new implementation\n     */\n    function updateImplementation(\n        address newImplementation\n    ) external onlyOwner {\n        require(\n            newImplementation != address(0),\n            \"Factory: address should not be 0\"\n        );\n\n        implementation = BackedOracle(newImplementation);\n\n        emit NewImplementation(newImplementation);\n    }\n}\n","deployed_bytecode":"0x60806040523480156200001157600080fd5b5060043610620000935760003560e01c8063715018a61162000062578063715018a6146200010c5780638da5cb5b1462000116578063f2fde38b1462000128578063f3388e75146200013f57600080fd5b8063025b22bc14620000985780631ff2631214620000b15780633e47158c14620000e45780635c60da1b14620000f8575b600080fd5b620000af620000a936600462000570565b62000153565b005b620000c8620000c2366004620005ab565b6200022b565b6040516001600160a01b03909116815260200160405180910390f35b600154620000c8906001600160a01b031681565b600354620000c8906001600160a01b031681565b620000af6200040a565b6000546001600160a01b0316620000c8565b620000af6200013936600462000570565b62000445565b600254620000c8906001600160a01b031681565b6000546001600160a01b03163314620001895760405162461bcd60e51b8152600401620001809062000692565b60405180910390fd5b6001600160a01b038116620001e15760405162461bcd60e51b815260206004820181905260248201527f466163746f72793a20616464726573732073686f756c64206e6f742062652030604482015260640162000180565b600380546001600160a01b0319166001600160a01b0383169081179091556040517f6b70829fcbe4891157f7a7496f9870927de3c8237adbe9cd39bae09b7382c40990600090a250565b600080546001600160a01b03163314620002595760405162461bcd60e51b8152600401620001809062000692565b6000836040516020016200026e9190620006fa565b60408051601f1981840301815290829052805160209091012060035460015460025492945060009385936001600160a01b03938416939283169263f4a2906760e01b92620002c8928d928d929116908c9060240162000746565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620003079062000537565b620003159392919062000785565b8190604051809103906000f590508015801562000336573d6000803e3d6000fd5b506040519091506001600160a01b038216907fb3eacd0e351fafdfefdec84e1cd19679b38dbcd63ea7c2c24da17fd2bc3b3c0e90600090a2600254604051600091849184916001600160a01b031690620003909062000545565b6001600160a01b039283168152911660208201526040018190604051809103906000f5905080158015620003c8573d6000803e3d6000fd5b506040519091506001600160a01b038216907f0123400de0e774068ff25080d380ed1e8ad70cfea3c0d28d9ff41f1701ce638d90600090a29695505050505050565b6000546001600160a01b03163314620004375760405162461bcd60e51b8152600401620001809062000692565b620004436000620004e7565b565b6000546001600160a01b03163314620004725760405162461bcd60e51b8152600401620001809062000692565b6001600160a01b038116620004d95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000180565b620004e481620004e7565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610f6c80620007bd83390190565b610bb0806200172983390190565b80356001600160a01b03811681146200056b57600080fd5b919050565b6000602082840312156200058357600080fd5b6200058e8262000553565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215620005c157600080fd5b833560ff81168114620005d357600080fd5b9250602084013567ffffffffffffffff80821115620005f157600080fd5b818601915086601f8301126200060657600080fd5b8135818111156200061b576200061b62000595565b604051601f8201601f19908116603f0116810190838211818310171562000646576200064662000595565b816040528281528960208487010111156200066057600080fd5b826020860160208301376000602084830101528096505050505050620006896040850162000553565b90509250925092565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60005b83811015620006e4578181015183820152602001620006ca565b83811115620006f4576000848401525b50505050565b600082516200070e818460208701620006c7565b9190910192915050565b6000815180845262000732816020860160208601620006c7565b601f01601f19169290920160200192915050565b60ff8516815260806020820152600062000764608083018662000718565b6001600160a01b039485166040840152929093166060909101529392505050565b6001600160a01b03848116825283166020820152606060408201819052600090620007b39083018462000718565b9594505050505056fe608060405260405162000f6c38038062000f6c83398101604081905262000026916200051f565b82828282816200005860017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005ff565b60008051602062000f258339815191521462000078576200007862000625565b6200008682826000620000ed565b50620000b6905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005ff565b60008051602062000f0583398151915214620000d657620000d662000625565b620000e1826200012a565b5050505050506200068e565b620000f88362000185565b600082511180620001065750805b156200012557620001238383620001c760201b620002601760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000155620001f6565b604080516001600160a01b03928316815291841660208301520160405180910390a162000182816200022f565b50565b6200019081620002e4565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001ef838360405180606001604052806027815260200162000f456027913962000387565b9392505050565b60006200022060008051602062000f0583398151915260001b6200046d60201b620002081760201c565b546001600160a01b0316919050565b6001600160a01b0381166200029a5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002c360008051602062000f0583398151915260001b6200046d60201b620002081760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002fa816200047060201b6200028c1760201c565b6200035e5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000291565b80620002c360008051602062000f2583398151915260001b6200046d60201b620002081760201c565b60606001600160a01b0384163b620003f15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000291565b600080856001600160a01b0316856040516200040e91906200063b565b600060405180830381855af49150503d80600081146200044b576040519150601f19603f3d011682016040523d82523d6000602084013e62000450565b606091505b509092509050620004638282866200047f565b9695505050505050565b90565b6001600160a01b03163b151590565b6060831562000490575081620001ef565b825115620004a15782518084602001fd5b8160405162461bcd60e51b815260040162000291919062000659565b80516001600160a01b0381168114620004d557600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200050d578181015183820152602001620004f3565b83811115620001235750506000910152565b6000806000606084860312156200053557600080fd5b6200054084620004bd565b92506200055060208501620004bd565b60408501519092506001600160401b03808211156200056e57600080fd5b818601915086601f8301126200058357600080fd5b815181811115620005985762000598620004da565b604051601f8201601f19908116603f01168101908382118183101715620005c357620005c3620004da565b81604052828152896020848701011115620005dd57600080fd5b620005f0836020830160208801620004f0565b80955050505050509250925092565b6000828210156200062057634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200064f818460208701620004f0565b9190910192915050565b60208152600082518060208401526200067a816040850160208701620004f0565b601f01601f19169190910160400192915050565b610867806200069e6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106f1565b610118565b61005b61009336600461070c565b61015f565b3480156100a457600080fd5b506100ad6101d0565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106f1565b61020b565b3480156100f557600080fd5b506100ad610235565b61010661029b565b61011661011161033a565b610344565b565b610120610368565b6001600160a01b0316336001600160a01b03161415610157576101548160405180602001604052806000815250600061039b565b50565b6101546100fe565b610167610368565b6001600160a01b0316336001600160a01b031614156101c8576101c38383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061039b915050565b505050565b6101c36100fe565b60006101da610368565b6001600160a01b0316336001600160a01b03161415610200576101fb61033a565b905090565b6102086100fe565b90565b610213610368565b6001600160a01b0316336001600160a01b0316141561015757610154816103c6565b600061023f610368565b6001600160a01b0316336001600160a01b03161415610200576101fb610368565b6060610285838360405180606001604052806027815260200161080b6027913961041a565b9392505050565b6001600160a01b03163b151590565b6102a3610368565b6001600160a01b0316336001600160a01b031614156101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101fb6104f7565b3660008037600080366000845af43d6000803e808015610363573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103a48361051f565b6000825111806103b15750805b156101c3576103c08383610260565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103ef610368565b604080516001600160a01b03928316815291841660208301520160405180910390a16101548161055f565b60606001600160a01b0384163b6104825760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610331565b600080856001600160a01b03168560405161049d91906107bb565b600060405180830381855af49150503d80600081146104d8576040519150601f19603f3d011682016040523d82523d6000602084013e6104dd565b606091505b50915091506104ed828286610608565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61038c565b61052881610641565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105c45760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b6064820152608401610331565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60608315610617575081610285565b8251156106275782518084602001fd5b8160405162461bcd60e51b815260040161033191906107d7565b6001600160a01b0381163b6106ae5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610331565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105e7565b80356001600160a01b03811681146106ec57600080fd5b919050565b60006020828403121561070357600080fd5b610285826106d5565b60008060006040848603121561072157600080fd5b61072a846106d5565b9250602084013567ffffffffffffffff8082111561074757600080fd5b818601915086601f83011261075b57600080fd5b81358181111561076a57600080fd5b87602082850101111561077c57600080fd5b6020830194508093505050509250925092565b60005b838110156107aa578181015183820152602001610792565b838111156103c05750506000910152565b600082516107cd81846020870161078f565b9190910192915050565b60208152600082518060208401526107f681604085016020870161078f565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d5da4ec34027311961e45ff3fa68ea11057229a931c2641a7f7f21c7e7b46ddb64736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564608060405234801561001057600080fd5b50604051610bb0380380610bb083398101604081905261002f916100cf565b61003833610063565b600180546001600160a01b0319166001600160a01b03841617905561005c81610063565b5050610102565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100ca57600080fd5b919050565b600080604083850312156100e257600080fd5b6100eb836100b3565b91506100f9602084016100b3565b90509250929050565b610a9f806101116000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80638ac8f3dd11610097578063b5ab58dc11610066578063b5ab58dc146101ff578063b633620c14610212578063f2fde38b14610225578063feaf968c1461023857600080fd5b80638ac8f3dd146101665780638da5cb5b146101915780639a6fc8f5146101a2578063afc4be81146101ec57600080fd5b8063668a0f02116100d3578063668a0f0214610137578063715018a61461013f5780637284e416146101495780638205bf6a1461015e57600080fd5b8063313ce567146100fa57806350d25bcd1461011957806354fd4d501461012f575b600080fd5b610102610240565b60405160ff90911681526020015b60405180910390f35b6101216102c2565b604051908152602001610110565b61012161033f565b610121610384565b6101476103c9565b005b610151610408565b604051610110919061082c565b610121610489565b600154610179906001600160a01b031681565b6040516001600160a01b039091168152602001610110565b6000546001600160a01b0316610179565b6101b56101b0366004610877565b6104ce565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a001610110565b6101476101fa36600461089b565b610570565b61012161020d3660046108c4565b6105bc565b6101216102203660046108c4565b610640565b61014761023336600461089b565b610672565b6101b561070d565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561028557600080fd5b505afa158015610299573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bd91906108dd565b905090565b600154604080516350d25bcd60e01b815290516000926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b15801561030757600080fd5b505afa15801561031b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bd9190610900565b6001546040805163054fd4d560e41b815290516000926001600160a01b0316916354fd4d50916004808301926020929190829003018186803b15801561030757600080fd5b60015460408051633345078160e11b815290516000926001600160a01b03169163668a0f02916004808301926020929190829003018186803b15801561030757600080fd5b6000546001600160a01b031633146103fc5760405162461bcd60e51b81526004016103f390610919565b60405180910390fd5b61040660006107ac565b565b60015460408051633942720b60e11b815290516060926001600160a01b031691637284e416916004808301926000929190829003018186803b15801561044d57600080fd5b505afa158015610461573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102bd9190810190610964565b60015460408051634102dfb560e11b815290516000926001600160a01b031691638205bf6a916004808301926020929190829003018186803b15801561030757600080fd5b600154604051639a6fc8f560e01b815269ffffffffffffffffffff8316600482015260009182918291829182916001600160a01b031690639a6fc8f59060240160a06040518083038186803b15801561052657600080fd5b505afa15801561053a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055e9190610a11565b939a9299509097509550909350915050565b6000546001600160a01b0316331461059a5760405162461bcd60e51b81526004016103f390610919565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600154604051632d6ad63760e21b8152600481018390526000916001600160a01b03169063b5ab58dc906024015b60206040518083038186803b15801561060257600080fd5b505afa158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a9190610900565b92915050565b600154604051632d8cd88360e21b8152600481018390526000916001600160a01b03169063b633620c906024016105ea565b6000546001600160a01b0316331461069c5760405162461bcd60e51b81526004016103f390610919565b6001600160a01b0381166107015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f3565b61070a816107ac565b50565b6000806000806000600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561076357600080fd5b505afa158015610777573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079b9190610a11565b945094509450945094509091929394565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60005b838110156108175781810151838201526020016107ff565b83811115610826576000848401525b50505050565b602081526000825180602084015261084b8160408501602087016107fc565b601f01601f19169190910160400192915050565b69ffffffffffffffffffff8116811461070a57600080fd5b60006020828403121561088957600080fd5b81356108948161085f565b9392505050565b6000602082840312156108ad57600080fd5b81356001600160a01b038116811461089457600080fd5b6000602082840312156108d657600080fd5b5035919050565b6000602082840312156108ef57600080fd5b815160ff8116811461089457600080fd5b60006020828403121561091257600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561097657600080fd5b815167ffffffffffffffff8082111561098e57600080fd5b818401915084601f8301126109a257600080fd5b8151818111156109b4576109b461094e565b604051601f8201601f19908116603f011681019083821181831017156109dc576109dc61094e565b816040528281528760208487010111156109f557600080fd5b610a068360208301602088016107fc565b979650505050505050565b600080600080600060a08688031215610a2957600080fd5b8551610a348161085f565b809550506020860151935060408601519250606086015191506080860151610a5b8161085f565b80915050929550929590935056fea26469706673582212201a1e027eceff9f6cfb8283984a0536a90817e44c20341f6087c6e7e64a65faaa64736f6c63430008090033a2646970667358221220671ec1a0833017b54da24c03344293bc4b3125cfbdb8255cb580aae364f9e96264736f6c63430008090033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"london","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"remappings":[]},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0x17603dDb4A4F8D7a7E1FC45fa0059aDc906c8600",{"internalType":"address","name":"admin","type":"address"}],[["0x17603dDb4A4F8D7a7E1FC45fa0059aDc906c8600"],{"internalType":"address[]","name":"timelockWorkers","type":"address[]"}]],"compiler_version":"0.8.9+commit.e5eed63a","is_verified_via_verifier_alliance":true,"verified_at":"2026-04-03T00:48:11.004711Z","implementations":[{"address_hash":"0xb239bd2216D1c8476f601e0d9b5FfAD556C59Cc4","name":"BackedOracle"}],"proxy_type":"basic_implementation","external_libraries":[],"creation_bytecode":"0x60806040523480156200001157600080fd5b506040516200664838038062006648833981016040819052620000349162000390565b6200003f33620002e3565b6001600160a01b0382166200009a5760405162461bcd60e51b815260206004820181905260248201527f466163746f72793a20616464726573732073686f756c64206e6f742062652030604482015260640160405180910390fd5b604051620000a89062000333565b604051809103906000f080158015620000c5573d6000803e3d6000fd5b50600380546001600160a01b0319166001600160a01b0392909216919091179055604051620000f49062000341565b604051809103906000f08015801562000111573d6000803e3d6000fd5b50600160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555062093a8081826040516200014c906200034f565b6200015a93929190620004bf565b604051809103906000f08015801562000177573d6000803e3d6000fd5b50600280546001600160a01b0319166001600160a01b0392831690811790915560015460405163f2fde38b60e01b815260048101929092529091169063f2fde38b90602401600060405180830381600087803b158015620001d757600080fd5b505af1158015620001ec573d6000803e3d6000fd5b50506002546040805163034f3dbf60e21b815290516001600160a01b039092169350632f2ff15d92508391630d3cf6fc91600480820192602092909190829003018186803b1580156200023e57600080fd5b505afa15801562000253573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002799190620004f8565b6040516001600160e01b031960e084901b16815260048101919091526001600160a01b0385166024820152604401600060405180830381600087803b158015620002c257600080fd5b505af1158015620002d7573d6000803e3d6000fd5b50505050505062000512565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61185a806200283083390190565b6107a1806200408a83390190565b611e1d806200482b83390190565b80516001600160a01b03811681146200037557600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215620003a457600080fd5b620003af836200035d565b602084810151919350906001600160401b0380821115620003cf57600080fd5b818601915086601f830112620003e457600080fd5b815181811115620003f957620003f96200037a565b8060051b604051601f19603f830116810181811085821117156200042157620004216200037a565b6040529182528482019250838101850191898311156200044057600080fd5b938501935b82851015620004695762000459856200035d565b8452938501939285019262000445565b8096505050505050509250929050565b600081518084526020808501945080840160005b83811015620004b45781516001600160a01b0316875295820195908201906001016200048d565b509495945050505050565b838152606060208201526000620004da606083018562000479565b8281036040840152620004ee818562000479565b9695505050505050565b6000602082840312156200050b57600080fd5b5051919050565b61230e80620005226000396000f3fe60806040523480156200001157600080fd5b5060043610620000935760003560e01c8063715018a61162000062578063715018a6146200010c5780638da5cb5b1462000116578063f2fde38b1462000128578063f3388e75146200013f57600080fd5b8063025b22bc14620000985780631ff2631214620000b15780633e47158c14620000e45780635c60da1b14620000f8575b600080fd5b620000af620000a936600462000570565b62000153565b005b620000c8620000c2366004620005ab565b6200022b565b6040516001600160a01b03909116815260200160405180910390f35b600154620000c8906001600160a01b031681565b600354620000c8906001600160a01b031681565b620000af6200040a565b6000546001600160a01b0316620000c8565b620000af6200013936600462000570565b62000445565b600254620000c8906001600160a01b031681565b6000546001600160a01b03163314620001895760405162461bcd60e51b8152600401620001809062000692565b60405180910390fd5b6001600160a01b038116620001e15760405162461bcd60e51b815260206004820181905260248201527f466163746f72793a20616464726573732073686f756c64206e6f742062652030604482015260640162000180565b600380546001600160a01b0319166001600160a01b0383169081179091556040517f6b70829fcbe4891157f7a7496f9870927de3c8237adbe9cd39bae09b7382c40990600090a250565b600080546001600160a01b03163314620002595760405162461bcd60e51b8152600401620001809062000692565b6000836040516020016200026e9190620006fa565b60408051601f1981840301815290829052805160209091012060035460015460025492945060009385936001600160a01b03938416939283169263f4a2906760e01b92620002c8928d928d929116908c9060240162000746565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620003079062000537565b620003159392919062000785565b8190604051809103906000f590508015801562000336573d6000803e3d6000fd5b506040519091506001600160a01b038216907fb3eacd0e351fafdfefdec84e1cd19679b38dbcd63ea7c2c24da17fd2bc3b3c0e90600090a2600254604051600091849184916001600160a01b031690620003909062000545565b6001600160a01b039283168152911660208201526040018190604051809103906000f5905080158015620003c8573d6000803e3d6000fd5b506040519091506001600160a01b038216907f0123400de0e774068ff25080d380ed1e8ad70cfea3c0d28d9ff41f1701ce638d90600090a29695505050505050565b6000546001600160a01b03163314620004375760405162461bcd60e51b8152600401620001809062000692565b620004436000620004e7565b565b6000546001600160a01b03163314620004725760405162461bcd60e51b8152600401620001809062000692565b6001600160a01b038116620004d95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000180565b620004e481620004e7565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610f6c80620007bd83390190565b610bb0806200172983390190565b80356001600160a01b03811681146200056b57600080fd5b919050565b6000602082840312156200058357600080fd5b6200058e8262000553565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215620005c157600080fd5b833560ff81168114620005d357600080fd5b9250602084013567ffffffffffffffff80821115620005f157600080fd5b818601915086601f8301126200060657600080fd5b8135818111156200061b576200061b62000595565b604051601f8201601f19908116603f0116810190838211818310171562000646576200064662000595565b816040528281528960208487010111156200066057600080fd5b826020860160208301376000602084830101528096505050505050620006896040850162000553565b90509250925092565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60005b83811015620006e4578181015183820152602001620006ca565b83811115620006f4576000848401525b50505050565b600082516200070e818460208701620006c7565b9190910192915050565b6000815180845262000732816020860160208601620006c7565b601f01601f19169290920160200192915050565b60ff8516815260806020820152600062000764608083018662000718565b6001600160a01b039485166040840152929093166060909101529392505050565b6001600160a01b03848116825283166020820152606060408201819052600090620007b39083018462000718565b9594505050505056fe608060405260405162000f6c38038062000f6c83398101604081905262000026916200051f565b82828282816200005860017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005ff565b60008051602062000f258339815191521462000078576200007862000625565b6200008682826000620000ed565b50620000b6905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005ff565b60008051602062000f0583398151915214620000d657620000d662000625565b620000e1826200012a565b5050505050506200068e565b620000f88362000185565b600082511180620001065750805b156200012557620001238383620001c760201b620002601760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000155620001f6565b604080516001600160a01b03928316815291841660208301520160405180910390a162000182816200022f565b50565b6200019081620002e4565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001ef838360405180606001604052806027815260200162000f456027913962000387565b9392505050565b60006200022060008051602062000f0583398151915260001b6200046d60201b620002081760201c565b546001600160a01b0316919050565b6001600160a01b0381166200029a5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002c360008051602062000f0583398151915260001b6200046d60201b620002081760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002fa816200047060201b6200028c1760201c565b6200035e5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000291565b80620002c360008051602062000f2583398151915260001b6200046d60201b620002081760201c565b60606001600160a01b0384163b620003f15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000291565b600080856001600160a01b0316856040516200040e91906200063b565b600060405180830381855af49150503d80600081146200044b576040519150601f19603f3d011682016040523d82523d6000602084013e62000450565b606091505b509092509050620004638282866200047f565b9695505050505050565b90565b6001600160a01b03163b151590565b6060831562000490575081620001ef565b825115620004a15782518084602001fd5b8160405162461bcd60e51b815260040162000291919062000659565b80516001600160a01b0381168114620004d557600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200050d578181015183820152602001620004f3565b83811115620001235750506000910152565b6000806000606084860312156200053557600080fd5b6200054084620004bd565b92506200055060208501620004bd565b60408501519092506001600160401b03808211156200056e57600080fd5b818601915086601f8301126200058357600080fd5b815181811115620005985762000598620004da565b604051601f8201601f19908116603f01168101908382118183101715620005c357620005c3620004da565b81604052828152896020848701011115620005dd57600080fd5b620005f0836020830160208801620004f0565b80955050505050509250925092565b6000828210156200062057634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200064f818460208701620004f0565b9190910192915050565b60208152600082518060208401526200067a816040850160208701620004f0565b601f01601f19169190910160400192915050565b610867806200069e6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106f1565b610118565b61005b61009336600461070c565b61015f565b3480156100a457600080fd5b506100ad6101d0565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106f1565b61020b565b3480156100f557600080fd5b506100ad610235565b61010661029b565b61011661011161033a565b610344565b565b610120610368565b6001600160a01b0316336001600160a01b03161415610157576101548160405180602001604052806000815250600061039b565b50565b6101546100fe565b610167610368565b6001600160a01b0316336001600160a01b031614156101c8576101c38383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061039b915050565b505050565b6101c36100fe565b60006101da610368565b6001600160a01b0316336001600160a01b03161415610200576101fb61033a565b905090565b6102086100fe565b90565b610213610368565b6001600160a01b0316336001600160a01b0316141561015757610154816103c6565b600061023f610368565b6001600160a01b0316336001600160a01b03161415610200576101fb610368565b6060610285838360405180606001604052806027815260200161080b6027913961041a565b9392505050565b6001600160a01b03163b151590565b6102a3610368565b6001600160a01b0316336001600160a01b031614156101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101fb6104f7565b3660008037600080366000845af43d6000803e808015610363573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103a48361051f565b6000825111806103b15750805b156101c3576103c08383610260565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103ef610368565b604080516001600160a01b03928316815291841660208301520160405180910390a16101548161055f565b60606001600160a01b0384163b6104825760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610331565b600080856001600160a01b03168560405161049d91906107bb565b600060405180830381855af49150503d80600081146104d8576040519150601f19603f3d011682016040523d82523d6000602084013e6104dd565b606091505b50915091506104ed828286610608565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61038c565b61052881610641565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105c45760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b6064820152608401610331565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60608315610617575081610285565b8251156106275782518084602001fd5b8160405162461bcd60e51b815260040161033191906107d7565b6001600160a01b0381163b6106ae5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610331565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105e7565b80356001600160a01b03811681146106ec57600080fd5b919050565b60006020828403121561070357600080fd5b610285826106d5565b60008060006040848603121561072157600080fd5b61072a846106d5565b9250602084013567ffffffffffffffff8082111561074757600080fd5b818601915086601f83011261075b57600080fd5b81358181111561076a57600080fd5b87602082850101111561077c57600080fd5b6020830194508093505050509250925092565b60005b838110156107aa578181015183820152602001610792565b838111156103c05750506000910152565b600082516107cd81846020870161078f565b9190910192915050565b60208152600082518060208401526107f681604085016020870161078f565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d5da4ec34027311961e45ff3fa68ea11057229a931c2641a7f7f21c7e7b46ddb64736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564608060405234801561001057600080fd5b50604051610bb0380380610bb083398101604081905261002f916100cf565b61003833610063565b600180546001600160a01b0319166001600160a01b03841617905561005c81610063565b5050610102565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100ca57600080fd5b919050565b600080604083850312156100e257600080fd5b6100eb836100b3565b91506100f9602084016100b3565b90509250929050565b610a9f806101116000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80638ac8f3dd11610097578063b5ab58dc11610066578063b5ab58dc146101ff578063b633620c14610212578063f2fde38b14610225578063feaf968c1461023857600080fd5b80638ac8f3dd146101665780638da5cb5b146101915780639a6fc8f5146101a2578063afc4be81146101ec57600080fd5b8063668a0f02116100d3578063668a0f0214610137578063715018a61461013f5780637284e416146101495780638205bf6a1461015e57600080fd5b8063313ce567146100fa57806350d25bcd1461011957806354fd4d501461012f575b600080fd5b610102610240565b60405160ff90911681526020015b60405180910390f35b6101216102c2565b604051908152602001610110565b61012161033f565b610121610384565b6101476103c9565b005b610151610408565b604051610110919061082c565b610121610489565b600154610179906001600160a01b031681565b6040516001600160a01b039091168152602001610110565b6000546001600160a01b0316610179565b6101b56101b0366004610877565b6104ce565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a001610110565b6101476101fa36600461089b565b610570565b61012161020d3660046108c4565b6105bc565b6101216102203660046108c4565b610640565b61014761023336600461089b565b610672565b6101b561070d565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561028557600080fd5b505afa158015610299573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bd91906108dd565b905090565b600154604080516350d25bcd60e01b815290516000926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b15801561030757600080fd5b505afa15801561031b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bd9190610900565b6001546040805163054fd4d560e41b815290516000926001600160a01b0316916354fd4d50916004808301926020929190829003018186803b15801561030757600080fd5b60015460408051633345078160e11b815290516000926001600160a01b03169163668a0f02916004808301926020929190829003018186803b15801561030757600080fd5b6000546001600160a01b031633146103fc5760405162461bcd60e51b81526004016103f390610919565b60405180910390fd5b61040660006107ac565b565b60015460408051633942720b60e11b815290516060926001600160a01b031691637284e416916004808301926000929190829003018186803b15801561044d57600080fd5b505afa158015610461573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102bd9190810190610964565b60015460408051634102dfb560e11b815290516000926001600160a01b031691638205bf6a916004808301926020929190829003018186803b15801561030757600080fd5b600154604051639a6fc8f560e01b815269ffffffffffffffffffff8316600482015260009182918291829182916001600160a01b031690639a6fc8f59060240160a06040518083038186803b15801561052657600080fd5b505afa15801561053a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055e9190610a11565b939a9299509097509550909350915050565b6000546001600160a01b0316331461059a5760405162461bcd60e51b81526004016103f390610919565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600154604051632d6ad63760e21b8152600481018390526000916001600160a01b03169063b5ab58dc906024015b60206040518083038186803b15801561060257600080fd5b505afa158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a9190610900565b92915050565b600154604051632d8cd88360e21b8152600481018390526000916001600160a01b03169063b633620c906024016105ea565b6000546001600160a01b0316331461069c5760405162461bcd60e51b81526004016103f390610919565b6001600160a01b0381166107015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f3565b61070a816107ac565b50565b6000806000806000600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561076357600080fd5b505afa158015610777573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079b9190610a11565b945094509450945094509091929394565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60005b838110156108175781810151838201526020016107ff565b83811115610826576000848401525b50505050565b602081526000825180602084015261084b8160408501602087016107fc565b601f01601f19169190910160400192915050565b69ffffffffffffffffffff8116811461070a57600080fd5b60006020828403121561088957600080fd5b81356108948161085f565b9392505050565b6000602082840312156108ad57600080fd5b81356001600160a01b038116811461089457600080fd5b6000602082840312156108d657600080fd5b5035919050565b6000602082840312156108ef57600080fd5b815160ff8116811461089457600080fd5b60006020828403121561091257600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561097657600080fd5b815167ffffffffffffffff8082111561098e57600080fd5b818401915084601f8301126109a257600080fd5b8151818111156109b4576109b461094e565b604051601f8201601f19908116603f011681019083821181831017156109dc576109dc61094e565b816040528281528760208487010111156109f557600080fd5b610a068360208301602088016107fc565b979650505050505050565b600080600080600060a08688031215610a2957600080fd5b8551610a348161085f565b809550506020860151935060408601519250606086015191506080860151610a5b8161085f565b80915050929550929590935056fea26469706673582212201a1e027eceff9f6cfb8283984a0536a90817e44c20341f6087c6e7e64a65faaa64736f6c63430008090033a2646970667358221220671ec1a0833017b54da24c03344293bc4b3125cfbdb8255cb580aae364f9e96264736f6c6343000809003360806040523480156200001157600080fd5b506200005d60006040518060400160405280601c81526020017f4261636b6564204f7261636c6520496d706c656d656e746174696f6e000000008152506000806200006360201b60201c565b62000342565b600054610100900460ff16620000805760005460ff16156200008a565b6200008a6200018d565b620000f25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff1615801562000115576000805461ffff19166101011790555b6097805460ff191660ff87161790558351620001399060989060208701906200025f565b5062000147600084620001ab565b620001737f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab83620001ab565b801562000186576000805461ff00191690555b5050505050565b6000620001a5306200025060201b62000c001760201c565b15905090565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff166200024c5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200020b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6001600160a01b03163b151590565b8280546200026d9062000305565b90600052602060002090601f016020900481019282620002915760008555620002dc565b82601f10620002ac57805160ff1916838001178555620002dc565b82800160010185558215620002dc579182015b82811115620002dc578251825591602001919060010190620002bf565b50620002ea929150620002ee565b5090565b5b80821115620002ea5760008155600101620002ef565b600181811c908216806200031a57607f821691505b602082108114156200033c57634e487b7160e01b600052602260045260246000fd5b50919050565b61150880620003526000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c80638205bf6a116100c3578063b633620c1161007c578063b633620c14610300578063bd3be27c14610313578063d547741f1461031c578063f4a290671461032f578063feaf968c14610342578063ffa1ad741461034a57600080fd5b80638205bf6a1461027b5780638a991dd11461028357806391d148541461028b5780639a6fc8f51461029e578063a217fddf146102e5578063b5ab58dc146102ed57600080fd5b806347e633801161011557806347e633801461020a57806350d25bcd1461023157806354fd4d5014610239578063668a0f02146102405780637284e4161461024857806376670d7a1461025d57600080fd5b806301ffc9a71461015d578063248a9ca3146101855780632f2ff15d146101b6578063309676e9146101cb578063313ce567146101de57806336568abe146101f7575b600080fd5b61017061016b366004610f9c565b610352565b60405190151581526020015b60405180910390f35b6101a8610193366004610fc6565b60009081526065602052604090206001015490565b60405190815260200161017c565b6101c96101c4366004610ffb565b610389565b005b6101c96101d9366004611027565b6103b4565b60975460ff165b60405160ff909116815260200161017c565b6101c9610205366004610ffb565b610735565b6101a87f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab81565b6101a86107b3565b60016101a8565b6101a8610800565b61025061083b565b60405161017c919061109f565b61026661012c81565b60405163ffffffff909116815260200161017c565b6101a86108cd565b6101e5600a81565b610170610299366004610ffb565b610924565b6102b16102ac3660046110d2565b61094f565b604080516001600160501b03968716815260208101959095528401929092526060830152909116608082015260a00161017c565b6101a8600081565b6101a86102fb366004610fc6565b6109c3565b6101a861030e366004610fc6565b610a07565b610266610e1081565b6101c961032a366004610ffb565b610a55565b6101c961033d366004611111565b610a7b565b6102b1610b90565b6101e5600181565b60006001600160e01b03198216637965db0b60e01b148061038357506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152606560205260409020600101546103a58133610c0f565b6103af8383610c73565b505050565b7f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab6103df8133610c0f565b609a546001600160501b0316600090815260996020526040902054601781900b9063ffffffff600160c01b90910481169042908516106104705760405162461bcd60e51b815260206004820152602160248201527f54696d657374616d702063616e6e6f7420626520696e207468652066757475726044820152606560f81b60648201526084015b60405180910390fd5b61012c61048363ffffffff861642611212565b11156104c85760405162461bcd60e51b8152602060048201526014602482015273151a5b595cdd185b5c081a5cc81d1bdbc81bdb1960621b6044820152606401610467565b808463ffffffff161161052d5760405162461bcd60e51b815260206004820152602760248201527f54696d657374616d70206973206f6c646572207468616e20746865206c6173746044820152662075706461746560c81b6064820152608401610467565b610e106105408263ffffffff8716611212565b1161059b5760405162461bcd60e51b815260206004820152602560248201527f54696d657374616d702063616e6e6f74206265207570646174656420746f6f2060448201526437b33a32b760d91b6064820152608401610467565b600082131561061757600060646105b3600a85611229565b6105bd91906112ae565b90506105cd601782900b846112ea565b8660170b13156105ec576105e5601782900b846112ea565b9550610615565b6105fa601782900b8461132b565b8660170b121561061557610612601782900b8461132b565b95505b505b609a54600090610631906001600160501b0316600161136a565b609a805469ffffffffffffffffffff19166001600160501b03831690811790915560408051808201825260178a900b80825263ffffffff8a811660208085018281526000888152609983528790209551865491516001600160c01b039091166001600160e01b031990921691909117600160c01b91909416029290921790935592519182529394509192917f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f910160405180910390a360405163ffffffff8616815233906001600160501b038316907f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac602719060200160405180910390a3505050505050565b6001600160a01b03811633146107a55760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610467565b6107af8282610cf9565b5050565b609a546000906001600160501b03166107de5760405162461bcd60e51b815260040161046790611395565b50609a546001600160501b031660009081526099602052604090205460170b90565b609a546000906001600160501b031661082b5760405162461bcd60e51b815260040161046790611395565b50609a546001600160501b031690565b60606098805461084a906113be565b80601f0160208091040260200160405190810160405280929190818152602001828054610876906113be565b80156108c35780601f10610898576101008083540402835291602001916108c3565b820191906000526020600020905b8154815290600101906020018083116108a657829003601f168201915b5050505050905090565b609a546000906001600160501b03166108f85760405162461bcd60e51b815260040161046790611395565b50609a546001600160501b0316600090815260996020526040902054600160c01b900463ffffffff1690565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b609a5460009081908190819081906001600160501b0390811690871611156109895760405162461bcd60e51b815260040161046790611395565b505050506001600160501b0382166000908152609960205260409020549192601783900b92600160c01b900463ffffffff16915081908490565b609a546000906001600160501b03168211156109f15760405162461bcd60e51b815260040161046790611395565b5060009081526099602052604090205460170b90565b609a546000906001600160501b0316821115610a355760405162461bcd60e51b815260040161046790611395565b50600090815260996020526040902054600160c01b900463ffffffff1690565b600082815260656020526040902060010154610a718133610c0f565b6103af8383610cf9565b600054610100900460ff16610a965760005460ff1615610a9a565b303b155b610afd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610467565b600054610100900460ff16158015610b1f576000805461ffff19166101011790555b6097805460ff191660ff87161790558351610b41906098906020870190610f03565b50610b4d600084610c73565b610b777f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab83610c73565b8015610b89576000805461ff00191690555b5050505050565b609a5460009081908190819081906001600160501b0316610bc35760405162461bcd60e51b815260040161046790611395565b5050609a546001600160501b03166000818152609960205260409020549094601782900b9450600160c01b90910463ffffffff1692508291508490565b6001600160a01b03163b151590565b610c198282610924565b6107af57610c31816001600160a01b03166014610d60565b610c3c836020610d60565b604051602001610c4d9291906113f9565b60408051601f198184030181529082905262461bcd60e51b82526104679160040161109f565b610c7d8282610924565b6107af5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610cb53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610d038282610924565b156107af5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60606000610d6f83600261146e565b610d7a90600261148d565b67ffffffffffffffff811115610d9257610d926110fb565b6040519080825280601f01601f191660200182016040528015610dbc576020820181803683370190505b509050600360fc1b81600081518110610dd757610dd76114a5565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610e0657610e066114a5565b60200101906001600160f81b031916908160001a9053506000610e2a84600261146e565b610e3590600161148d565b90505b6001811115610ead576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610e6957610e696114a5565b1a60f81b828281518110610e7f57610e7f6114a5565b60200101906001600160f81b031916908160001a90535060049490941c93610ea6816114bb565b9050610e38565b508315610efc5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610467565b9392505050565b828054610f0f906113be565b90600052602060002090601f016020900481019282610f315760008555610f77565b82601f10610f4a57805160ff1916838001178555610f77565b82800160010185558215610f77579182015b82811115610f77578251825591602001919060010190610f5c565b50610f83929150610f87565b5090565b5b80821115610f835760008155600101610f88565b600060208284031215610fae57600080fd5b81356001600160e01b031981168114610efc57600080fd5b600060208284031215610fd857600080fd5b5035919050565b80356001600160a01b0381168114610ff657600080fd5b919050565b6000806040838503121561100e57600080fd5b8235915061101e60208401610fdf565b90509250929050565b6000806040838503121561103a57600080fd5b82358060170b811461104b57600080fd5b9150602083013563ffffffff8116811461106457600080fd5b809150509250929050565b60005b8381101561108a578181015183820152602001611072565b83811115611099576000848401525b50505050565b60208152600082518060208401526110be81604085016020870161106f565b601f01601f19169190910160400192915050565b6000602082840312156110e457600080fd5b81356001600160501b0381168114610efc57600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561112757600080fd5b843560ff8116811461113857600080fd5b9350602085013567ffffffffffffffff8082111561115557600080fd5b818701915087601f83011261116957600080fd5b81358181111561117b5761117b6110fb565b604051601f8201601f19908116603f011681019083821181831017156111a3576111a36110fb565b816040528281528a60208487010111156111bc57600080fd5b8260208601602083013760006020848301015280975050505050506111e360408601610fdf565b91506111f160608601610fdf565b905092959194509250565b634e487b7160e01b600052601160045260246000fd5b600082821015611224576112246111fc565b500390565b60006001600160ff1b038184138284138082168684048611161561124f5761124f6111fc565b600160ff1b600087128281168783058912161561126e5761126e6111fc565b6000871292508782058712848416161561128a5761128a6111fc565b878505871281841616156112a0576112a06111fc565b505050929093029392505050565b6000826112cb57634e487b7160e01b600052601260045260246000fd5b600160ff1b8214600019841416156112e5576112e56111fc565b500590565b600080821280156001600160ff1b038490038513161561130c5761130c6111fc565b600160ff1b8390038412811615611325576113256111fc565b50500190565b60008083128015600160ff1b850184121615611349576113496111fc565b6001600160ff1b0384018313811615611364576113646111fc565b50500390565b60006001600160501b0380831681851680830382111561138c5761138c6111fc565b01949350505050565b6020808252600f908201526e139bc819185d18481c1c995cd95b9d608a1b604082015260600190565b600181811c908216806113d257607f821691505b602082108114156113f357634e487b7160e01b600052602260045260246000fd5b50919050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161143181601785016020880161106f565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161146281602884016020880161106f565b01602801949350505050565b6000816000190483118215151615611488576114886111fc565b500290565b600082198211156114a0576114a06111fc565b500190565b634e487b7160e01b600052603260045260246000fd5b6000816114ca576114ca6111fc565b50600019019056fea264697066735822122097ec7a5e085f219cbb2920290b7e3a8ba7b459b91549b1695d05deca48cf939164736f6c63430008090033608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6107238061007e6000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104ed565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610511565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f366004610560565b6102de565b34801561013057600080fd5b506100d161013f366004610511565b61036f565b34801561015057600080fd5b506100d161015f3660046104ed565b6103c7565b34801561017057600080fd5b506100a061017f3660046104ed565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d9190610636565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610653565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610653565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610653565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610688565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610653565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610653565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461045f57600080fd5b6000602082840312156104ff57600080fd5b813561050a816104d8565b9392505050565b6000806040838503121561052457600080fd5b823561052f816104d8565b9150602083013561053f816104d8565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561057557600080fd5b8335610580816104d8565b92506020840135610590816104d8565b9150604084013567ffffffffffffffff808211156105ad57600080fd5b818601915086601f8301126105c157600080fd5b8135818111156105d3576105d361054a565b604051601f8201601f19908116603f011681019083821181831017156105fb576105fb61054a565b8160405282815289602084870101111561061457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561064857600080fd5b815161050a816104d8565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b038316815260006020604081840152835180604085015260005b818110156106c4578581018301518582016060015282016106a8565b818111156106d6576000606083870101525b50601f01601f19169290920160600194935050505056fea264697066735822122090b138f5aeb02fb09108702407cf58542246376449bd78b1ba261e63d44383d864736f6c6343000809003360806040523480156200001157600080fd5b5060405162001e1d38038062001e1d8339810160408190526200003491620003a4565b6200004f60008051602062001dbd83398151915280620001c9565b6200007960008051602062001ddd83398151915260008051602062001dbd833981519152620001c9565b620000a360008051602062001dfd83398151915260008051602062001dbd833981519152620001c9565b620000be60008051602062001dbd8339815191523362000214565b620000d960008051602062001dbd8339815191523062000214565b60005b825181101562000136576200012360008051602062001ddd8339815191528483815181106200010f576200010f62000418565b60200260200101516200021460201b60201c565b6200012e816200042e565b9050620000dc565b5060005b815181101562000180576200016d60008051602062001dfd8339815191528383815181106200010f576200010f62000418565b62000178816200042e565b90506200013a565b5060028390556040805160008152602081018590527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a150505062000458565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b62000220828262000224565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000220576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002803390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b0381168114620002f257600080fd5b919050565b600082601f8301126200030957600080fd5b815160206001600160401b0380831115620003285762000328620002c4565b8260051b604051601f19603f83011681018181108482111715620003505762000350620002c4565b6040529384528581018301938381019250878511156200036f57600080fd5b83870191505b8482101562000399576200038982620002da565b8352918301919083019062000375565b979650505050505050565b600080600060608486031215620003ba57600080fd5b835160208501519093506001600160401b0380821115620003da57600080fd5b620003e887838801620002f7565b93506040860151915080821115620003ff57600080fd5b506200040e86828701620002f7565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b60006000198214156200045157634e487b7160e01b600052601160045260246000fd5b5060010190565b61195580620004686000396000f3fe60806040526004361061014f5760003560e01c806364d62353116100b6578063b1c5f4271161006f578063b1c5f427146103f3578063c4d252f514610413578063d45c443514610433578063d547741f14610460578063e38335e514610480578063f27a0c921461049357600080fd5b806364d623531461033c5780638065657f1461035c5780638f2a0bb01461037c5780638f61f4f51461039c57806391d14854146103be578063a217fddf146103de57600080fd5b8063248a9ca311610108578063248a9ca31461025b5780632ab0f5291461028b5780632f2ff15d146102bc57806331d50750146102dc57806336568abe146102fc578063584b153e1461031c57600080fd5b806301d5062a1461015b57806301ffc9a71461017d57806307bd0265146101b25780630d3cf6fc146101f4578063134008d31461022857806313bc9f201461023b57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017b6101763660046111b5565b6104a8565b005b34801561018957600080fd5b5061019d61019836600461122a565b61052c565b60405190151581526020015b60405180910390f35b3480156101be57600080fd5b506101e67fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6381565b6040519081526020016101a9565b34801561020057600080fd5b506101e67f5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca581565b61017b610236366004611254565b610563565b34801561024757600080fd5b5061019d6102563660046112c0565b6105db565b34801561026757600080fd5b506101e66102763660046112c0565b60009081526020819052604090206001015490565b34801561029757600080fd5b5061019d6102a63660046112c0565b6000908152600160208190526040909120541490565b3480156102c857600080fd5b5061017b6102d73660046112d9565b610601565b3480156102e857600080fd5b5061019d6102f73660046112c0565b61062c565b34801561030857600080fd5b5061017b6103173660046112d9565b610645565b34801561032857600080fd5b5061019d6103373660046112c0565b6106c8565b34801561034857600080fd5b5061017b6103573660046112c0565b6106de565b34801561036857600080fd5b506101e6610377366004611254565b610782565b34801561038857600080fd5b5061017b61039736600461134a565b6107c1565b3480156103a857600080fd5b506101e660008051602061190083398151915281565b3480156103ca57600080fd5b5061019d6103d93660046112d9565b610902565b3480156103ea57600080fd5b506101e6600081565b3480156103ff57600080fd5b506101e661040e3660046113fc565b61092b565b34801561041f57600080fd5b5061017b61042e3660046112c0565b610970565b34801561043f57600080fd5b506101e661044e3660046112c0565b60009081526001602052604090205490565b34801561046c57600080fd5b5061017b61047b3660046112d9565b610a34565b61017b61048e3660046113fc565b610a5a565b34801561049f57600080fd5b506002546101e6565b6000805160206119008339815191526104c18133610b8f565b60006104d1898989898989610782565b90506104dd8184610bf3565b6000817f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8b8b8b8b8b8a604051610519969594939291906114ce565b60405180910390a3505050505050505050565b60006001600160e01b03198216637965db0b60e01b148061055d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6361058f816000610902565b61059d5761059d8133610b8f565b60006105ad888888888888610782565b90506105b98185610ce2565b6105c88160008a8a8a8a610d7e565b6105d181610e92565b5050505050505050565b6000818152600160205260408120546001811180156105fa5750428111155b9392505050565b60008281526020819052604090206001015461061d8133610b8f565b6106278383610ecb565b505050565b60008181526001602052604081205481905b1192915050565b6001600160a01b03811633146106ba5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106c48282610f4f565b5050565b600081815260016020819052604082205461063e565b3330146107415760405162461bcd60e51b815260206004820152602b60248201527f54696d656c6f636b436f6e74726f6c6c65723a2063616c6c6572206d7573742060448201526a62652074696d656c6f636b60a81b60648201526084016106b1565b60025460408051918252602082018390527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a1600255565b600086868686868660405160200161079f969594939291906114ce565b6040516020818303038152906040528051906020012090509695505050505050565b6000805160206119008339815191526107da8133610b8f565b8887146107f95760405162461bcd60e51b81526004016106b19061150b565b8885146108185760405162461bcd60e51b81526004016106b19061150b565b600061082a8b8b8b8b8b8b8b8b61092b565b90506108368184610bf3565b60005b8a8110156108f45780827f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8e8e858181106108765761087661154e565b905060200201602081019061088b9190611564565b8d8d8681811061089d5761089d61154e565b905060200201358c8c878181106108b6576108b661154e565b90506020028101906108c8919061157f565b8c8b6040516108dc969594939291906114ce565b60405180910390a36108ed816115dc565b9050610839565b505050505050505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000888888888888888860405160200161094c98979695949392919061168c565b60405160208183030381529060405280519060200120905098975050505050505050565b6000805160206119008339815191526109898133610b8f565b610992826106c8565b6109f85760405162461bcd60e51b815260206004820152603160248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e2063616044820152701b9b9bdd0818994818d85b98d95b1b1959607a1b60648201526084016106b1565b6000828152600160205260408082208290555183917fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7091a25050565b600082815260208190526040902060010154610a508133610b8f565b6106278383610f4f565b7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63610a86816000610902565b610a9457610a948133610b8f565b878614610ab35760405162461bcd60e51b81526004016106b19061150b565b878414610ad25760405162461bcd60e51b81526004016106b19061150b565b6000610ae48a8a8a8a8a8a8a8a61092b565b9050610af08185610ce2565b60005b89811015610b7957610b6982828d8d85818110610b1257610b1261154e565b9050602002016020810190610b279190611564565b8c8c86818110610b3957610b3961154e565b905060200201358b8b87818110610b5257610b5261154e565b9050602002810190610b64919061157f565b610d7e565b610b72816115dc565b9050610af3565b50610b8381610e92565b50505050505050505050565b610b998282610902565b6106c457610bb1816001600160a01b03166014610fb4565b610bbc836020610fb4565b604051602001610bcd929190611767565b60408051601f198184030181529082905262461bcd60e51b82526106b1916004016117dc565b610bfc8261062c565b15610c615760405162461bcd60e51b815260206004820152602f60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20616c60448201526e1c9958591e481cd8da19591d5b1959608a1b60648201526084016106b1565b600254811015610cc25760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a20696e73756666696369656e746044820152652064656c617960d01b60648201526084016106b1565b610ccc814261180f565b6000928352600160205260409092209190915550565b610ceb826105db565b610d075760405162461bcd60e51b81526004016106b190611827565b801580610d235750600081815260016020819052604090912054145b6106c45760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a206d697373696e6720646570656044820152656e64656e637960d01b60648201526084016106b1565b6000846001600160a01b0316848484604051610d9b929190611871565b60006040518083038185875af1925050503d8060008114610dd8576040519150601f19603f3d011682016040523d82523d6000602084013e610ddd565b606091505b5050905080610e4a5760405162461bcd60e51b815260206004820152603360248201527f54696d656c6f636b436f6e74726f6c6c65723a20756e6465726c79696e6720746044820152721c985b9cd858dd1a5bdb881c995d995c9d1959606a1b60648201526084016106b1565b85877fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b5887878787604051610e819493929190611881565b60405180910390a350505050505050565b610e9b816105db565b610eb75760405162461bcd60e51b81526004016106b190611827565b600090815260016020819052604090912055565b610ed58282610902565b6106c4576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610f0b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610f598282610902565b156106c4576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60606000610fc38360026118b3565b610fce90600261180f565b67ffffffffffffffff811115610fe657610fe66118d2565b6040519080825280601f01601f191660200182016040528015611010576020820181803683370190505b509050600360fc1b8160008151811061102b5761102b61154e565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061105a5761105a61154e565b60200101906001600160f81b031916908160001a905350600061107e8460026118b3565b61108990600161180f565b90505b6001811115611101576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106110bd576110bd61154e565b1a60f81b8282815181106110d3576110d361154e565b60200101906001600160f81b031916908160001a90535060049490941c936110fa816118e8565b905061108c565b5083156105fa5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106b1565b80356001600160a01b038116811461116757600080fd5b919050565b60008083601f84011261117e57600080fd5b50813567ffffffffffffffff81111561119657600080fd5b6020830191508360208285010111156111ae57600080fd5b9250929050565b600080600080600080600060c0888a0312156111d057600080fd5b6111d988611150565b965060208801359550604088013567ffffffffffffffff8111156111fc57600080fd5b6112088a828b0161116c565b989b979a50986060810135976080820135975060a09091013595509350505050565b60006020828403121561123c57600080fd5b81356001600160e01b0319811681146105fa57600080fd5b60008060008060008060a0878903121561126d57600080fd5b61127687611150565b955060208701359450604087013567ffffffffffffffff81111561129957600080fd5b6112a589828a0161116c565b979a9699509760608101359660809091013595509350505050565b6000602082840312156112d257600080fd5b5035919050565b600080604083850312156112ec57600080fd5b823591506112fc60208401611150565b90509250929050565b60008083601f84011261131757600080fd5b50813567ffffffffffffffff81111561132f57600080fd5b6020830191508360208260051b85010111156111ae57600080fd5b600080600080600080600080600060c08a8c03121561136857600080fd5b893567ffffffffffffffff8082111561138057600080fd5b61138c8d838e01611305565b909b50995060208c01359150808211156113a557600080fd5b6113b18d838e01611305565b909950975060408c01359150808211156113ca57600080fd5b506113d78c828d01611305565b9a9d999c50979a969997986060880135976080810135975060a0013595509350505050565b60008060008060008060008060a0898b03121561141857600080fd5b883567ffffffffffffffff8082111561143057600080fd5b61143c8c838d01611305565b909a50985060208b013591508082111561145557600080fd5b6114618c838d01611305565b909850965060408b013591508082111561147a57600080fd5b506114878b828c01611305565b999c989b509699959896976060870135966080013595509350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038716815285602082015260a0604082015260006114f660a0830186886114a5565b60608301949094525060800152949350505050565b60208082526023908201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d616040820152620e8c6d60eb1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561157657600080fd5b6105fa82611150565b6000808335601e1984360301811261159657600080fd5b83018035915067ffffffffffffffff8211156115b157600080fd5b6020019150368190038213156111ae57600080fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156115f0576115f06115c6565b5060010190565b60008383855260208086019550808560051b8301018460005b8781101561167f57848303601f19018952813536889003601e1901811261163657600080fd5b8701803567ffffffffffffffff81111561164f57600080fd5b80360389131561165e57600080fd5b61166b85828885016114a5565b9a86019a9450505090830190600101611610565b5090979650505050505050565b60a0808252810188905260008960c08301825b8b8110156116cd576001600160a01b036116b884611150565b1682526020928301929091019060010161169f565b5083810360208501528881526001600160fb1b038911156116ed57600080fd5b8860051b9150818a60208301378181019150506020810160008152602084830301604085015261171e81888a6115f7565b6060850196909652505050608001529695505050505050565b60005b8381101561175257818101518382015260200161173a565b83811115611761576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161179f816017850160208801611737565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516117d0816028840160208801611737565b01602801949350505050565b60208152600082518060208401526117fb816040850160208701611737565b601f01601f19169190910160400192915050565b60008219821115611822576118226115c6565b500190565b6020808252602a908201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e206973604082015269206e6f7420726561647960b01b606082015260800190565b8183823760009101908152919050565b60018060a01b03851681528360208201526060604082015260006118a96060830184866114a5565b9695505050505050565b60008160001904831182151516156118cd576118cd6115c6565b500290565b634e487b7160e01b600052604160045260246000fd5b6000816118f7576118f76115c6565b50600019019056feb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1a2646970667358221220d1b7c508b5ad9142231e2b7295d7cf451a7cf8f6440a63d040f8b3487a853ce564736f6c634300080900335f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5b09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1d8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6300000000000000000000000017603ddb4a4f8d7a7e1fc45fa0059adc906c86000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000017603ddb4a4f8d7a7e1fc45fa0059adc906c8600","name":"BackedOracleFactory","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"london","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n    /**\n     * @dev Returns the current implementation of `proxy`.\n     *\n     * Requirements:\n     *\n     * - This contract must be the admin of `proxy`.\n     */\n    function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n        // We need to manually run the static call since the getter cannot be flagged as view\n        // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n        (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n        require(success);\n        return abi.decode(returndata, (address));\n    }\n\n    /**\n     * @dev Returns the current admin of `proxy`.\n     *\n     * Requirements:\n     *\n     * - This contract must be the admin of `proxy`.\n     */\n    function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n        // We need to manually run the static call since the getter cannot be flagged as view\n        // bytes4(keccak256(\"admin()\")) == 0xf851a440\n        (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n        require(success);\n        return abi.decode(returndata, (address));\n    }\n\n    /**\n     * @dev Changes the admin of `proxy` to `newAdmin`.\n     *\n     * Requirements:\n     *\n     * - This contract must be the current admin of `proxy`.\n     */\n    function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n        proxy.changeAdmin(newAdmin);\n    }\n\n    /**\n     * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n     *\n     * Requirements:\n     *\n     * - This contract must be the admin of `proxy`.\n     */\n    function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n        proxy.upgradeTo(implementation);\n    }\n\n    /**\n     * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n     * {TransparentUpgradeableProxy-upgradeToAndCall}.\n     *\n     * Requirements:\n     *\n     * - This contract must be the admin of `proxy`.\n     */\n    function upgradeAndCall(\n        TransparentUpgradeableProxy proxy,\n        address implementation,\n        bytes memory data\n    ) public payable virtual onlyOwner {\n        proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n    /**\n     * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n     * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n     */\n    constructor(\n        address _logic,\n        address admin_,\n        bytes memory _data\n    ) payable ERC1967Proxy(_logic, _data) {\n        assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n        _changeAdmin(admin_);\n    }\n\n    /**\n     * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n     */\n    modifier ifAdmin() {\n        if (msg.sender == _getAdmin()) {\n            _;\n        } else {\n            _fallback();\n        }\n    }\n\n    /**\n     * @dev Returns the current admin.\n     *\n     * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n     *\n     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n     */\n    function admin() external ifAdmin returns (address admin_) {\n        admin_ = _getAdmin();\n    }\n\n    /**\n     * @dev Returns the current implementation.\n     *\n     * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n     *\n     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n     */\n    function implementation() external ifAdmin returns (address implementation_) {\n        implementation_ = _implementation();\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {AdminChanged} event.\n     *\n     * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n     */\n    function changeAdmin(address newAdmin) external virtual ifAdmin {\n        _changeAdmin(newAdmin);\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy.\n     *\n     * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n     */\n    function upgradeTo(address newImplementation) external ifAdmin {\n        _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n     * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n     * proxied contract.\n     *\n     * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n     */\n    function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n        _upgradeToAndCall(newImplementation, data, true);\n    }\n\n    /**\n     * @dev Returns the current admin.\n     */\n    function _admin() internal view virtual returns (address) {\n        return _getAdmin();\n    }\n\n    /**\n     * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n     */\n    function _beforeFallback() internal virtual override {\n        require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n        super._beforeFallback();\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(isContract(target), \"Address: delegate call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length > 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Context.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/StorageSlot.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly {\n            r.slot := slot\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Strings.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        // Inspired by OraclizeAPI's implementation - MIT licence\n        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n        if (value == 0) {\n            return \"0\";\n        }\n        uint256 temp = value;\n        uint256 digits;\n        while (temp != 0) {\n            digits++;\n            temp /= 10;\n        }\n        bytes memory buffer = new bytes(digits);\n        while (value != 0) {\n            digits -= 1;\n            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n            value /= 10;\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        if (value == 0) {\n            return \"0x00\";\n        }\n        uint256 temp = value;\n        uint256 length = 0;\n        while (temp != 0) {\n            length++;\n            temp >>= 8;\n        }\n        return toHexString(value, length);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _HEX_SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/introspection/ERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},{"file_path":"contracts/oracle/BackedOracle.sol","source_code":"/**\n * SPDX-License-Identifier: MIT\n *\n * Copyright (c) 2021-2023 Backed Finance AG\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\npragma solidity 0.8.9;\n\nimport \"./BackedOracleInterface.sol\";\n\nimport \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\n\ncontract BackedOracle is AccessControlUpgradeable, AggregatorV2V3Interface {\n    uint8 public constant VERSION = 1;\n    uint8 public constant MAX_PERCENT_DIFFERENCE = 10;\n    uint32 public constant MAX_TIMESTAMP_AGE = 5 minutes;\n    uint32 public constant MIN_UPDATE_INTERVAL = 1 hours;\n\n    bytes32 public constant UPDATER_ROLE = keccak256(\"UPDATER_ROLE\");\n\n    struct RoundData {\n        int192 answer;\n        uint32 timestamp;\n    }\n\n    uint8 private _decimals;\n    string private _description;\n\n    mapping(uint256 => RoundData) private _roundData;\n    uint80 private _latestRoundNumber;\n\n    constructor() {\n        initialize(0, \"Backed Oracle Implementation\", address(0), address(0));\n    }\n\n    function initialize(\n        uint8 __decimals,\n        string memory __description,\n\n        address __admin,\n        address __updater\n    ) public initializer {\n        _decimals = __decimals;\n        _description = __description;\n\n        _grantRole(DEFAULT_ADMIN_ROLE, __admin);\n        _grantRole(UPDATER_ROLE, __updater);\n    }\n\n    function version() external view override returns (uint256) {\n        return VERSION;\n    }\n\n    function decimals() external view override returns (uint8) {\n        return _decimals;\n    }\n\n    function description() external view override returns (string memory) {\n        return _description;\n    }\n\n    function latestAnswer() external view override returns (int256) {\n        require(_latestRoundNumber != 0, \"No data present\");\n\n        return _roundData[_latestRoundNumber].answer;\n    }\n\n    function latestTimestamp() external view override returns (uint256) {\n        require(_latestRoundNumber != 0, \"No data present\");\n\n        return _roundData[_latestRoundNumber].timestamp;\n    }\n\n    function latestRound() external view override returns (uint256) {\n        require(_latestRoundNumber != 0, \"No data present\");\n\n        return _latestRoundNumber;\n    }\n\n    function latestRoundData()\n        external\n        view\n        override\n        returns (uint80, int256, uint256, uint256, uint80)\n    {\n        require(_latestRoundNumber != 0, \"No data present\");\n\n        return (\n            uint80(_latestRoundNumber),\n            _roundData[_latestRoundNumber].answer,\n            _roundData[_latestRoundNumber].timestamp,\n            _roundData[_latestRoundNumber].timestamp,\n            uint80(_latestRoundNumber)\n        );\n    }\n\n    function getAnswer(\n        uint256 roundId\n    ) external view override returns (int256) {\n        require(roundId <= _latestRoundNumber, \"No data present\");\n\n        return _roundData[roundId].answer;\n    }\n\n    function getTimestamp(\n        uint256 roundId\n    ) external view override returns (uint256) {\n        require(roundId <= _latestRoundNumber, \"No data present\");\n\n        return _roundData[roundId].timestamp;\n    }\n\n    function getRoundData(\n        uint80 roundId\n    )\n        external\n        view\n        override\n        returns (uint80, int256, uint256, uint256, uint80)\n    {\n        require(roundId <= _latestRoundNumber, \"No data present\");\n\n        return (\n            roundId,\n            _roundData[roundId].answer,\n            _roundData[roundId].timestamp,\n            _roundData[roundId].timestamp,\n            roundId\n        );\n    }\n\n    function updateAnswer(\n        int192 newAnswer,\n        uint32 newTimestamp\n    ) external onlyRole(UPDATER_ROLE) {\n        int256 latestAnswer = _roundData[_latestRoundNumber].answer;\n        uint256 latestTimestamp = _roundData[_latestRoundNumber].timestamp;\n\n        // Timestamp is actual timestamp\n        require(\n            newTimestamp < block.timestamp,\n            \"Timestamp cannot be in the future\"\n        );\n\n        // Check that the timestamp is not too old\n        require(\n            block.timestamp - newTimestamp <= MAX_TIMESTAMP_AGE,\n            \"Timestamp is too old\"\n        );\n\n        // The timestamp is more than the last timestamp\n        require(\n            newTimestamp > latestTimestamp,\n            \"Timestamp is older than the last update\"\n        );\n\n        // The last update happened more than MIN_UPDATE_INTERVAL ago\n        require(\n            newTimestamp - latestTimestamp > MIN_UPDATE_INTERVAL,\n            \"Timestamp cannot be updated too often\"\n        );\n\n        // Limit the value to at most MAX_PERCENT_DIFFERENCE% different from the last value\n        if (latestAnswer > 0) {\n            int192 allowedDeviation = int192(\n                (latestAnswer * int8(MAX_PERCENT_DIFFERENCE)) / 100\n            );\n\n            if (newAnswer > latestAnswer + allowedDeviation) {\n                newAnswer = int192(latestAnswer + allowedDeviation);\n            } else if (newAnswer < latestAnswer - allowedDeviation) {\n                newAnswer = int192(latestAnswer - allowedDeviation);\n            }\n        }\n\n        uint80 newRound = _latestRoundNumber + 1;\n\n        _latestRoundNumber = newRound;\n        _roundData[newRound] = RoundData(newAnswer, newTimestamp);\n\n        emit AnswerUpdated(newAnswer, newRound, newTimestamp);\n        emit NewRound(newRound, msg.sender, newTimestamp);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControlUpgradeable.sol\";\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../utils/StringsUpgradeable.sol\";\nimport \"../utils/introspection/ERC165Upgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {\n    function __AccessControl_init() internal onlyInitializing {\n    }\n\n    function __AccessControl_init_unchained() internal onlyInitializing {\n    }\n    struct RoleData {\n        mapping(address => bool) members;\n        bytes32 adminRole;\n    }\n\n    mapping(bytes32 => RoleData) private _roles;\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with a standardized message including the required role.\n     *\n     * The format of the revert reason is given by the following regular expression:\n     *\n     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n     *\n     * _Available since v4.1._\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role, _msgSender());\n        _;\n    }\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n        return _roles[role].members[account];\n    }\n\n    /**\n     * @dev Revert with a standard message if `account` is missing `role`.\n     *\n     * The format of the revert reason is given by the following regular expression:\n     *\n     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert(\n                string(\n                    abi.encodePacked(\n                        \"AccessControl: account \",\n                        StringsUpgradeable.toHexString(uint160(account), 20),\n                        \" is missing role \",\n                        StringsUpgradeable.toHexString(uint256(role), 32)\n                    )\n                )\n            );\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n        return _roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) public virtual override {\n        require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event. Note that unlike {grantRole}, this function doesn't perform any\n     * checks on the calling account.\n     *\n     * [WARNING]\n     * ====\n     * This function should only be called from the constructor when setting\n     * up the initial roles for the system.\n     *\n     * Using this function in any other way is effectively circumventing the admin\n     * system imposed by {AccessControl}.\n     * ====\n     *\n     * NOTE: This function is deprecated in favor of {_grantRole}.\n     */\n    function _setupRole(bytes32 role, address account) internal virtual {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        _roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * Internal function without access restriction.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual {\n        if (!hasRole(role, account)) {\n            _roles[role].members[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n        }\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * Internal function without access restriction.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual {\n        if (hasRole(role, account)) {\n            _roles[role].members[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n        }\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControlUpgradeable {\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {AccessControl-_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) external;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length > 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n    bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        // Inspired by OraclizeAPI's implementation - MIT licence\n        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n        if (value == 0) {\n            return \"0\";\n        }\n        uint256 temp = value;\n        uint256 digits;\n        while (temp != 0) {\n            digits++;\n            temp /= 10;\n        }\n        bytes memory buffer = new bytes(digits);\n        while (value != 0) {\n            digits -= 1;\n            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n            value /= 10;\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        if (value == 0) {\n            return \"0x00\";\n        }\n        uint256 temp = value;\n        uint256 length = 0;\n        while (temp != 0) {\n            length++;\n            temp >>= 8;\n        }\n        return toHexString(value, length);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _HEX_SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {\n    function __ERC165_init() internal onlyInitializing {\n    }\n\n    function __ERC165_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IERC165Upgradeable).interfaceId;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165Upgradeable {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},{"file_path":"@openzeppelin/contracts/access/AccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n    struct RoleData {\n        mapping(address => bool) members;\n        bytes32 adminRole;\n    }\n\n    mapping(bytes32 => RoleData) private _roles;\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with a standardized message including the required role.\n     *\n     * The format of the revert reason is given by the following regular expression:\n     *\n     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n     *\n     * _Available since v4.1._\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role, _msgSender());\n        _;\n    }\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n        return _roles[role].members[account];\n    }\n\n    /**\n     * @dev Revert with a standard message if `account` is missing `role`.\n     *\n     * The format of the revert reason is given by the following regular expression:\n     *\n     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert(\n                string(\n                    abi.encodePacked(\n                        \"AccessControl: account \",\n                        Strings.toHexString(uint160(account), 20),\n                        \" is missing role \",\n                        Strings.toHexString(uint256(role), 32)\n                    )\n                )\n            );\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n        return _roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) public virtual override {\n        require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event. Note that unlike {grantRole}, this function doesn't perform any\n     * checks on the calling account.\n     *\n     * [WARNING]\n     * ====\n     * This function should only be called from the constructor when setting\n     * up the initial roles for the system.\n     *\n     * Using this function in any other way is effectively circumventing the admin\n     * system imposed by {AccessControl}.\n     * ====\n     *\n     * NOTE: This function is deprecated in favor of {_grantRole}.\n     */\n    function _setupRole(bytes32 role, address account) internal virtual {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        _roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * Internal function without access restriction.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual {\n        if (!hasRole(role, account)) {\n            _roles[role].members[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n        }\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * Internal function without access restriction.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual {\n        if (hasRole(role, account)) {\n            _roles[role].members[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/access/IAccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {AccessControl-_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) external;\n}\n"},{"file_path":"@openzeppelin/contracts/access/Ownable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    constructor() {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/governance/TimelockController.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (governance/TimelockController.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../access/AccessControl.sol\";\n\n/**\n * @dev Contract module which acts as a timelocked controller. When set as the\n * owner of an `Ownable` smart contract, it enforces a timelock on all\n * `onlyOwner` maintenance operations. This gives time for users of the\n * controlled contract to exit before a potentially dangerous maintenance\n * operation is applied.\n *\n * By default, this contract is self administered, meaning administration tasks\n * have to go through the timelock process. The proposer (resp executor) role\n * is in charge of proposing (resp executing) operations. A common use case is\n * to position this {TimelockController} as the owner of a smart contract, with\n * a multisig or a DAO as the sole proposer.\n *\n * _Available since v3.3._\n */\ncontract TimelockController is AccessControl {\n    bytes32 public constant TIMELOCK_ADMIN_ROLE = keccak256(\"TIMELOCK_ADMIN_ROLE\");\n    bytes32 public constant PROPOSER_ROLE = keccak256(\"PROPOSER_ROLE\");\n    bytes32 public constant EXECUTOR_ROLE = keccak256(\"EXECUTOR_ROLE\");\n    uint256 internal constant _DONE_TIMESTAMP = uint256(1);\n\n    mapping(bytes32 => uint256) private _timestamps;\n    uint256 private _minDelay;\n\n    /**\n     * @dev Emitted when a call is scheduled as part of operation `id`.\n     */\n    event CallScheduled(\n        bytes32 indexed id,\n        uint256 indexed index,\n        address target,\n        uint256 value,\n        bytes data,\n        bytes32 predecessor,\n        uint256 delay\n    );\n\n    /**\n     * @dev Emitted when a call is performed as part of operation `id`.\n     */\n    event CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data);\n\n    /**\n     * @dev Emitted when operation `id` is cancelled.\n     */\n    event Cancelled(bytes32 indexed id);\n\n    /**\n     * @dev Emitted when the minimum delay for future operations is modified.\n     */\n    event MinDelayChange(uint256 oldDuration, uint256 newDuration);\n\n    /**\n     * @dev Initializes the contract with a given `minDelay`.\n     */\n    constructor(\n        uint256 minDelay,\n        address[] memory proposers,\n        address[] memory executors\n    ) {\n        _setRoleAdmin(TIMELOCK_ADMIN_ROLE, TIMELOCK_ADMIN_ROLE);\n        _setRoleAdmin(PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE);\n        _setRoleAdmin(EXECUTOR_ROLE, TIMELOCK_ADMIN_ROLE);\n\n        // deployer + self administration\n        _setupRole(TIMELOCK_ADMIN_ROLE, _msgSender());\n        _setupRole(TIMELOCK_ADMIN_ROLE, address(this));\n\n        // register proposers\n        for (uint256 i = 0; i < proposers.length; ++i) {\n            _setupRole(PROPOSER_ROLE, proposers[i]);\n        }\n\n        // register executors\n        for (uint256 i = 0; i < executors.length; ++i) {\n            _setupRole(EXECUTOR_ROLE, executors[i]);\n        }\n\n        _minDelay = minDelay;\n        emit MinDelayChange(0, minDelay);\n    }\n\n    /**\n     * @dev Modifier to make a function callable only by a certain role. In\n     * addition to checking the sender's role, `address(0)` 's role is also\n     * considered. Granting a role to `address(0)` is equivalent to enabling\n     * this role for everyone.\n     */\n    modifier onlyRoleOrOpenRole(bytes32 role) {\n        if (!hasRole(role, address(0))) {\n            _checkRole(role, _msgSender());\n        }\n        _;\n    }\n\n    /**\n     * @dev Contract might receive/hold ETH as part of the maintenance process.\n     */\n    receive() external payable {}\n\n    /**\n     * @dev Returns whether an id correspond to a registered operation. This\n     * includes both Pending, Ready and Done operations.\n     */\n    function isOperation(bytes32 id) public view virtual returns (bool pending) {\n        return getTimestamp(id) > 0;\n    }\n\n    /**\n     * @dev Returns whether an operation is pending or not.\n     */\n    function isOperationPending(bytes32 id) public view virtual returns (bool pending) {\n        return getTimestamp(id) > _DONE_TIMESTAMP;\n    }\n\n    /**\n     * @dev Returns whether an operation is ready or not.\n     */\n    function isOperationReady(bytes32 id) public view virtual returns (bool ready) {\n        uint256 timestamp = getTimestamp(id);\n        return timestamp > _DONE_TIMESTAMP && timestamp <= block.timestamp;\n    }\n\n    /**\n     * @dev Returns whether an operation is done or not.\n     */\n    function isOperationDone(bytes32 id) public view virtual returns (bool done) {\n        return getTimestamp(id) == _DONE_TIMESTAMP;\n    }\n\n    /**\n     * @dev Returns the timestamp at with an operation becomes ready (0 for\n     * unset operations, 1 for done operations).\n     */\n    function getTimestamp(bytes32 id) public view virtual returns (uint256 timestamp) {\n        return _timestamps[id];\n    }\n\n    /**\n     * @dev Returns the minimum delay for an operation to become valid.\n     *\n     * This value can be changed by executing an operation that calls `updateDelay`.\n     */\n    function getMinDelay() public view virtual returns (uint256 duration) {\n        return _minDelay;\n    }\n\n    /**\n     * @dev Returns the identifier of an operation containing a single\n     * transaction.\n     */\n    function hashOperation(\n        address target,\n        uint256 value,\n        bytes calldata data,\n        bytes32 predecessor,\n        bytes32 salt\n    ) public pure virtual returns (bytes32 hash) {\n        return keccak256(abi.encode(target, value, data, predecessor, salt));\n    }\n\n    /**\n     * @dev Returns the identifier of an operation containing a batch of\n     * transactions.\n     */\n    function hashOperationBatch(\n        address[] calldata targets,\n        uint256[] calldata values,\n        bytes[] calldata datas,\n        bytes32 predecessor,\n        bytes32 salt\n    ) public pure virtual returns (bytes32 hash) {\n        return keccak256(abi.encode(targets, values, datas, predecessor, salt));\n    }\n\n    /**\n     * @dev Schedule an operation containing a single transaction.\n     *\n     * Emits a {CallScheduled} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'proposer' role.\n     */\n    function schedule(\n        address target,\n        uint256 value,\n        bytes calldata data,\n        bytes32 predecessor,\n        bytes32 salt,\n        uint256 delay\n    ) public virtual onlyRole(PROPOSER_ROLE) {\n        bytes32 id = hashOperation(target, value, data, predecessor, salt);\n        _schedule(id, delay);\n        emit CallScheduled(id, 0, target, value, data, predecessor, delay);\n    }\n\n    /**\n     * @dev Schedule an operation containing a batch of transactions.\n     *\n     * Emits one {CallScheduled} event per transaction in the batch.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'proposer' role.\n     */\n    function scheduleBatch(\n        address[] calldata targets,\n        uint256[] calldata values,\n        bytes[] calldata datas,\n        bytes32 predecessor,\n        bytes32 salt,\n        uint256 delay\n    ) public virtual onlyRole(PROPOSER_ROLE) {\n        require(targets.length == values.length, \"TimelockController: length mismatch\");\n        require(targets.length == datas.length, \"TimelockController: length mismatch\");\n\n        bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt);\n        _schedule(id, delay);\n        for (uint256 i = 0; i < targets.length; ++i) {\n            emit CallScheduled(id, i, targets[i], values[i], datas[i], predecessor, delay);\n        }\n    }\n\n    /**\n     * @dev Schedule an operation that is to becomes valid after a given delay.\n     */\n    function _schedule(bytes32 id, uint256 delay) private {\n        require(!isOperation(id), \"TimelockController: operation already scheduled\");\n        require(delay >= getMinDelay(), \"TimelockController: insufficient delay\");\n        _timestamps[id] = block.timestamp + delay;\n    }\n\n    /**\n     * @dev Cancel an operation.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'proposer' role.\n     */\n    function cancel(bytes32 id) public virtual onlyRole(PROPOSER_ROLE) {\n        require(isOperationPending(id), \"TimelockController: operation cannot be cancelled\");\n        delete _timestamps[id];\n\n        emit Cancelled(id);\n    }\n\n    /**\n     * @dev Execute an (ready) operation containing a single transaction.\n     *\n     * Emits a {CallExecuted} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'executor' role.\n     */\n    function execute(\n        address target,\n        uint256 value,\n        bytes calldata data,\n        bytes32 predecessor,\n        bytes32 salt\n    ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) {\n        bytes32 id = hashOperation(target, value, data, predecessor, salt);\n        _beforeCall(id, predecessor);\n        _call(id, 0, target, value, data);\n        _afterCall(id);\n    }\n\n    /**\n     * @dev Execute an (ready) operation containing a batch of transactions.\n     *\n     * Emits one {CallExecuted} event per transaction in the batch.\n     *\n     * Requirements:\n     *\n     * - the caller must have the 'executor' role.\n     */\n    function executeBatch(\n        address[] calldata targets,\n        uint256[] calldata values,\n        bytes[] calldata datas,\n        bytes32 predecessor,\n        bytes32 salt\n    ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) {\n        require(targets.length == values.length, \"TimelockController: length mismatch\");\n        require(targets.length == datas.length, \"TimelockController: length mismatch\");\n\n        bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt);\n        _beforeCall(id, predecessor);\n        for (uint256 i = 0; i < targets.length; ++i) {\n            _call(id, i, targets[i], values[i], datas[i]);\n        }\n        _afterCall(id);\n    }\n\n    /**\n     * @dev Checks before execution of an operation's calls.\n     */\n    function _beforeCall(bytes32 id, bytes32 predecessor) private view {\n        require(isOperationReady(id), \"TimelockController: operation is not ready\");\n        require(predecessor == bytes32(0) || isOperationDone(predecessor), \"TimelockController: missing dependency\");\n    }\n\n    /**\n     * @dev Checks after execution of an operation's calls.\n     */\n    function _afterCall(bytes32 id) private {\n        require(isOperationReady(id), \"TimelockController: operation is not ready\");\n        _timestamps[id] = _DONE_TIMESTAMP;\n    }\n\n    /**\n     * @dev Execute an operation's call.\n     *\n     * Emits a {CallExecuted} event.\n     */\n    function _call(\n        bytes32 id,\n        uint256 index,\n        address target,\n        uint256 value,\n        bytes calldata data\n    ) private {\n        (bool success, ) = target.call{value: value}(data);\n        require(success, \"TimelockController: underlying transaction reverted\");\n\n        emit CallExecuted(id, index, target, value, data);\n    }\n\n    /**\n     * @dev Changes the minimum timelock duration for future operations.\n     *\n     * Emits a {MinDelayChange} event.\n     *\n     * Requirements:\n     *\n     * - the caller must be the timelock itself. This can only be achieved by scheduling and later executing\n     * an operation where the timelock is the target and the data is the ABI-encoded call to this function.\n     */\n    function updateDelay(uint256 newDelay) external virtual {\n        require(msg.sender == address(this), \"TimelockController: caller must be timelock\");\n        emit MinDelayChange(_minDelay, newDelay);\n        _minDelay = newDelay;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/interfaces/draft-IERC1822.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"},{"file_path":"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n    /**\n     * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n     *\n     * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n     * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n     */\n    constructor(address _logic, bytes memory _data) payable {\n        assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n        _upgradeToAndCall(_logic, _data, false);\n    }\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function _implementation() internal view virtual override returns (address impl) {\n        return ERC1967Upgrade._getImplementation();\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n    // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function _getImplementation() internal view returns (address) {\n        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Perform implementation upgrade\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeTo(address newImplementation) internal {\n        _setImplementation(newImplementation);\n        emit Upgraded(newImplementation);\n    }\n\n    /**\n     * @dev Perform implementation upgrade with additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCall(\n        address newImplementation,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        _upgradeTo(newImplementation);\n        if (data.length > 0 || forceCall) {\n            Address.functionDelegateCall(newImplementation, data);\n        }\n    }\n\n    /**\n     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(\n        address newImplementation,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        // Upgrades from old implementations will perform a rollback test. This test requires the new\n        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n        // this special case will break upgrade paths from old UUPS implementation to new ones.\n        if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n            _setImplementation(newImplementation);\n        } else {\n            try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n                require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n            } catch {\n                revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n            }\n            _upgradeToAndCall(newImplementation, data, forceCall);\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Returns the current admin.\n     */\n    function _getAdmin() internal view returns (address) {\n        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {AdminChanged} event.\n     */\n    function _changeAdmin(address newAdmin) internal {\n        emit AdminChanged(_getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n     */\n    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Emitted when the beacon is upgraded.\n     */\n    event BeaconUpgraded(address indexed beacon);\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function _getBeacon() internal view returns (address) {\n        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the EIP1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n        require(\n            Address.isContract(IBeacon(newBeacon).implementation()),\n            \"ERC1967: beacon implementation is not a contract\"\n        );\n        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n    }\n\n    /**\n     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n     *\n     * Emits a {BeaconUpgraded} event.\n     */\n    function _upgradeBeaconToAndCall(\n        address newBeacon,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        _setBeacon(newBeacon);\n        emit BeaconUpgraded(newBeacon);\n        if (data.length > 0 || forceCall) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/proxy/Proxy.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n    /**\n     * @dev Delegates the current call to `implementation`.\n     *\n     * This function does not return to its internal call site, it will return directly to the external caller.\n     */\n    function _delegate(address implementation) internal virtual {\n        assembly {\n            // Copy msg.data. We take full control of memory in this inline assembly\n            // block because it will not return to Solidity code. We overwrite the\n            // Solidity scratch pad at memory position 0.\n            calldatacopy(0, 0, calldatasize())\n\n            // Call the implementation.\n            // out and outsize are 0 because we don't know the size yet.\n            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n            // Copy the returned data.\n            returndatacopy(0, 0, returndatasize())\n\n            switch result\n            // delegatecall returns 0 on error.\n            case 0 {\n                revert(0, returndatasize())\n            }\n            default {\n                return(0, returndatasize())\n            }\n        }\n    }\n\n    /**\n     * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n     * and {_fallback} should delegate.\n     */\n    function _implementation() internal view virtual returns (address);\n\n    /**\n     * @dev Delegates the current call to the address returned by `_implementation()`.\n     *\n     * This function does not return to its internall call site, it will return directly to the external caller.\n     */\n    function _fallback() internal virtual {\n        _beforeFallback();\n        _delegate(_implementation());\n    }\n\n    /**\n     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n     * function in the contract matches the call data.\n     */\n    fallback() external payable virtual {\n        _fallback();\n    }\n\n    /**\n     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n     * is empty.\n     */\n    receive() external payable virtual {\n        _fallback();\n    }\n\n    /**\n     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n     * call, or as part of the Solidity `fallback` or `receive` functions.\n     *\n     * If overriden should call `super._beforeFallback()`.\n     */\n    function _beforeFallback() internal virtual {}\n}\n"},{"file_path":"@openzeppelin/contracts/proxy/beacon/IBeacon.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {BeaconProxy} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},{"file_path":"contracts/oracle/BackedOracleForwarder.sol","source_code":"/**\n * SPDX-License-Identifier: MIT\n *\n * Copyright (c) 2021-2023 Backed Finance AG\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\npragma solidity 0.8.9;\n\nimport \"./BackedOracleInterface.sol\";\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract BackedOracleForwarder is Ownable, AggregatorV2V3Interface {\n    AggregatorV2V3Interface public _upstreamOracle;\n\n    constructor(address __upstreamOracle, address __owner) {\n        _upstreamOracle = AggregatorV2V3Interface(__upstreamOracle);\n        _transferOwnership(__owner);\n    }\n\n    function version() external view returns (uint256) {\n        return _upstreamOracle.version();\n    }\n\n    function decimals() external view returns (uint8) {\n        return _upstreamOracle.decimals();\n    }\n\n    function description() external view returns (string memory) {\n        return _upstreamOracle.description();\n    }\n\n    function latestAnswer() external view returns (int256) {\n        return _upstreamOracle.latestAnswer();\n    }\n\n    function latestTimestamp() external view returns (uint256) {\n        return _upstreamOracle.latestTimestamp();\n    }\n\n    function latestRound() external view returns (uint256) {\n        return _upstreamOracle.latestRound();\n    }\n\n    function latestRoundData()\n        external\n        view\n        returns (uint80, int256, uint256, uint256, uint80)\n    {\n        return _upstreamOracle.latestRoundData();\n    }\n\n    function getAnswer(uint256 roundId) external view returns (int256) {\n        return _upstreamOracle.getAnswer(roundId);\n    }\n\n    function getTimestamp(uint256 roundId) external view returns (uint256) {\n        return _upstreamOracle.getTimestamp(roundId);\n    }\n\n    function getRoundData(\n        uint80 roundId\n    ) external view returns (uint80, int256, uint256, uint256, uint80) {\n        return _upstreamOracle.getRoundData(roundId);\n    }\n\n    function setUpstreamOracle(address __upstreamOracle) external onlyOwner {\n        _upstreamOracle = AggregatorV2V3Interface(__upstreamOracle);\n    }\n}\n"},{"file_path":"contracts/oracle/BackedOracleInterface.sol","source_code":"/**\n * SPDX-License-Identifier: MIT\n *\n * Copyright (c) 2021-2023 Backed Finance AG\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\npragma solidity 0.8.9;\n\n\ninterface AggregatorInterface {\n  function latestAnswer() external view returns (int256);\n\n  function latestTimestamp() external view returns (uint256);\n\n  function latestRound() external view returns (uint256);\n\n  function getAnswer(uint256 roundId) external view returns (int256);\n\n  function getTimestamp(uint256 roundId) external view returns (uint256);\n\n  event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);\n  event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);\n}\n\n\ninterface AggregatorV3Interface {\n  function version() external view returns (uint256);\n  function decimals() external view returns (uint8);\n  function description() external view returns (string memory);\n\n  // getRoundData and latestRoundData should both raise \"No data present\"\n  // if they do not have data to report, instead of returning unset values\n  // which could be misinterpreted as actual reported values.\n  function getRoundData(uint80 _roundId)\n  external\n  view\n  returns (\n    uint80 roundId,\n    int256 answer,\n    uint256 startedAt,\n    uint256 updatedAt,\n    uint80 answeredInRound\n  );\n\n  function latestRoundData()\n  external\n  view\n  returns (\n    uint80 roundId,\n    int256 answer,\n    uint256 startedAt,\n    uint256 updatedAt,\n    uint80 answeredInRound\n  );\n\n}\n\ninterface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface\n{\n}"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address[]","name":"timelockWorkers","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"NewImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOracle","type":"address"}],"name":"NewOracle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOracleForwarder","type":"address"}],"name":"NewOracleForwarder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"string","name":"description","type":"string"},{"internalType":"address","name":"oracleUpdater","type":"address"}],"name":"deployOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"contract BackedOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyAdmin","outputs":[{"internalType":"contract ProxyAdmin","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelockController","outputs":[{"internalType":"contract TimelockController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"updateImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":"0x00000000000000000000000017603ddb4a4f8d7a7e1fc45fa0059adc906c86000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000017603ddb4a4f8d7a7e1fc45fa0059adc906c8600"}