UNPKG

@dolomite-exchange/dolomite-margin

Version:

Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol

402 lines 172 kB
{ "contractName": "ChainlinkOracleSentinel", "abi": [ { "inputs": [ { "internalType": "uint256", "name": "_gracePeriod", "type": "uint256" }, { "internalType": "address", "name": "_sequencerUptimeFeed", "type": "address" }, { "internalType": "address", "name": "_dolomiteMargin", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "gracePeriod", "type": "uint256" } ], "name": "GracePeriodSet", "type": "event" }, { "constant": true, "inputs": [], "name": "DOLOMITE_MARGIN", "outputs": [ { "internalType": "contract IDolomiteMargin", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "SEQUENCER_UPTIME_FEED", "outputs": [ { "internalType": "contract IChainlinkAggregator", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "gracePeriod", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256", "name": "_gracePeriod", "type": "uint256" } ], "name": "ownerSetGracePeriod", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "isBorrowAllowed", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isLiquidationAllowed", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_gracePeriod\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_sequencerUptimeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_dolomiteMargin\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gracePeriod\",\"type\":\"uint256\"}],\"name\":\"GracePeriodSet\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"DOLOMITE_MARGIN\",\"outputs\":[{\"internalType\":\"contract IDolomiteMargin\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"SEQUENCER_UPTIME_FEED\",\"outputs\":[{\"internalType\":\"contract IChainlinkAggregator\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"gracePeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isBorrowAllowed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isLiquidationAllowed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_gracePeriod\",\"type\":\"uint256\"}],\"name\":\"ownerSetGracePeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Dolomite * An implementation of the IOracleSentinel interface that gets data from the sequencer using Chainlink to check if it is online.\",\"methods\":{\"constructor\":{\"params\":{\"_sequencerUptimeFeed\":\"The contract for layer-2 that denotes whether or not the sequencer is currently online.\"}}},\"title\":\"ChainlinkOracleSentinel\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/oracles/ChainlinkOracleSentinel.sol\":\"ChainlinkOracleSentinel\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/helpers/OnlyDolomiteMargin.sol\":{\"keccak256\":\"0xe40babc0a6dd2a767d76f3e0f0a22de124c4c480f2b2227a7b924b44e57526ea\",\"urls\":[\"bzz-raw://458f7f1f16eacd4faae597090503dc1e58446e9d371640c77b2e01e3e3113f17\",\"dweb:/ipfs/QmXqTG4sWJeDh5XA286KarbqHT4qJ7m3dphS16enpqtQiX\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAccessControlAggregator.sol\":{\"keccak256\":\"0xbb94dc91633d6fb20e1d7e2b5ce1f11346e89a6bfc8c3ac5d163c35a3e4ad60a\",\"urls\":[\"bzz-raw://264c7c039caf44b1866769feb237010651730d546b54bb6f2b7bc77cf3b6c9c9\",\"dweb:/ipfs/QmX8TTF8E2G8TT1yig6qHC8amWDwaq1GG6iaKYTTHsYsjo\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAggregator.sol\":{\"keccak256\":\"0x0209c9f35dbe82857a6441d8d61f271baeb5098549eabf5fc6d33503d0d3e073\",\"urls\":[\"bzz-raw://2f6af7b5198548a9a5e3d8a30203d7cd003eae93cca22b8466c10e0dcfcbc367\",\"dweb:/ipfs/Qme3bQ58ZoQLYDoJQHnvEeQZqgqyWTFBYBmMoiem7LPXmz\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/oracles/ChainlinkOracleSentinel.sol\":{\"keccak256\":\"0x75a2791fc821b514c97724a388814a6a209b13cf37b7b198519a65861f75cd08\",\"urls\":[\"bzz-raw://cf58c9a4bb3926d766af65f77be9329d935104fd9de38b70465be8292cc33998\",\"dweb:/ipfs/QmeR978Jgc4bbY42bbzpsLqz9qAWVQKdmzs9bs9gJqDMKy\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IAccountRiskOverrideSetter.sol\":{\"keccak256\":\"0x5b9fde139ddfdaae7b650b3c3f6699e0e44605f0d9d3daadc1622eb06ad4c3f8\",\"urls\":[\"bzz-raw://2dfd5af24b6de63f94519c99fd8777a264d7cd11266fa2d525c7d72d96a9c7cf\",\"dweb:/ipfs/QmPg9fjhbnmBayZMh6yTG79xsK1PWSoAHA5pfwSXfnKKjF\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IDolomiteMargin.sol\":{\"keccak256\":\"0x7e86ed1ed04dc205245db9f4e7cf7cca60c3bfc46c57ade8129a463780647967\",\"urls\":[\"bzz-raw://f8fbd85afd334c12bdccbb6523ebea9172b27b7b4b132c4a48b4b4dd03ceeb2b\",\"dweb:/ipfs/QmU1srfSqBTz3kw7oz1KEzfTUJvphZiE4K8MRZcy9uJjv1\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IERC20Detailed.sol\":{\"keccak256\":\"0x22a62e2a8155e70300773721902f4b9118e17aa0bb5d9d1b046050a014cfb223\",\"urls\":[\"bzz-raw://03af737a33c552fbe58f6f1fbd5496854fdc28dd57be4365d56663725c083a18\",\"dweb:/ipfs/QmbgLqGAQEd6tXsZB8QaPNCAMiU6nNzP75wNbKdS65BuUF\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IInterestSetter.sol\":{\"keccak256\":\"0x546825f65490a30e29d0f6446acec49c1e895ce6b33d48ca5c05092725a63a57\",\"urls\":[\"bzz-raw://6ad3013aed985bdf6e6234ae0f7f37e6bba76c3470c33bfa24678cf19b3b412c\",\"dweb:/ipfs/QmfYaSBzxGpgiHoR7ontMJY66S5L26XwkLYoEuzsEjpbQH\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IOracleSentinel.sol\":{\"keccak256\":\"0xa94499fda55ef112640daed2cb1d06062e72c51c7b925c323b4e0ffa9b456ce5\",\"urls\":[\"bzz-raw://18b4a16acac577590a57f34f7ec6583e3cb35f575c948abb928b308d29cac1ab\",\"dweb:/ipfs/QmR1jLkzj6w7SjrdZ7GVW4V2vofSdMJwzjTqKpeUKABvxu\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0x3f7c3d1397390ea44c6d5e5730d49476431c3df3b28334fe38218de5edc31138\",\"urls\":[\"bzz-raw://63ebf926fca9ce33aaabaf93805686acc25daded1648d6dab59c8c4d05116918\",\"dweb:/ipfs/QmeGkDp7ycYstpfqCYBiqoCYwy876gabx8r42o5koj3H5A\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Account.sol\":{\"keccak256\":\"0x2059276ea5e478bd5ac7f2712e7b1b6c85d291c647a54b264909044844828e67\",\"urls\":[\"bzz-raw://f153777051d12131b13a57e5c3af10a2670927cfc7d22c9519ab20c9b4b9bc89\",\"dweb:/ipfs/QmQMP3qS5xDAVGYKDfNkbkSqBKozQGQsGqX4e8VyjRtxPS\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Actions.sol\":{\"keccak256\":\"0x7b2fcf441c034952dd042b6c8b20b148359db771e7c9ac07d06369560a9f0301\",\"urls\":[\"bzz-raw://84665ee4a780360fe6160d197ba98f0bf0ab0d7c6ad87bfed6226bf2f88d8d30\",\"dweb:/ipfs/QmRDfRdAd8hSXeu4SAeeYKkKoXBhStu7n4uReYBce2JD5Z\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Bits.sol\":{\"keccak256\":\"0x6d9a641163b2dd25e648c65f5d9e4949a57938e29ddc4c9dddefd74a9964aeef\",\"urls\":[\"bzz-raw://67e5a04ed4055faafbc100d6ccca9c54448ed378a1a8c71171562edda7bcbf7c\",\"dweb:/ipfs/QmYRikK3Xbgiq3UBJkgoo2zNUSSrShVabpRHmQj6iQHhrc\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Cache.sol\":{\"keccak256\":\"0xe57c80a7621a77fcb2acb9f883fb5248e71a6dce03bc2db56df0db3fee332950\",\"urls\":[\"bzz-raw://28e221c04629674490b9a0041d4f9a5f15e669dc0cc192a5df6e2c701c36369f\",\"dweb:/ipfs/QmaL3oh8c7v9cx91pB175pyCEuzxnhNTab4UxmBMsDYfUx\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Decimal.sol\":{\"keccak256\":\"0xd9a348c2b1eec076609ba12bbec6b9c2e4ea135790a7ef4f5411feb050af2144\",\"urls\":[\"bzz-raw://d5bcff29e47d5cd02d7a9966e9f44c46ccbb4f0e4adfc4b0b86646880677db39\",\"dweb:/ipfs/QmRKfJD4FFM1AvTynSFNx1NcDg94o9SAcjz7dvMaJCfecp\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/DolomiteMarginMath.sol\":{\"keccak256\":\"0x53f205f6a779d579be29faa9412c806a892b3e605fff092dfd9d14d936fa019f\",\"urls\":[\"bzz-raw://0ff936f89602a63b8e6a4eb4ce8f87673c0f45b7ce29694920905a3f0b5a6a69\",\"dweb:/ipfs/QmbYME9BeEvPC1ndV8EaUDX5fDMghLc3rocNUxFtgHmg8m\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/EnumerableSet.sol\":{\"keccak256\":\"0x41a3460e34b7b8635d936e35e6568ceb5354b638f53b884530e0d4875fa0f151\",\"urls\":[\"bzz-raw://d1a5ba866ee95d455afe5075dadd91fc71c2806371f2c1b358a1f67c632bb0df\",\"dweb:/ipfs/QmW4qCjmsG8J3UJv97GwDLDM7wt1K4yLDKAwzWMY7TFYi5\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Interest.sol\":{\"keccak256\":\"0x141a0ecb4a746f0e5767df4b99dbe33c6362df507ae9d5c02da1c1c17bc26df3\",\"urls\":[\"bzz-raw://9ff03e64a8ce5231acde07788624bf8c7a8ff55d90b157fa32f62fa887a0eff0\",\"dweb:/ipfs/QmUVxxWeE954RDXbmHJAYnHsXcit6rSXGqZUigu8t9oH2z\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Monetary.sol\":{\"keccak256\":\"0x5257274f2d4d3605f3e97ec45fb902111fe9a22506f0b4cf308ea933bc81bfe2\",\"urls\":[\"bzz-raw://85b8023b78805063a2ec8d376f1f5983994eabd96efd8ceadb0224dbb71c5678\",\"dweb:/ipfs/QmaDhzCzRqsuHuJfhToEC4pATQHwhh7yWWsjwfuRzFT1kG\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0x05a2a90b41b6a5f42f0a72da63d015fb0b406a9ba2172823352e522e8bf3a606\",\"urls\":[\"bzz-raw://19883f0c6d33266f756ec5c3d17539524aa24b993c46c33f8400801d09373a6c\",\"dweb:/ipfs/QmYX2fwK3vQQDSZLMrc5wMfeb8RWrcC9CGX8XECLty8QDk\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Storage.sol\":{\"keccak256\":\"0x9c27f3cd52af28c9b6bca18097b1793f114d08284d78417467d0d05f67e9e2a9\",\"urls\":[\"bzz-raw://d1ed0e7a7f76d59f30572996d4e164ab8fb5b2ec4bfca127983f9e936b904813\",\"dweb:/ipfs/QmePVYbgrY8Yw3Vf76pmEvE9pX916Jaa9we4kjM8tGM4J1\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Time.sol\":{\"keccak256\":\"0x87ee8d3c1d6e315a116426d8c8fc6f083e220fd14dda27fad4e8d7cab3dc7305\",\"urls\":[\"bzz-raw://7c20f2c52da682c3b5917fb6a19e81f43699b1d13c62b569ed723f34da72e766\",\"dweb:/ipfs/QmbXWYXi67nHBVNDKYUpo2E9ZaEVcHLvmXQkpYLMm1d5Vm\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Token.sol\":{\"keccak256\":\"0x095b5f8eb3665f6e246200311efc8a654fa3e90f9a1a522e27a4d089e8ab3917\",\"urls\":[\"bzz-raw://5db812b752a03d601d424e6e21be38153477082af0acf51b5c98eefa5553ed18\",\"dweb:/ipfs/QmbE549QUXYTurpx8hSMLBJvuBpfYqyNE6FBCgHJDY8PLf\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Types.sol\":{\"keccak256\":\"0xe1bab8c8799d83e86c7a49aaf815d8e3bc8d09562d46d44d921500db5e98de0e\",\"urls\":[\"bzz-raw://8ea3d0cc4fdab6dd9bba545a792170f939b342d8d1a7051c1c6365009af72658\",\"dweb:/ipfs/QmaLJgbavu88eEit6JPqfWnw6NmGBDZfveMXxumgWywBFG\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzz-raw://59fd025151435da35faa8093a5c7a17de02de9d08ad27275c5cdf05050820d91\",\"dweb:/ipfs/QmQMvwEcPhoRXzbXyrdoeRtvLoifUW9Qh7Luho7bmUPRkc\"]}},\"version\":1}", "bytecode": "0x60806040523480156200001157600080fd5b5060405162001078380380620010788339810160408190526200003491620002be565b600080546001600160a01b0319166001600160a01b0383161790556200005a8362000082565b50600180546001600160a01b0319166001600160a01b039290921691909117905550620004cc565b620000df6102588210157f436861696e6c696e6b4f7261636c6553656e74696e656c0000000000000000007f477261636520706572696f6420746f6f206c6f770000000000000000000000006200017f60201b6200074c1760201c565b6200013d620151808211157f436861696e6c696e6b4f7261636c6553656e74696e656c0000000000000000007f477261636520706572696f6420746f6f206869676800000000000000000000006200017f60201b6200074c1760201c565b60028190556040517f376aafccbf0af4f25bc38eb52182d4604f044d0d87e4cb26e1667b50e3a1de05906200017490839062000424565b60405180910390a150565b82620001f85762000199826001600160e01b03620001fd16565b6101d160f51b620001b3836001600160e01b03620001fd16565b604051602001620001c793929190620003d3565b60408051601f198184030181529082905262461bcd60e51b8252620001ef916004016200040a565b60405180910390fd5b505050565b60608082604051602001620002139190620003bc565b60408051601f19818403018152919052905060205b801562000285578151600019909101908290829081106200024557fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016156200027f576001018152905062000299565b62000228565b505060408051600081526020810190915290505b919050565b8051620002ab81620004a7565b92915050565b8051620002ab81620004c1565b600080600060608486031215620002d457600080fd5b6000620002e28686620002b1565b9350506020620002f5868287016200029e565b925050604062000308868287016200029e565b9150509250925092565b6200032762000321826200044e565b6200045b565b82525050565b6200032762000321826200045b565b6000620003498262000434565b62000355818562000299565b9350620003678185602086016200046a565b9290920192915050565b60006200037e8262000434565b6200038a818562000438565b93506200039c8185602086016200046a565b620003a7816200049d565b9093019392505050565b62000327816200045b565b6000620003ca82846200032d565b50602001919050565b6000620003e182866200033c565b9150620003ef828562000312565b6002820191506200040182846200033c565b95945050505050565b602080825281016200041d818462000371565b9392505050565b60208101620002ab8284620003b1565b5190565b90815260200190565b6000620002ab826200045e565b6001600160f01b03191690565b90565b6001600160a01b031690565b60005b83811015620004875781810151838201526020016200046d565b8381111562000497576000848401525b50505050565b601f01601f191690565b620004b28162000441565b8114620004be57600080fd5b50565b620004b2816200045b565b610b9c80620004dc6000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c80637a5d20ea116100505780637a5d20ea146100aa578063a06db7dc146100bf578063c5980182146100d457610072565b806315c14a4a1461007757806335784f1f1461009557806349aa2e81146100aa575b600080fd5b61007f6100dc565b60405161008c9190610a0b565b60405180910390f35b6100a86100a3366004610815565b6100f8565b005b6100b261021e565b60405161008c91906109fd565b6100c761022d565b60405161008c9190610a31565b61007f610233565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b336102116000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561016357600080fd5b505afa158015610177573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061019b91908101906107ef565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16147f4f6e6c79446f6c6f6d6974654d617267696e00000000000000000000000000007f4f6e6c7920446f6c6f6d697465206f776e65722063616e2063616c6c000000008461024f565b61021a82610354565b5050565b6000610228610435565b905090565b60025481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b8361034e5761025d836104fb565b7f3a20000000000000000000000000000000000000000000000000000000000000610287846104fb565b7f203c0000000000000000000000000000000000000000000000000000000000006102b1856105d5565b6040516102e79594939291907f3e000000000000000000000000000000000000000000000000000000000000009060200161099f565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a000000000000000000000000000000000000000000000000000000000825261034591600401610a19565b60405180910390fd5b50505050565b6103a46102588210157f436861696e6c696e6b4f7261636c6553656e74696e656c0000000000000000007f477261636520706572696f6420746f6f206c6f7700000000000000000000000061074c565b6103f5620151808211157f436861696e6c696e6b4f7261636c6553656e74696e656c0000000000000000007f477261636520706572696f6420746f6f2068696768000000000000000000000061074c565b60028190556040517f376aafccbf0af4f25bc38eb52182d4604f044d0d87e4cb26e1667b50e3a1de059061042a908390610a31565b60405180910390a150565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156104a257600080fd5b505afa1580156104b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104da9190810190610833565b505092509250508160001480156104f45750426002548201105b9250505090565b6060808260405160200161050f9190610959565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052905060205b80156105b85781517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091019082908290811061057b57fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016156105b357600101815290506105d0565b610542565b5060408051600080825260208201909252905b509150505b919050565b60408051602a808252606082810190935273ffffffffffffffffffffffffffffffffffffffff8416918391602082018180388339019050509050603060f81b8160008151811061062157fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350607860f81b8160018151811061066257fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b60148110156105cb57600281026106ad600f851661079b565b8382602903815181106106bc57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600484901c93506106fe600f851661079b565b83826028038151811061070d57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505060049290921c91600101610694565b826107965761075a826104fb565b7f3a20000000000000000000000000000000000000000000000000000000000000610784836104fb565b6040516020016102e79392919061096e565b505050565b6000600a8210156107b357506030810160f81b6105d0565b5060570160f81b90565b80516107c881610b30565b92915050565b80516107c881610b47565b80356107c881610b47565b80516107c881610b50565b60006020828403121561080157600080fd5b600061080d84846107bd565b949350505050565b60006020828403121561082757600080fd5b600061080d84846107d9565b600080600080600060a0868803121561084b57600080fd5b600061085788886107e4565b9550506020610868888289016107ce565b9450506040610879888289016107ce565b935050606061088a888289016107ce565b925050608061089b888289016107e4565b9150509295509295909350565b6108b181610a57565b82525050565b6108b16108c382610a5c565b610aa6565b6108b16108c382610a81565b6108b16108c382610aa6565b60006108eb82610a3f565b6108f581856105d0565b9350610905818560208601610adc565b9290920192915050565b6108b181610ad1565b600061092382610a3f565b61092d8185610a43565b935061093d818560208601610adc565b61094681610b08565b9093019392505050565b6108b181610aa6565b600061096582846108d4565b50602001919050565b600061097a82866108e0565b915061098682856108c8565b60028201915061099682846108e0565b95945050505050565b60006109ab82896108e0565b91506109b782886108c8565b6002820191506109c782876108e0565b91506109d382866108c8565b6002820191506109e382856108e0565b91506109ef82846108b7565b506001019695505050505050565b602081016107c882846108a8565b602081016107c8828461090f565b60208082528101610a2a8184610918565b9392505050565b602081016107c88284610950565b5190565b90815260200190565b60006107c882610aa9565b151590565b7fff000000000000000000000000000000000000000000000000000000000000001690565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b69ffffffffffffffffffff1690565b60006107c882610a4c565b60005b83811015610af7578181015183820152602001610adf565b8381111561034e5750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b610b3981610a4c565b8114610b4457600080fd5b50565b610b3981610aa6565b610b3981610ac256fea365627a7a72315820eb19a40503e542cae4769dd7d58d1e51c63e57bd06bdf979c946f557d64bc9016c6578706572696d656e74616cf564736f6c63430005100040", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100725760003560e01c80637a5d20ea116100505780637a5d20ea146100aa578063a06db7dc146100bf578063c5980182146100d457610072565b806315c14a4a1461007757806335784f1f1461009557806349aa2e81146100aa575b600080fd5b61007f6100dc565b60405161008c9190610a0b565b60405180910390f35b6100a86100a3366004610815565b6100f8565b005b6100b261021e565b60405161008c91906109fd565b6100c761022d565b60405161008c9190610a31565b61007f610233565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b336102116000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561016357600080fd5b505afa158015610177573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061019b91908101906107ef565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16147f4f6e6c79446f6c6f6d6974654d617267696e00000000000000000000000000007f4f6e6c7920446f6c6f6d697465206f776e65722063616e2063616c6c000000008461024f565b61021a82610354565b5050565b6000610228610435565b905090565b60025481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b8361034e5761025d836104fb565b7f3a20000000000000000000000000000000000000000000000000000000000000610287846104fb565b7f203c0000000000000000000000000000000000000000000000000000000000006102b1856105d5565b6040516102e79594939291907f3e000000000000000000000000000000000000000000000000000000000000009060200161099f565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a000000000000000000000000000000000000000000000000000000000825261034591600401610a19565b60405180910390fd5b50505050565b6103a46102588210157f436861696e6c696e6b4f7261636c6553656e74696e656c0000000000000000007f477261636520706572696f6420746f6f206c6f7700000000000000000000000061074c565b6103f5620151808211157f436861696e6c696e6b4f7261636c6553656e74696e656c0000000000000000007f477261636520706572696f6420746f6f2068696768000000000000000000000061074c565b60028190556040517f376aafccbf0af4f25bc38eb52182d4604f044d0d87e4cb26e1667b50e3a1de059061042a908390610a31565b60405180910390a150565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156104a257600080fd5b505afa1580156104b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104da9190810190610833565b505092509250508160001480156104f45750426002548201105b9250505090565b6060808260405160200161050f9190610959565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052905060205b80156105b85781517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091019082908290811061057b57fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016156105b357600101815290506105d0565b610542565b5060408051600080825260208201909252905b509150505b919050565b60408051602a808252606082810190935273ffffffffffffffffffffffffffffffffffffffff8416918391602082018180388339019050509050603060f81b8160008151811061062157fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350607860f81b8160018151811061066257fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b60148110156105cb57600281026106ad600f851661079b565b8382602903815181106106bc57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600484901c93506106fe600f851661079b565b83826028038151811061070d57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505060049290921c91600101610694565b826107965761075a826104fb565b7f3a20000000000000000000000000000000000000000000000000000000000000610784836104fb565b6040516020016102e79392919061096e565b505050565b6000600a8210156107b357506030810160f81b6105d0565b5060570160f81b90565b80516107c881610b30565b92915050565b80516107c881610b47565b80356107c881610b47565b80516107c881610b50565b60006020828403121561080157600080fd5b600061080d84846107bd565b949350505050565b60006020828403121561082757600080fd5b600061080d84846107d9565b600080600080600060a0868803121561084b57600080fd5b600061085788886107e4565b9550506020610868888289016107ce565b9450506040610879888289016107ce565b935050606061088a888289016107ce565b925050608061089b888289016107e4565b9150509295509295909350565b6108b181610a57565b82525050565b6108b16108c382610a5c565b610aa6565b6108b16108c382610a81565b6108b16108c382610aa6565b60006108eb82610a3f565b6108f581856105d0565b9350610905818560208601610adc565b9290920192915050565b6108b181610ad1565b600061092382610a3f565b61092d8185610a43565b935061093d818560208601610adc565b61094681610b08565b9093019392505050565b6108b181610aa6565b600061096582846108d4565b50602001919050565b600061097a82866108e0565b915061098682856108c8565b60028201915061099682846108e0565b95945050505050565b60006109ab82896108e0565b91506109b782886108c8565b6002820191506109c782876108e0565b91506109d382866108c8565b6002820191506109e382856108e0565b91506109ef82846108b7565b506001019695505050505050565b602081016107c882846108a8565b602081016107c8828461090f565b60208082528101610a2a8184610918565b9392505050565b602081016107c88284610950565b5190565b90815260200190565b60006107c882610aa9565b151590565b7fff000000000000000000000000000000000000000000000000000000000000001690565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b69ffffffffffffffffffff1690565b60006107c882610a4c565b60005b83811015610af7578181015183820152602001610adf565b8381111561034e5750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b610b3981610a4c565b8114610b4457600080fd5b50565b610b3981610aa6565b610b3981610ac256fea365627a7a72315820eb19a40503e542cae4769dd7d58d1e51c63e57bd06bdf979c946f557d64bc9016c6578706572696d656e74616cf564736f6c63430005100040", "sourceMap": "1146:2578:44:-;;;1759:309;8:9:-1;5:2;;;30:1;27;20:12;5:2;1759:309:44;;;;;;;;;;;;;;;;;;;;;1302:15:6;:50;;-1:-1:-1;;;;;;1302:50:6;-1:-1:-1;;;;;1302:50:6;;;;;1951:34:44;1972:12;1951:20;:34::i;:::-;-1:-1:-1;1995:21:44;:66;;-1:-1:-1;;;;;;1995:66:44;-1:-1:-1;;;;;1995:66:44;;;;;;;;;;-1:-1:-1;1146:2578:44;;2718:412;2803:116;2845:10;2829:12;:26;;2869:4;2803:116;:12;;;;;:116;;:::i;:::-;2929:115;2971:8;2955:12;:24;;2993:4;2929:115;:12;;;;;:115;;:::i;:::-;3054:11;:26;;;3095:28;;;;;;3068:12;;3095:28;;;;;;;;;;2718:412;:::o;1294:426:99:-;1428:4;1423:291;;1542:24;1561:4;-1:-1:-1;;;;;1542:18:99;:24;:::i;:::-;-1:-1:-1;;;1623:26:99;1642:6;-1:-1:-1;;;;;1623:18:99;:26;:::i;:::-;1500:171;;;;;;;;;;;;;;;-1:-1:-1;;26:21;;;22:32;6:49;;1500:171:99;;;;-1:-1:-1;;;1448:255:99;;;;;;;;;;;;;;;;1423:291;1294:426;;;:::o;6359:968::-;6463:12;6538:19;6577:5;6560:23;;;;;;;;;;;;;-1:-1:-1;;26:21;;;22:32;6:49;;6560:23:99;;;;-1:-1:-1;49:4;6689:572:99;6710:6;;6689:572;;6962:9;;-1:-1:-1;;6864:3:99;;;;6962:6;;6864:3;;6962:9;;;;;;;;;;;;:14;6958:293;;7017:1;7013:5;7143:22;;7150:6;-1:-1:-1;7223:13:99;;6958:293;6689:572;;;-1:-1:-1;;7308:12:99;;;7318:1;7308:12;;;;;;;;;-1:-1:-1;6359:968:99;;;;:::o;5:134:-1:-;83:13;;101:33;83:13;101:33;;;68:71;;;;;146:134;224:13;;242:33;224:13;242:33;;287:535;;;;436:2;424:9;415:7;411:23;407:32;404:2;;;452:1;449;442:12;404:2;487:1;504:64;560:7;540:9;504:64;;;494:74;;466:108;605:2;623:64;679:7;670:6;659:9;655:22;623:64;;;613:74;;584:109;724:2;742:64;798:7;789:6;778:9;774:22;742:64;;;732:74;;703:109;398:424;;;;;;829:148;928:43;947:23;964:5;947:23;;;928:43;;;923:3;916:56;910:67;;;984:152;1085:45;1105:24;1123:5;1105:24;;1143:356;;1271:38;1303:5;1271:38;;;1321:88;1402:6;1397:3;1321:88;;;1314:95;;1414:52;1459:6;1454:3;1447:4;1440:5;1436:16;1414:52;;;1478:16;;;;;1251:248;-1:-1;;1251:248;1506:347;;1618:39;1651:5;1618:39;;;1669:71;1733:6;1728:3;1669:71;;;1662:78;;1745:52;1790:6;1785:3;1778:4;1771:5;1767:16;1745:52;;;1818:29;1840:6;1818:29;;;1809:39;;;;1598:255;-1:-1;;;1598:255;1860:113;1943:24;1961:5;1943:24;;1980:244;;2099:75;2170:3;2161:6;2099:75;;;-1:-1;2196:2;2187:12;;2087:137;-1:-1;2087:137;2231:553;;2447:93;2536:3;2527:6;2447:93;;;2440:100;;2551:73;2620:3;2611:6;2551:73;;;2646:1;2641:3;2637:11;2630:18;;2666:93;2755:3;2746:6;2666:93;;;2659:100;2428:356;-1:-1;;;;;2428:356;2791:301;2929:2;2943:47;;;2914:18;;3004:78;2914:18;3068:6;3004:78;;;2996:86;2900:192;-1:-1;;;2900:192;3099:213;3217:2;3202:18;;3231:71;3206:9;3275:6;3231:71;;3319:121;3406:12;;3377:63;3730:163;3833:19;;;3882:4;3873:14;;3826:67;3901:91;;3963:24;3981:5;3963:24;;3999:144;-1:-1;;;;;;4060:78;;4043:100;4150:72;4212:5;4195:27;4229:121;-1:-1;;;;;4291:54;;4274:76;4437:268;4502:1;4509:101;4523:6;4520:1;4517:13;4509:101;;;4590:11;;;4584:18;4571:11;;;4564:39;4545:2;4538:10;4509:101;;;4625:6;4622:1;4619:13;4616:2;;;4690:1;4681:6;4676:3;4672:16;4665:27;4616:2;4486:219;;;;;4874:97;4962:2;4942:14;-1:-1;;4938:28;;4922:49;4979:117;5048:24;5066:5;5048:24;;;5041:5;5038:35;5028:2;;5087:1;5084;5077:12;5028:2;5022:74;;5103:117;5172:24;5190:5;5172:24;;5146:74;1146:2578:44;;;;;;", "deployedSourceMap": "1146:2578:44:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1146:2578:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1130:38:6;;;:::i;:::-;;;;;;;;;;;;;;;;2142:161:44;;;;;;;;;:::i;:::-;;2378:126;;;:::i;:::-;;;;;;;;1482:26;;;:::i;:::-;;;;;;;;1427:49;;;:::i;1130:38:6:-;;;;;;:::o;2142:161:44:-;2240:10;1697:149:6;1732:15;;;;;;;;;;;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1732:23:6;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1732:23:6;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;1732:23:6;;;;;;;;;1723:32;;:5;:32;;;1769:4;1697:149;1831:5;1697:12;:149::i;:::-;2262:34:44;2283:12;2262:20;:34::i;:::-;2142:161;;:::o;2378:126::-;2428:4;2451:46;:44;:46::i;:::-;2444:53;;2378:126;:::o;1482:26::-;;;;:::o;1427:49::-;;;;;;:::o;2962:561:99:-;3122:4;3117:400;;3236:24;3255:4;3236:18;:24::i;:::-;3286:5;3317:26;3336:6;3317:18;:26::i;:::-;3369:6;3401:19;3411:8;3401:9;:19::i;:::-;3194:280;;;;;;;;;3446:6;;3194:280;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;3194:280:99;;;;3142:364;;;;;;;;;;;;;;;;;3117:400;2962:561;;;;:::o;2718:412:44:-;2803:116;2845:10;2829:12;:26;;2869:4;2803:116;:12;:116::i;:::-;2929:115;2971:8;2955:12;:24;;2993:4;2929:115;:12;:115::i;:::-;3054:11;:26;;;3095:28;;;;;;3068:12;;3095:28;;;;;;;;;;2718:412;:::o;3136:586::-;3215:4;3279:13;3306:17;3415:21;;;;;;;;;;;:37;;;:39;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3415:39:44;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3415:39:44;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;3415:39:44;;;;;;;;;3231:223;;;;;;;3659:6;3669:1;3659:11;:56;;;;;3700:15;3686:11;;3674:9;:23;:41;3659:56;3652:63;;;;3136:586;:::o;6359:968:99:-;6463:12;6538:19;6577:5;6560:23;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;6560:23:99;;;;-1:-1:-1;49:4;6689:572:99;6710:6;;6689:572;;6962:9;;6864:3;;;;;6962:6;;6864:3;;6962:9;;;;;;;;;;;;:14;6958:293;;7017:1;7013:5;7143:22;;7150:6;-1:-1:-1;7223:13:99;;6958:293;6689:572;;;-1:-1:-1;7308:12:99;;;7318:1;7308:12;;;;;;;;;;;;7301:19;;;6359:968;;;;:::o;8252:958::-;8524:13;;;8534:2;8524:13;;;8346:12;8524:13;;;;;;8386:14;;;;8346:12;;8524:13;;;21:6:-1;;104:10;8524:13:99;87:34:-1;135:17;;-1:-1;8524:13:99;8502:35;;902:2;8601:23;;8589:6;8596:1;8589:9;;;;;;;;;;;:35;;;;;;;;;;;1010:3;8646:27;;8634:6;8641:1;8634:9;;;;;;;;;;;:39;;;;;;;;;;;8787:9;8782:398;8802:2;8798:1;:6;8782:398;;;8891:1;8887:5;;8984:23;1232:3;8989:17;;8984:4;:23::i;:::-;8963:6;8975:5;8970:2;:10;8963:18;;;;;;;;;;;:44;;;;;;;;;;;9030:1;9025;:6;;9021:10;;9122:23;1232:3;9127:1;:17;9122:4;:23::i;:::-;9101:6;9113:5;9108:2;:10;9101:18;;;;;;;;;;;:44;;;;;;;;;;-1:-1:-1;;9168:1:99;9163:6;;;;;8806:3;;8782:398;;1294:426;1428:4;1423:291;;1542:24;1561:4;1542:18;:24::i;:::-;1592:5;1623:26;1642:6;1623:18;:26::i;:::-;1500:171;;;;;;;;;;;1423:291;1294:426;;;:::o;10178:325::-;10267:4;10335:2;10327:5;:10;10323:79;;;-1:-1:-1;902:2:99;10371:18;;10360:31;;10353:38;;10323:79;-1:-1:-1;956:2:99;10467:27;10456:40;;;10178:325::o;5:134:-1:-;83:13;;101:33;83:13;101:33;;;68:71;;;;;146:132;223:13;;241:32;223:13;241:32;;285:130;352:20;;377:33;352:20;377:33;;563:132;640:13;;658:32;640:13;658:32;;702:263;;817:2;805:9;796:7;792:23;788:32;785:2;;;833:1;830;823:12;785:2;868:1;885:64;941:7;921:9;885:64;;;875:74;779:186;-1:-1;;;;779:186;972:241;;1076:2;1064:9;1055:7;1051:23;1047:32;1044:2;;;1092:1;1089;1082:12;1044:2;1127:1;1144:53;1189:7;1169:9;1144:53;;1220:803;;;;;;1400:3;1388:9;1379:7;1375:23;1371:33;1368:2;;;1417:1;1414;1407:12;1368:2;1452:1;1469:63;1524:7;1504:9;1469:63;;;1459:73;;1431:107;1569:2;1587:63;1642:7;1633:6;1622:9;1618:22;1587:63;;;1577:73;;1548:108;1687:2;1705:64;1761:7;1752:6;1741:9;1737:22;1705:64;;;1695:74;;1666:109;1806:2;1824:64;1880:7;1871:6;1860:9;1856:22;1824:64;;;1814:74;;1785:109;1925:3;1944:63;1999:7;1990:6;1979:9;1975:22;1944:63;;;1934:73;;1904:109;1362:661;;;;;;;;;2030:104;2107:21;2122:5;2107:21;;;2102:3;2095:34;2089:45;;;2141:148;2240:43;2259:23;2276:5;2259:23;;;2240:43;;2296:148;2395:43;2414:23;2431:5;2414:23;;2451:152;2552:45;2572:24;2590:5;2572:24;;2610:356;;2738:38;2770:5;2738:38;;;2788:88;2869:6;2864:3;2788:88;;;2781:95;;2881:52;2926:6;2921:3;2914:4;2907:5;2903:16;2881:52;;;2945:16;;;;;2718:248;-1:-1;;2718:248;2973:184;3085:66;3145:5;3085:66;;3347:347;;3459:39;3492:5;3459:39;;;3510:71;3574:6;3569:3;3510:71;;;3503:78;;3586:52;3631:6;3626:3;3619:4;3612:5;3608:16;3586:52;;;3659:29;3681:6;3659:29;;;3650:39;;;;3439:255;-1:-1;;;3439:255;3701:113;3784:24;3802:5;3784:24;;3821:244;;3940:75;4011:3;4002:6;3940:75;;;-1:-1;4037:2;4028:12;;3928:137;-1:-1;3928:137;4072:553;;4288:93;4377:3;4368:6;4288:93;;;4281:100;;4392:73;4461:3;4452:6;4392:73;;;4487:1;4482:3;4478:11;4471:18;;4507:93;4596:3;4587:6;4507:93;;;4500:100;4269:356;-1:-1;;;;;4269:356;4632:978;;4946:93;5035:3;5026:6;4946:93;;;4939:100;;5050:73;5119:3;5110:6;5050:73;;;5145:1;5140:3;5136:11;5129:18;;5165:93;5254:3;5245:6;5165:93;;;5158:100;;5269:73;5338:3;5329:6;5269:73;;;5364:1;5359:3;5355:11;5348:18;;5384:93;5473:3;5464:6;5384:93;;;5377:100;;5488:73;5557:3;5548:6;5488:73;;;-1:-1;5583:1;5574:11;;4927:683;-1:-1;;;;;;4927:683;5617:201;5729:2;5714:18;;5743:65;5718:9;5781:6;5743:65;;5825:271;5972:2;5957:18;;5986:100;5961:9;6059:6;5986:100;;6373:301;6511:2;6525:47;;;6496:18;;6586:78;6496:18;6650:6;6586:78;;;6578:86;6482:192;-1:-1;;;6482:192;6681:213;6799:2;6784:18;;6813:71;6788:9;6857:6;6813:71;;6901:121;6988:12;;6959:63;7312:163;7415:19;;;7464:4;7455:14;;7408:67;7483:91;;7545:24;7563:5;7545:24;;7581:85;7647:13;7640:21;;7623:43;7673:144;7745:66;7734:78;;7717:100;7824:144;7896:66;7885:78;;7868:100;7975:72;8037:5;8020:27;8132:121;8205:42;8194:54;;8177:76;8339:100;8411:22;8400:34;;8383:56;8446:179;;8554:66;8614:5;8554:66;;9095:268;9160:1;9167:101;9181:6;9178:1;9175:13;9167:101;;;9248:11;;;9242:18;9229:11;;;9222:39;9203:2;9196:10;9167:101;;;9283:6;9280:1;9277:13;9274:2;;;-1:-1;;9348:1;9330:16;;9323:27;9144:219;9612:97;9700:2;9680:14;9696:7;9676:28;;9660:49;9717:117;9786:24;9804:5;9786:24;;;9779:5;9776:35;9766:2;;9825:1;9822;9815:12;9766:2;9760:74;;9841:115;9909:23;9926:5;9909:23;;10087:115;10155:23;10172:5;10155:23;", "source": "/*\n\n Copyright 2020 Dolomite.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.7;\npragma experimental ABIEncoderV2;\n\nimport { Require } from \"../../protocol/lib/Require.sol\";\n\nimport { IOracleSentinel } from \"../../protocol/interfaces/IOracleSentinel.sol\";\n\nimport { OnlyDolomiteMargin } from \"../helpers/OnlyDolomiteMargin.sol\";\nimport { IChainlinkAggregator } from \"../interfaces/IChainlinkAggregator.sol\";\n\n\n/**\n * @title ChainlinkOracleSentinel\n * @author Dolomite\n *\n * An implementation of the IOracleSentinel interface that gets data from the sequencer using Chainlink to check if it\n * is online.\n */\ncontract ChainlinkOracleSentinel is IOracleSentinel, OnlyDolomiteMargin {\n\n // ========================== Constants ========================\n\n bytes32 private constant FILE = \"ChainlinkOracleSentinel\";\n\n // ========================= Storage =========================\n\n IChainlinkAggregator public SEQUENCER_UPTIME_FEED;\n uint256 public gracePeriod;\n\n // ======================= Constructor =======================\n\n /**\n * @param _sequencerUptimeFeed The contract for layer-2 that denotes whether or not the sequencer is currently\n * online.\n */\n constructor(\n uint256 _gracePeriod,\n address _sequencerUptimeFeed,\n address _dolomiteMargin\n )\n public\n OnlyDolomiteMargin(_dolomiteMargin)\n {\n _ownerSetGracePeriod(_gracePeriod);\n SEQUENCER_UPTIME_FEED = IChainlinkAggregator(_sequencerUptimeFeed);\n }\n\n // ===================== Admin Functions =====================\n\n function ownerSetGracePeriod(\n uint256 _gracePeriod\n ) external onlyDolomiteMarginOwner(msg.sender) {\n _ownerSetGracePeriod(_gracePeriod);\n }\n\n // ===================== Getter Functions =====================\n\n function isBorrowAllowed() external view returns (bool) {\n return _getIsSequencerOnlineAndGracePeriodHasPassed();\n }\n\n function isLiquidationAllowed() external view returns (bool) {\n return _getIsSequencerOnlineAndGracePeriodHasPassed();\n }\n\n // ===================== Internal Functions =====================\n\n function _ownerSetGracePeriod(\n uint256 _gracePeriod\n ) internal {\n Require.that(\n _gracePeriod >= 10 minutes,\n FILE,\n \"Grace period too low\"\n );\n Require.that(\n _gracePeriod <= 24 hours,\n FILE,\n \"Grace period too high\"\n );\n gracePeriod = _gracePeriod;\n emit GracePeriodSet(_gracePeriod);\n }\n\n function _getIsSequencerOnlineAndGracePeriodHasPassed() internal view returns (bool) {\n (\n /* uint80 roundID */,\n int256 answer,\n uint256 startedAt,\n /* uint256 updatedAt */,\n /* uint80 answeredInRound */\n ) = SEQUENCER_UPTIME_FEED.latestRoundData();\n\n // Answer == 0: Sequencer is up\n // Answer == 1: Sequencer is down\n // logic is taken from the Chainlink docs: https://docs.chain.link/data-feeds/l2-sequencer-feeds\n return answer == 0 && startedAt + gracePeriod < block.timestamp;\n }\n}\n", "sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/oracles/ChainlinkOracleSentinel.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/oracles/ChainlinkOracleSentinel.sol", "exportedSymbols": { "ChainlinkOracleSentinel": [ 8052 ] }, "id": 8053, "nodeType": "SourceUnit", "nodes": [ { "id": 7917, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "595:23:44" }, { "id": 7918, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "619:33:44" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol", "file": "../../protocol/lib/Require.sol", "id": 7920, "nodeType": "ImportDirective", "scope": 8053, "sourceUnit": 28453, "src": "654:57:44", "symbolAliases": [ { "foreign": 7919, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IOracleSentinel.sol", "file": "../../protocol/interfaces/IOracleSentinel.sol", "id": 7922, "nodeType": "ImportDirective", "scope": 8053, "sourceUnit": 24818, "src": "713:80:44", "symbolAliases": [ { "foreign": 7921, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/helpers/OnlyDolomiteMargin.sol", "file": "../helpers/OnlyDolomiteMargin.sol", "id": 7924, "nodeType": "ImportDirective", "scope": 8053, "sourceUnit": 3067, "src": "795:71:44", "symbolAliases": [ { "foreign": 7923, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAggregator.sol", "file": "../interfaces/IChainlinkAggregator.sol", "id": 7926, "nodeType": "ImportDirective", "scope": 8053, "sourceUnit": 4191, "src": "867:78:44", "symbolAliases": [ { "foreign": 7925, "local": null } ], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 7927, "name": "IOracleSentinel", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 24817, "src": "1182:15:44", "typeDescriptions": { "typeIdentifier": "t_contract$_IOracleSentinel_$24817", "typeString": "contract IOracleSentinel" } }, "id": 7928, "nodeType": "InheritanceSpecifier", "src": "1182:15:44" }, { "arguments": null, "baseName": { "contractScope": null, "id": 7929, "name": "OnlyDolomiteMargin", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3066, "src": "1199:18:44", "typeDescriptions": { "typeIdentifier": "t_contract$_OnlyDolomiteMargin_$3066", "typeString": "contract OnlyDolomiteMargin" } }, "id": 7930, "nodeType": "InheritanceSpecifier", "src": "1199:18:44" } ], "contractDependencies": [ 3066, 24817 ], "contractKind": "contract", "documentation": "@title ChainlinkOracleSentinel\n@author Dolomite\n * An implementation of the IOracleSentinel interface that gets data from the sequencer using Chainlink to check if it\nis online.", "fullyImplemented": true, "id": 8052, "linearizedBaseContracts": [ 8052, 3066, 24817 ], "name": "ChainlinkOracleSentinel", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 7933, "name": "FILE", "nodeType": "VariableDeclaration", "scope": 8052, "src": "1295:57:44", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 7931, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1295:7:44", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "hexValue": "436861696e6c696e6b4f7261636c6553656e74696e656c", "id": 7932, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1327:25:44", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_6d1846015596fd87b7bd9fba8ddcb7ec89506bd151fa5e069250b04257912378", "typeString": "literal_string \"ChainlinkOracleSentinel\"" }, "value": "ChainlinkOracleSentinel" }, "visibility": "private" }, { "constant": false, "id": 7935, "name": "SEQUENCER_UPTIME_FEED", "nodeType": "VariableDeclaration", "scope": 8052, "src": "1427:49:44", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAggregator_$4190", "typeString": "contract IChainlinkAggregator" }, "typeName": { "contractScope": null, "id": 7934, "name": "IChainlinkAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4190, "src": "1427:20:44", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAggregator_$4190", "typeString": "contract IChainlinkAggregator" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 7937, "name": "gracePeriod", "nodeType": "VariableDeclaration", "scope": 8052, "src": "1482:26:44", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7936, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1482:7:44", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "body": { "id": 7959, "nodeType": "Block", "src": "1941:127:44", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 7950, "name": "_gracePeriod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7939, "src": "1972:12:44", "typeDescriptions": { "typeIdentifier": "t_uint25