@dolomite-exchange/dolomite-margin 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/contracts/Account.json +11 -11
- package/build/contracts/Actions.json +11 -11
- package/build/contracts/Address.json +1 -1
- package/build/contracts/Admin.json +23 -23
- package/build/contracts/AdminImpl.json +35 -307
- package/build/contracts/AdvancedMath.json +7 -7
- package/build/contracts/AmmRebalancerProxy.json +577 -621
- package/build/contracts/AmmRebalancerProxyV1.json +78 -32
- package/build/contracts/Babylonian.json +1 -1
- package/build/contracts/Bits.json +9 -9
- package/build/contracts/Cache.json +13 -13
- package/build/contracts/ChainlinkPriceOracleV1.json +16 -16
- package/build/contracts/Context.json +1 -1
- package/build/contracts/CustomTestToken.json +9 -9
- package/build/contracts/Decimal.json +9 -9
- package/build/contracts/DelayedMultiSig.json +9 -9
- package/build/contracts/DolomiteAmmERC20.json +11 -11
- package/build/contracts/DolomiteAmmFactory.json +14 -52
- package/build/contracts/DolomiteAmmLibrary.json +24 -24
- package/build/contracts/DolomiteAmmPair.json +27 -27
- package/build/contracts/DolomiteAmmRouterProxy.json +30 -363
- package/build/contracts/DolomiteMargin.json +21 -67
- package/build/contracts/DoubleExponentInterestSetter.json +15 -21
- package/build/contracts/EnumerableSet.json +7 -7
- package/build/contracts/ErroringOmiseToken.json +9 -9
- package/build/contracts/ErroringToken.json +10 -10
- package/build/contracts/Events.json +17 -17
- package/build/contracts/ExcessivelySafeCall.json +35 -35
- package/build/contracts/Exchange.json +15 -15
- package/build/contracts/Expiry.json +36 -36
- package/build/contracts/Getters.json +33 -33
- package/build/contracts/IAutoTrader.json +9 -9
- package/build/contracts/ICallee.json +7 -7
- package/build/contracts/IChainlinkAggregator.json +5 -5
- package/build/contracts/IDolomiteAmmERC20.json +5 -5
- package/build/contracts/IDolomiteAmmFactory.json +9 -9
- package/build/contracts/IDolomiteAmmPair.json +9 -9
- package/build/contracts/IDolomiteMargin.json +23 -23
- package/build/contracts/IERC20.json +1 -1
- package/build/contracts/IERC20Detailed.json +5 -5
- package/build/contracts/IExchangeWrapper.json +5 -5
- package/build/contracts/IExpiry.json +9 -9
- package/build/contracts/IInterestSetter.json +7 -7
- package/build/contracts/ILiquidationCallback.json +7 -7
- package/build/contracts/IMakerOracle.json +5 -5
- package/build/contracts/IOasisDex.json +5 -5
- package/build/contracts/IPriceOracle.json +7 -7
- package/build/contracts/IRecyclable.json +9 -9
- package/build/contracts/ITransferProxy.json +5 -5
- package/build/contracts/IUniswapV2Callee.json +5 -5
- package/build/contracts/IUniswapV2Factory.json +5 -5
- package/build/contracts/IUniswapV2Pair.json +5 -5
- package/build/contracts/IUniswapV2Router.json +5 -5
- package/build/contracts/IWETH.json +5 -5
- package/build/contracts/Interest.json +15 -15
- package/build/contracts/LiquidateOrVaporizeImpl.json +32 -83
- package/build/contracts/LiquidatorProxyHelper.json +23 -23
- package/build/contracts/LiquidatorProxyV1.json +30 -36
- package/build/contracts/LiquidatorProxyV1WithAmm.json +49 -105
- package/build/contracts/Math.json +1 -1
- package/build/contracts/Migrations.json +8 -14
- package/build/contracts/Monetary.json +7 -7
- package/build/contracts/MultiCall.json +8 -14
- package/build/contracts/MultiSig.json +7 -7
- package/build/contracts/OmiseToken.json +8 -8
- package/build/contracts/OnlyDolomiteMargin.json +11 -11
- package/build/contracts/Operation.json +15 -15
- package/build/contracts/OperationImpl.json +39 -47
- package/build/contracts/Ownable.json +1 -1
- package/build/contracts/PartiallyDelayedMultiSig.json +9 -9
- package/build/contracts/PayableProxy.json +17 -23
- package/build/contracts/Permission.json +11 -11
- package/build/contracts/PolynomialInterestSetter.json +13 -13
- package/build/contracts/RecyclableTokenProxy.json +25 -25
- package/build/contracts/ReentrancyGuard.json +1 -1
- package/build/contracts/Require.json +7 -7
- package/build/contracts/SafeERC20.json +1 -1
- package/build/contracts/SafeETH.json +7 -7
- package/build/contracts/SafeLiquidationCallback.json +17 -17
- package/build/contracts/SafeMath.json +1 -1
- package/build/contracts/SignedOperationProxy.json +21 -104
- package/build/contracts/SimpleFeeOwner.json +18 -63
- package/build/contracts/State.json +9 -9
- package/build/contracts/Storage.json +37 -37
- package/build/contracts/TestAmmRebalancerProxy.json +32 -58
- package/build/contracts/TestAutoTrader.json +22 -22
- package/build/contracts/TestBtcUsdChainlinkAggregator.json +10 -10
- package/build/contracts/TestCallee.json +19 -19
- package/build/contracts/TestChainlinkPriceOracleV1.json +10 -94
- package/build/contracts/TestCounter.json +7 -7
- package/build/contracts/TestDaiUsdChainlinkAggregator.json +11 -11
- package/build/contracts/TestDolomiteMargin.json +22 -22
- package/build/contracts/TestDoubleExponentInterestSetter.json +10 -10
- package/build/contracts/TestEthUsdChainlinkAggregator.json +11 -11
- package/build/contracts/TestExchangeWrapper.json +28 -28
- package/build/contracts/TestInterestSetter.json +13 -13
- package/build/contracts/TestLib.json +22 -22
- package/build/contracts/TestLinkUsdChainlinkAggregator.json +11 -11
- package/build/contracts/TestLiquidateCallback.json +719 -719
- package/build/contracts/TestLiquidationCallback.json +13 -13
- package/build/contracts/TestLrcEthChainlinkAggregator.json +11 -11
- package/build/contracts/TestMakerOracle.json +10 -10
- package/build/contracts/TestMaticUsdChainlinkAggregator.json +10 -10
- package/build/contracts/TestOasisDex.json +12 -12
- package/build/contracts/TestOperationImpl.json +14 -14
- package/build/contracts/TestPolynomialInterestSetter.json +10 -10
- package/build/contracts/TestPriceAggregator.json +9 -9
- package/build/contracts/TestPriceOracle.json +13 -13
- package/build/contracts/TestRecyclableToken.json +9 -9
- package/build/contracts/TestSimpleCallee.json +15 -15
- package/build/contracts/TestToken.json +9 -9
- package/build/contracts/TestTrader.json +17 -17
- package/build/contracts/TestUniswapAmmRebalancerProxy.json +16 -16
- package/build/contracts/TestUsdcUsdChainlinkAggregator.json +11 -11
- package/build/contracts/TestWETH.json +9 -9
- package/build/contracts/Time.json +9 -9
- package/build/contracts/Token.json +9 -9
- package/build/contracts/TokenA.json +10 -10
- package/build/contracts/TokenB.json +10 -10
- package/build/contracts/TokenC.json +10 -10
- package/build/contracts/TokenD.json +10 -10
- package/build/contracts/TokenE.json +10 -10
- package/build/contracts/TokenF.json +10 -10
- package/build/contracts/TransferProxy.json +22 -28
- package/build/contracts/TypedSignature.json +9 -9
- package/build/contracts/Types.json +9 -9
- package/build/contracts/UQ112x112.json +7 -7
- package/build/contracts/UniswapV2ERC20.json +7 -7
- package/build/contracts/UniswapV2Factory.json +12 -12
- package/build/contracts/UniswapV2Library.json +20 -20
- package/build/contracts/UniswapV2Pair.json +17 -17
- package/build/contracts/UniswapV2Router02.json +16 -16
- package/build/contracts/WETH9.json +1 -1
- package/contracts/external/amm/DolomiteAmmERC20.sol +135 -0
- package/contracts/external/amm/DolomiteAmmFactory.sol +122 -0
- package/contracts/external/amm/DolomiteAmmPair.sol +573 -0
- package/contracts/external/amm/SimpleFeeOwner.sol +107 -0
- package/contracts/external/helpers/LiquidatorProxyHelper.sol +252 -0
- package/contracts/external/helpers/OnlyDolomiteMargin.sol +63 -0
- package/contracts/external/interestsetters/DoubleExponentInterestSetter.sol +212 -0
- package/contracts/external/interestsetters/PolynomialInterestSetter.sol +205 -0
- package/contracts/external/interfaces/IChainlinkAggregator.sol +33 -0
- package/contracts/external/interfaces/IDolomiteAmmERC20.sol +52 -0
- package/contracts/external/interfaces/IDolomiteAmmFactory.sol +42 -0
- package/contracts/external/interfaces/IDolomiteAmmPair.sol +116 -0
- package/contracts/external/interfaces/IExpiry.sol +70 -0
- package/contracts/external/interfaces/IMakerOracle.sol +52 -0
- package/contracts/external/interfaces/IOasisDex.sol +326 -0
- package/contracts/external/interfaces/ITransferProxy.sol +53 -0
- package/contracts/external/interfaces/IUniswapV2Router.sol +134 -0
- package/contracts/external/lib/AdvancedMath.sol +23 -0
- package/contracts/external/lib/DolomiteAmmLibrary.sol +323 -0
- package/contracts/external/lib/TypedSignature.sol +120 -0
- package/contracts/external/lib/UQ112x112.sol +22 -0
- package/contracts/external/multisig/DelayedMultiSig.sol +206 -0
- package/contracts/external/multisig/MultiSig.sol +571 -0
- package/contracts/external/multisig/PartiallyDelayedMultiSig.sol +174 -0
- package/contracts/external/oracles/ChainlinkPriceOracleV1.sol +197 -0
- package/contracts/external/oracles/TestChainlinkPriceOracleV1.sol +98 -0
- package/contracts/external/proxies/AmmRebalancerProxyV1.sol +465 -0
- package/contracts/external/proxies/DolomiteAmmRouterProxy.sol +877 -0
- package/contracts/external/proxies/LiquidatorProxyV1.sol +507 -0
- package/contracts/external/proxies/LiquidatorProxyV1WithAmm.sol +574 -0
- package/contracts/external/proxies/PayableProxy.sol +146 -0
- package/contracts/external/proxies/RecyclableTokenProxy.sol +463 -0
- package/contracts/external/proxies/SignedOperationProxy.sol +553 -0
- package/contracts/external/proxies/TransferProxy.sol +207 -0
- package/contracts/external/traders/Expiry.sol +532 -0
- package/contracts/external/uniswap-v2/UniswapV2ERC20.sol +118 -0
- package/contracts/external/uniswap-v2/UniswapV2Factory.sol +67 -0
- package/contracts/external/uniswap-v2/UniswapV2Pair.sol +283 -0
- package/contracts/external/uniswap-v2/UniswapV2Router02.sol +566 -0
- package/contracts/external/uniswap-v2/interfaces/IUniswapV2Callee.sol +13 -0
- package/contracts/external/uniswap-v2/interfaces/IUniswapV2Factory.sol +18 -0
- package/contracts/external/uniswap-v2/interfaces/IUniswapV2Pair.sol +67 -0
- package/contracts/external/uniswap-v2/interfaces/IWETH.sol +7 -0
- package/contracts/external/uniswap-v2/libraries/SafeETH.sol +29 -0
- package/contracts/external/uniswap-v2/libraries/UniswapV2Library.sol +117 -0
- package/contracts/external/utils/MultiCall.sol +95 -0
- package/contracts/protocol/impl/artifacts/OperationImpl.json +80 -0
- package/contracts/protocol/impl/artifacts/OperationImpl_metadata.json +193 -0
- package/dist/build/published_contracts/AdminImpl.json +2 -2
- package/dist/build/published_contracts/AmmRebalancerProxyV1.json +5 -0
- package/dist/build/published_contracts/ChainlinkPriceOracleV1.json +1 -1
- package/dist/build/published_contracts/DolomiteAmmFactory.json +1 -1
- package/dist/build/published_contracts/DolomiteAmmRouterProxy.json +1 -1
- package/dist/build/published_contracts/DoubleExponentInterestSetter.json +2 -2
- package/dist/build/published_contracts/Expiry.json +1 -1
- package/dist/build/published_contracts/LiquidatorProxyV1.json +1 -1
- package/dist/build/published_contracts/LiquidatorProxyV1WithAmm.json +1 -1
- package/dist/build/published_contracts/MultiCall.json +1 -1
- package/dist/build/published_contracts/PayableProxy.json +2 -2
- package/dist/build/published_contracts/SignedOperationProxy.json +2 -2
- package/dist/build/published_contracts/SimpleFeeOwner.json +1 -1
- package/dist/build/published_contracts/TestUniswapAmmRebalancerProxy.json +140 -0
- package/dist/build/published_contracts/TransferProxy.json +1 -1
- package/dist/src/lib/Contracts.d.ts +3 -1
- package/dist/src/lib/Contracts.js +7 -3
- package/dist/src/lib/Contracts.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contractName": "Bits",
|
|
3
3
|
"abi": [],
|
|
4
|
-
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Dolomite * Library for caching information about markets\",\"methods\":{},\"title\":\"Bits\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/
|
|
5
|
-
"bytecode": "
|
|
6
|
-
"deployedBytecode": "
|
|
4
|
+
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Dolomite * Library for caching information about markets\",\"methods\":{},\"title\":\"Bits\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol\":\"Bits\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol\":{\"keccak256\":\"0x425bf5764368faca16cc30a64b79d9bbe01fd8150444b58a464971c32450bd85\",\"urls\":[\"bzz-raw://064baf3155da634c5c80cea70bba0dda7a33af934b34f75f596961b4ab9aeafe\",\"dweb:/ipfs/QmTUHXoi9L6CkERyfhFs1jhxU66u2sbc6XRR5cH4TeHEqL\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0xe641662503ea29ca959e84674188c3e9deaaf64c5623fb9560a4301c521ca1d3\",\"urls\":[\"bzz-raw://b10a04c7d014b99eb792c8c774e203c846d070b30cf0b715325fc07838ed6a6d\",\"dweb:/ipfs/QmUqZWnbchfEY9jM647yQamHe4GzspfUeRQF9k2nn1Hixd\"]}},\"version\":1}",
|
|
5
|
+
"bytecode": "0x60636023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a723158200c5c9c5a850563b5d001205390c90bfa6f15412100fef3d504a2b91fae5a8cea6c6578706572696d656e74616cf564736f6c63430005100040",
|
|
6
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a723158200c5c9c5a850563b5d001205390c90bfa6f15412100fef3d504a2b91fae5a8cea6c6578706572696d656e74616cf564736f6c63430005100040",
|
|
7
7
|
"sourceMap": "800:2302:67:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24",
|
|
8
8
|
"deployedSourceMap": "800:2302:67:-;;;;;;;;",
|
|
9
9
|
"source": "/*\n\n Copyright 2019 dYdX Trading Inc.\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 \"./Require.sol\";\n\n\n/**\n * @title Bits\n * @author Dolomite\n *\n * Library for caching information about markets\n */\nlibrary Bits {\n\n // ============ Constants ============\n\n uint internal constant ONE = 1;\n uint256 internal constant MAX_UINT_BITS = 256;\n\n // ============ Functions ============\n\n function createBitmaps(uint maxLength) internal pure returns (uint[] memory) {\n return new uint[]((maxLength / MAX_UINT_BITS) + ONE);\n }\n\n function getMarketIdFromBit(\n uint index,\n uint bit\n ) internal pure returns (uint) {\n return (MAX_UINT_BITS * index) + bit;\n }\n\n function setBit(\n uint[] memory bitmaps,\n uint marketId\n ) internal pure {\n uint bucketIndex = marketId / MAX_UINT_BITS;\n uint indexFromRight = marketId % MAX_UINT_BITS;\n bitmaps[bucketIndex] |= (ONE << indexFromRight);\n }\n\n function hasBit(\n uint[] memory bitmaps,\n uint marketId\n ) internal pure returns (bool) {\n uint bucketIndex = marketId / MAX_UINT_BITS;\n uint indexFromRight = marketId % MAX_UINT_BITS;\n uint bit = bitmaps[bucketIndex] & (ONE << indexFromRight);\n return bit > 0;\n }\n\n function unsetBit(\n uint bitmap,\n uint bit\n ) internal pure returns (uint) {\n return bitmap - (ONE << bit);\n }\n\n // solium-disable security/no-assign-params\n function getLeastSignificantBit(uint256 x) internal pure returns (uint) {\n // gas usage peaks at 350 per call\n\n uint lsb = 255;\n\n if (x & uint128(-1) > 0) {\n lsb -= 128;\n } else {\n x >>= 128;\n }\n\n if (x & uint64(-1) > 0) {\n lsb -= 64;\n } else {\n x >>= 64;\n }\n\n if (x & uint32(-1) > 0) {\n lsb -= 32;\n } else {\n x >>= 32;\n }\n\n if (x & uint16(-1) > 0) {\n lsb -= 16;\n } else {\n x >>= 16;\n }\n\n if (x & uint8(-1) > 0) {\n lsb -= 8;\n } else {\n x >>= 8;\n }\n\n if (x & 0xf > 0) {\n lsb -= 4;\n } else {\n x >>= 4;\n }\n\n if (x & 0x3 > 0) {\n lsb -= 2;\n } else {\n x >>= 2;\n // solium-enable security/no-assign-params\n }\n\n if (x & 0x1 > 0) {\n lsb -= 1;\n }\n\n return lsb;\n }\n}\n",
|
|
10
|
-
"sourcePath": "/
|
|
10
|
+
"sourcePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol",
|
|
11
11
|
"ast": {
|
|
12
|
-
"absolutePath": "/
|
|
12
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol",
|
|
13
13
|
"exportedSymbols": {
|
|
14
14
|
"Bits": [
|
|
15
15
|
28688
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"src": "627:33:67"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
"absolutePath": "/
|
|
42
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol",
|
|
43
43
|
"file": "./Require.sol",
|
|
44
44
|
"id": 28407,
|
|
45
45
|
"nodeType": "ImportDirective",
|
|
@@ -3756,7 +3756,7 @@
|
|
|
3756
3756
|
"src": "603:2500:67"
|
|
3757
3757
|
},
|
|
3758
3758
|
"legacyAST": {
|
|
3759
|
-
"absolutePath": "/
|
|
3759
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol",
|
|
3760
3760
|
"exportedSymbols": {
|
|
3761
3761
|
"Bits": [
|
|
3762
3762
|
28688
|
|
@@ -3786,7 +3786,7 @@
|
|
|
3786
3786
|
"src": "627:33:67"
|
|
3787
3787
|
},
|
|
3788
3788
|
{
|
|
3789
|
-
"absolutePath": "/
|
|
3789
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol",
|
|
3790
3790
|
"file": "./Require.sol",
|
|
3791
3791
|
"id": 28407,
|
|
3792
3792
|
"nodeType": "ImportDirective",
|
|
@@ -7508,7 +7508,7 @@
|
|
|
7508
7508
|
},
|
|
7509
7509
|
"networks": {},
|
|
7510
7510
|
"schemaVersion": "3.0.23",
|
|
7511
|
-
"updatedAt": "2022-02-
|
|
7511
|
+
"updatedAt": "2022-02-07T07:18:45.267Z",
|
|
7512
7512
|
"devdoc": {
|
|
7513
7513
|
"author": "Dolomite * Library for caching information about markets",
|
|
7514
7514
|
"methods": {},
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contractName": "Cache",
|
|
3
3
|
"abi": [],
|
|
4
|
-
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"dYdX * Library for caching information about markets\",\"methods\":{},\"title\":\"Cache\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/
|
|
5
|
-
"bytecode": "
|
|
6
|
-
"deployedBytecode": "
|
|
4
|
+
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"dYdX * Library for caching information about markets\",\"methods\":{},\"title\":\"Cache\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Cache.sol\":\"Cache\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol\":{\"keccak256\":\"0x425bf5764368faca16cc30a64b79d9bbe01fd8150444b58a464971c32450bd85\",\"urls\":[\"bzz-raw://064baf3155da634c5c80cea70bba0dda7a33af934b34f75f596961b4ab9aeafe\",\"dweb:/ipfs/QmTUHXoi9L6CkERyfhFs1jhxU66u2sbc6XRR5cH4TeHEqL\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Cache.sol\":{\"keccak256\":\"0x1e6ff383f285e311d07374edda353e14ac4f29201726b0062a2f046c1a2b482c\",\"urls\":[\"bzz-raw://fd11c5db01039bf2c95f3561b08d271b80b7b1cb9fd7f75da887f7609807c5a7\",\"dweb:/ipfs/QmcY6CugdEHaYUa8ZKSnUDhvtVuoLfpDscZcmC91koAn1t\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Monetary.sol\":{\"keccak256\":\"0x5257274f2d4d3605f3e97ec45fb902111fe9a22506f0b4cf308ea933bc81bfe2\",\"urls\":[\"bzz-raw://85b8023b78805063a2ec8d376f1f5983994eabd96efd8ceadb0224dbb71c5678\",\"dweb:/ipfs/QmaDhzCzRqsuHuJfhToEC4pATQHwhh7yWWsjwfuRzFT1kG\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0xe641662503ea29ca959e84674188c3e9deaaf64c5623fb9560a4301c521ca1d3\",\"urls\":[\"bzz-raw://b10a04c7d014b99eb792c8c774e203c846d070b30cf0b715325fc07838ed6a6d\",\"dweb:/ipfs/QmUqZWnbchfEY9jM647yQamHe4GzspfUeRQF9k2nn1Hixd\"]}},\"version\":1}",
|
|
5
|
+
"bytecode": "0x60636023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a723158204c0df50b58dfee68bb65a86ca4d1240b2c04dc3c3da182e7198a1ec3a1c511a86c6578706572696d656e74616cf564736f6c63430005100040",
|
|
6
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a723158204c0df50b58dfee68bb65a86ca4d1240b2c04dc3c3da182e7198a1ec3a1c511a86c6578706572696d656e74616cf564736f6c63430005100040",
|
|
7
7
|
"sourceMap": "875:3537:68:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24",
|
|
8
8
|
"deployedSourceMap": "875:3537:68:-;;;;;;;;",
|
|
9
9
|
"source": "/*\n\n Copyright 2019 dYdX Trading Inc.\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 { Bits } from \"./Bits.sol\";\nimport { Monetary } from \"./Monetary.sol\";\nimport { Require } from \"./Require.sol\";\n\n\n/**\n * @title Cache\n * @author dYdX\n *\n * Library for caching information about markets\n */\nlibrary Cache {\n\n // ============ Constants ============\n\n bytes32 internal constant FILE = \"Cache\";\n\n // ============ Structs ============\n\n struct MarketInfo {\n uint marketId;\n address token;\n bool isClosing;\n uint128 borrowPar;\n Monetary.Price price;\n }\n\n struct MarketCache {\n MarketInfo[] markets;\n uint256[] marketBitmaps;\n uint256 marketsLength;\n }\n\n // ============ Setter Functions ============\n\n /**\n * Initialize an empty cache for some given number of total markets.\n */\n function create(\n uint256 numMarkets\n )\n internal\n pure\n returns (MarketCache memory)\n {\n return MarketCache({\n markets: new MarketInfo[](0),\n marketBitmaps: Bits.createBitmaps(numMarkets),\n marketsLength: 0\n });\n }\n\n // ============ Getter Functions ============\n\n function getNumMarkets(\n MarketCache memory cache\n )\n internal\n pure\n returns (uint256)\n {\n return cache.markets.length;\n }\n\n function hasMarket(\n MarketCache memory cache,\n uint256 marketId\n )\n internal\n pure\n returns (bool)\n {\n return Bits.hasBit(cache.marketBitmaps, marketId);\n }\n\n function get(\n MarketCache memory cache,\n uint256 marketId\n )\n internal\n pure\n returns (MarketInfo memory)\n {\n Require.that(\n cache.markets.length > 0,\n FILE,\n \"not initialized\"\n );\n return _getInternal(\n cache.markets,\n 0,\n cache.marketsLength,\n marketId\n );\n }\n\n function set(\n MarketCache memory cache,\n uint256 marketId\n )\n internal\n pure\n {\n // Devs should not be able to call this function once the `markets` array has been initialized (non-zero length)\n Require.that(\n cache.markets.length == 0,\n FILE,\n \"already initialized\"\n );\n\n Bits.setBit(cache.marketBitmaps, marketId);\n\n cache.marketsLength += 1;\n }\n\n function getAtIndex(\n MarketCache memory cache,\n uint256 index\n )\n internal\n pure\n returns (MarketInfo memory)\n {\n Require.that(\n index < cache.markets.length,\n FILE,\n \"invalid index\",\n index,\n cache.markets.length\n );\n return cache.markets[index];\n }\n\n // ============ Private Functions ============\n\n function _getInternal(\n MarketInfo[] memory data,\n uint beginInclusive,\n uint endExclusive,\n uint marketId\n ) private pure returns (MarketInfo memory) {\n uint len = endExclusive - beginInclusive;\n if (len == 0 || (len == 1 && data[beginInclusive].marketId != marketId)) {\n revert(\"Cache: item not found\");\n }\n\n uint mid = beginInclusive + len / 2;\n uint midMarketId = data[mid].marketId;\n if (marketId < midMarketId) {\n return _getInternal(\n data,\n beginInclusive,\n mid,\n marketId\n );\n } else if (marketId > midMarketId) {\n return _getInternal(\n data,\n mid + 1,\n endExclusive,\n marketId\n );\n } else {\n return data[mid];\n }\n }\n\n}\n",
|
|
10
|
-
"sourcePath": "/
|
|
10
|
+
"sourcePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Cache.sol",
|
|
11
11
|
"ast": {
|
|
12
|
-
"absolutePath": "/
|
|
12
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Cache.sol",
|
|
13
13
|
"exportedSymbols": {
|
|
14
14
|
"Cache": [
|
|
15
15
|
28955
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"src": "627:33:68"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
"absolutePath": "/
|
|
42
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol",
|
|
43
43
|
"file": "./Bits.sol",
|
|
44
44
|
"id": 28693,
|
|
45
45
|
"nodeType": "ImportDirective",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"unitAlias": ""
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
"absolutePath": "/
|
|
58
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Monetary.sol",
|
|
59
59
|
"file": "./Monetary.sol",
|
|
60
60
|
"id": 28695,
|
|
61
61
|
"nodeType": "ImportDirective",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"unitAlias": ""
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
"absolutePath": "/
|
|
74
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol",
|
|
75
75
|
"file": "./Require.sol",
|
|
76
76
|
"id": 28697,
|
|
77
77
|
"nodeType": "ImportDirective",
|
|
@@ -3563,7 +3563,7 @@
|
|
|
3563
3563
|
"src": "603:3810:68"
|
|
3564
3564
|
},
|
|
3565
3565
|
"legacyAST": {
|
|
3566
|
-
"absolutePath": "/
|
|
3566
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Cache.sol",
|
|
3567
3567
|
"exportedSymbols": {
|
|
3568
3568
|
"Cache": [
|
|
3569
3569
|
28955
|
|
@@ -3593,7 +3593,7 @@
|
|
|
3593
3593
|
"src": "627:33:68"
|
|
3594
3594
|
},
|
|
3595
3595
|
{
|
|
3596
|
-
"absolutePath": "/
|
|
3596
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol",
|
|
3597
3597
|
"file": "./Bits.sol",
|
|
3598
3598
|
"id": 28693,
|
|
3599
3599
|
"nodeType": "ImportDirective",
|
|
@@ -3609,7 +3609,7 @@
|
|
|
3609
3609
|
"unitAlias": ""
|
|
3610
3610
|
},
|
|
3611
3611
|
{
|
|
3612
|
-
"absolutePath": "/
|
|
3612
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Monetary.sol",
|
|
3613
3613
|
"file": "./Monetary.sol",
|
|
3614
3614
|
"id": 28695,
|
|
3615
3615
|
"nodeType": "ImportDirective",
|
|
@@ -3625,7 +3625,7 @@
|
|
|
3625
3625
|
"unitAlias": ""
|
|
3626
3626
|
},
|
|
3627
3627
|
{
|
|
3628
|
-
"absolutePath": "/
|
|
3628
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol",
|
|
3629
3629
|
"file": "./Require.sol",
|
|
3630
3630
|
"id": 28697,
|
|
3631
3631
|
"nodeType": "ImportDirective",
|
|
@@ -7122,7 +7122,7 @@
|
|
|
7122
7122
|
},
|
|
7123
7123
|
"networks": {},
|
|
7124
7124
|
"schemaVersion": "3.0.23",
|
|
7125
|
-
"updatedAt": "2022-02-
|
|
7125
|
+
"updatedAt": "2022-02-07T07:18:45.278Z",
|
|
7126
7126
|
"devdoc": {
|
|
7127
7127
|
"author": "dYdX * Library for caching information about markets",
|
|
7128
7128
|
"methods": {},
|
|
@@ -355,15 +355,15 @@
|
|
|
355
355
|
"type": "function"
|
|
356
356
|
}
|
|
357
357
|
],
|
|
358
|
-
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"chainlinkAggregators\",\"type\":\"address[]\"},{\"internalType\":\"uint8[]\",\"name\":\"tokenDecimals\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"tokenPairs\",\"type\":\"address[]\"},{\"internalType\":\"uint8[]\",\"name\":\"aggregatorDecimals\",\"type\":\"uint8[]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenPair\",\"type\":\"address\"}],\"name\":\"TokenInsertedOrUpdated\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"CHAINLINK_ETH_DECIMALS\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"CHAINLINK_USD_DECIMALS\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ONE_DOLLAR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"struct Monetary.Price\",\"name\":\"\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"chainlinkAggregator\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"aggregatorDecimals\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"tokenPair\",\"type\":\"address\"}],\"name\":\"insertOrUpdateOracleToken\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"valueDecimals\",\"type\":\"uint8\"}],\"name\":\"standardizeNumberOfDecimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenToAggregatorDecimalsMap\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenToAggregatorMap\",\"outputs\":[{\"internalType\":\"contract IChainlinkAggregator\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenToDecimalsMap\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenToPairingMap\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Dolomite * An implementation of the dYdX IPriceOracle interface that makes Chainlink prices compatible with the protocol.\",\"methods\":{\"constructor\":{\"params\":{\"aggregatorDecimals\":\"The number of decimals that the value has that comes back from the corresponding Chainlink Aggregator.\",\"chainlinkAggregators\":\"The Chainlink aggregators that have on-chain prices.\",\"tokenDecimals\":\"The number of decimals that each token has.\",\"tokenPairs\":\"The token against which this token's value is compared using the aggregator. The zero address means USD.\",\"tokens\":\"The tokens that are supported by this adapter.\"}},\"isOwner()\":{\"details\":\"Returns true if the caller is the current owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. * NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"ChainlinkPriceOracleV1\"},\"userdoc\":{\"methods\":{\"constructor\":\"Note, these arrays are set up, such that each index corresponds with one-another.\",\"standardizeNumberOfDecimals(uint8,uint256,uint8)\":{\"notice\":\"Standardizes `value` to have `ONE_DOLLAR` - `tokenDecimals` number of decimals.\"}}}},\"settings\":{\"compilationTarget\":{\"/
|
|
359
|
-
"bytecode": "0x608060405260058054600860ff199091161761ff0019166112001790553480156200002957600080fd5b5060405162001a6838038062001a688339810160408190526200004c91620003e5565b6000620000616001600160e01b03620001df16565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508351855114620000d85760405162461bcd60e51b8152600401620000cf906200063c565b60405180910390fd5b8251845114620000fc5760405162461bcd60e51b8152600401620000cf906200062a565b8151835114620001205760405162461bcd60e51b8152600401620000cf9062000606565b8051825114620001445760405162461bcd60e51b8152600401620000cf9062000618565b60005b8551811015620001d357620001ca8682815181106200016257fe5b60200260200101518583815181106200017757fe5b60200260200101518784815181106200018c57fe5b6020026020010151858581518110620001a157fe5b6020026020010151878681518110620001b657fe5b6020026020010151620001e360201b60201c565b60010162000147565b505050505050620006dc565b3390565b6001600160a01b03858116600090815260016020908152604080832080546001600160a01b03191688861617905560029091529020805460ff191660ff871617905581161562000272576001600160a01b03858116600090815260036020908152604080832080546001600160a01b031916948616949094179093556004905220805460ff191660ff84161790555b806001600160a01b0316836001600160a01b0316866001600160a01b03167ff6dcff57d435662a867049d43b76e51e72ffba006347ec701ce100b59ee6da3760405160405180910390a45050505050565b8051620002d081620006b7565b92915050565b600082601f830112620002e857600080fd5b8151620002ff620002f98262000675565b6200064e565b915081818352602084019350602081019050838560208402820111156200032557600080fd5b60005b838110156200035557816200033e8882620002c3565b845250602092830192919091019060010162000328565b5050505092915050565b600082601f8301126200037157600080fd5b815162000382620002f98262000675565b91508181835260208401935060208101905083856020840282011115620003a857600080fd5b60005b83811015620003555781620003c18882620003d8565b8452506020928301929190910190600101620003ab565b8051620002d081620006d1565b600080600080600060a08688031215620003fe57600080fd5b85516001600160401b038111156200041557600080fd5b6200042388828901620002d6565b95505060208601516001600160401b038111156200044057600080fd5b6200044e88828901620002d6565b94505060408601516001600160401b038111156200046b57600080fd5b62000479888289016200035f565b93505060608601516001600160401b038111156200049657600080fd5b620004a488828901620002d6565b92505060808601516001600160401b03811115620004c157600080fd5b620004cf888289016200035f565b9150509295509295909350565b6000620004eb60328362000696565b60008051602062001a488339815191528152710e8ded6cadc40e0c2d2e4e640d8cadccee8d60731b602082015260400192915050565b600062000530603a8362000696565b60008051602062001a4883398151915281527f61676772656761746f7220646563696d616c73206c656e677468000000000000602082015260400192915050565b60006200058060358362000696565b60008051602062001a4883398151915281527f746f6b656e20646563696d616c73206c656e6774680000000000000000000000602082015260400192915050565b6000620005d060328362000696565b60008051602062001a488339815191528152710c2cecee4cacec2e8dee4e640d8cadccee8d60731b602082015260400192915050565b60208082528101620002d081620004dc565b60208082528101620002d08162000521565b60208082528101620002d08162000571565b60208082528101620002d081620005c1565b6040518181016001600160401b03811182821017156200066d57600080fd5b604052919050565b60006001600160401b038211156200068c57600080fd5b5060209081020190565b90815260200190565b60006001600160a01b038216620002d0565b60ff1690565b620006c2816200069f565b8114620006ce57600080fd5b50565b620006c281620006b1565b61135c80620006ec6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806378f875b41161008c578063a9c12c8411610066578063a9c12c84146101c2578063d08f9942146101d5578063f042c094146101f5578063f2fde38b146101fd576100ea565b806378f875b4146101925780638da5cb5b146101a55780638f32d59b146101ad576100ea565b80632f4abe92116100c85780632f4abe921461013557806341976e0914610155578063572ca9e714610175578063715018a61461018a576100ea565b806309359d02146100ef57806321fff1c31461011857806323c77b9e1461012d575b600080fd5b6101026100fd366004610e36565b610210565b60405161010f91906111fd565b60405180910390f35b61012b610126366004610e5c565b610225565b005b610102610280565b610148610143366004610e36565b610289565b60405161010f9190611176565b610168610163366004610e36565b6102b1565b60405161010f91906111e1565b61017d610530565b60405161010f91906111ef565b61012b610543565b61017d6101a0366004610eef565b6105f0565b610148610641565b6101b561065d565b60405161010f9190611184565b6101026101d0366004610e36565b61069b565b6101e86101e3366004610e36565b6106b0565b60405161010f9190611192565b6101026106d8565b61012b61020b366004610e36565b6106e6565b60046020526000908152604090205460ff1681565b61022d61065d565b61026c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b60405180910390fd5b6102798585858585610730565b5050505050565b60055460ff1681565b60036020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6102b9610df7565b73ffffffffffffffffffffffffffffffffffffffff82811660009081526001602052604090205461032f911615157f436861696e6c696e6b50726963654f7261636c655631000000000000000000007f696e76616c696420746f6b656e00000000000000000000000000000000000000856108bc565b73ffffffffffffffffffffffffffffffffffffffff80831660009081526001602090815260408083205481517f50d25bcd0000000000000000000000000000000000000000000000000000000081529151939416926350d25bcd92600480840193919291829003018186803b1580156103a757600080fd5b505afa1580156103bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103df9190810190610ed1565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526003602090815260408083205460029092528220549394509091169161045f9060ff168484156104545773ffffffffffffffffffffffffffffffffffffffff881660009081526004602052604090205460ff166101a0565b60055460ff166105f0565b905073ffffffffffffffffffffffffffffffffffffffff821661049557604051806020016040528082815250935050505061052b565b60006104a0836102b1565b5173ffffffffffffffffffffffffffffffffffffffff8416600090815260026020526040812054919250906104e290839060ff16600a0a63ffffffff6109b816565b905060405180602001604052806105216ec097ce7bc90715b34b9f100000000061051585886109b890919063ffffffff16565b9063ffffffff610a1516565b9052955050505050505b919050565b6ec097ce7bc90715b34b9f100000000081565b61054b61065d565b610581576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600060ff8416600a0a816106196ec097ce7bc90715b34b9f10000000008363ffffffff610a1516565b905060ff8416600a0a61063681610515888563ffffffff6109b816565b979650505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6000805473ffffffffffffffffffffffffffffffffffffffff1661067f610a57565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b60026020526000908152604090205460ff1681565b60016020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b600554610100900460ff1681565b6106ee61065d565b610724576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b61072d81610a5b565b50565b73ffffffffffffffffffffffffffffffffffffffff858116600090815260016020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168886161790556002909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff87161790558116156108445773ffffffffffffffffffffffffffffffffffffffff858116600090815260036020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694861694909417909355600490522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff84161790555b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167ff6dcff57d435662a867049d43b76e51e72ffba006347ec701ce100b59ee6da3760405160405180910390a45050505050565b836109b2576108ca83610b35565b7f3a200000000000000000000000000000000000000000000000000000000000006108f484610b35565b7f203c00000000000000000000000000000000000000000000000000000000000061091e85610c0d565b6040516109549594939291907f3e0000000000000000000000000000000000000000000000000000000000000090602001611118565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610263916004016111a0565b50505050565b6000826109c757506000610a0f565b828202828482816109d457fe5b0414610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111c1565b90505b92915050565b6000610a0c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d84565b3390565b73ffffffffffffffffffffffffffffffffffffffff8116610aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111b1565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60608082604051602001610b499190611103565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052905060205b8015610bf25781517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90910190829082908110610bb557fe5b01602001517fff000000000000000000000000000000000000000000000000000000000000001615610bed576001018152905061052b565b610b7c565b5060408051600080825260208201909252905b509392505050565b60408051602a808252606082810190935273ffffffffffffffffffffffffffffffffffffffff8416918391602082018180388339019050509050603060f81b81600081518110610c5957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350607860f81b81600181518110610c9a57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b6014811015610c055760028102610ce5600f8516610dd5565b838260290381518110610cf457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600484901c9350610d36600f8516610dd5565b838260280381518110610d4557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505060049290921c91600101610ccc565b60008183610dbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026391906111a0565b506000838581610dcb57fe5b0495945050505050565b6000600a821015610ded57506030810160f81b61052b565b5060570160f81b90565b6040518060200160405280600081525090565b8035610a0f816112f3565b8051610a0f81611307565b8035610a0f81611307565b8035610a0f81611310565b600060208284031215610e4857600080fd5b6000610e548484610e0a565b949350505050565b600080600080600060a08688031215610e7457600080fd5b6000610e808888610e0a565b9550506020610e9188828901610e2b565b9450506040610ea288828901610e0a565b9350506060610eb388828901610e2b565b9250506080610ec488828901610e0a565b9150509295509295909350565b600060208284031215610ee357600080fd5b6000610e548484610e15565b600080600060608486031215610f0457600080fd5b6000610f108686610e2b565b9350506020610f2186828701610e20565b9250506040610f3286828701610e2b565b9150509250925092565b610f4581611218565b82525050565b610f4581611223565b610f45610f6082611228565b611272565b610f45610f608261124d565b610f45610f6082611272565b6000610f888261120b565b610f92818561052b565b9350610fa281856020860161129f565b9290920192915050565b610f4581611294565b6000610fc08261120b565b610fca818561120f565b9350610fda81856020860161129f565b610fe3816112cb565b9093019392505050565b6000610ffa60268361120f565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b600061105960218361120f565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006110b860208361120f565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b805160208301906109b284825b610f4581611272565b610f458161128e565b600061110f8284610f71565b50602001919050565b60006111248289610f7d565b91506111308288610f65565b6002820191506111408287610f7d565b915061114c8286610f65565b60028201915061115c8285610f7d565b91506111688284610f54565b506001019695505050505050565b60208101610a0f8284610f3c565b60208101610a0f8284610f4b565b60208101610a0f8284610fac565b60208082528101610a0c8184610fb5565b60208082528101610a0f81610fed565b60208082528101610a0f8161104c565b60208082528101610a0f816110ab565b60208101610a0f82846110e4565b60208101610a0f82846110f1565b60208101610a0f82846110fa565b5190565b90815260200190565b6000610a0f82611275565b151590565b7fff000000000000000000000000000000000000000000000000000000000000001690565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b60ff1690565b6000610a0f82611218565b60005b838110156112ba5781810151838201526020016112a2565b838111156109b25750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b6112fc81611218565b811461072d57600080fd5b6112fc81611272565b6112fc8161128e56fea365627a7a72315820d9231960fc8f1c0833f02aedcfe6f5048655b8f6734ec417c6566b2f0177b3f16c6578706572696d656e74616cf564736f6c63430005100040436861696e6c696e6b50726963654f7261636c6556313a20696e76616c696420",
|
|
360
|
-
"deployedBytecode": "
|
|
358
|
+
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"chainlinkAggregators\",\"type\":\"address[]\"},{\"internalType\":\"uint8[]\",\"name\":\"tokenDecimals\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"tokenPairs\",\"type\":\"address[]\"},{\"internalType\":\"uint8[]\",\"name\":\"aggregatorDecimals\",\"type\":\"uint8[]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenPair\",\"type\":\"address\"}],\"name\":\"TokenInsertedOrUpdated\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"CHAINLINK_ETH_DECIMALS\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"CHAINLINK_USD_DECIMALS\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ONE_DOLLAR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"struct Monetary.Price\",\"name\":\"\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"chainlinkAggregator\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"aggregatorDecimals\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"tokenPair\",\"type\":\"address\"}],\"name\":\"insertOrUpdateOracleToken\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"valueDecimals\",\"type\":\"uint8\"}],\"name\":\"standardizeNumberOfDecimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenToAggregatorDecimalsMap\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenToAggregatorMap\",\"outputs\":[{\"internalType\":\"contract IChainlinkAggregator\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenToDecimalsMap\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenToPairingMap\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Dolomite * An implementation of the dYdX IPriceOracle interface that makes Chainlink prices compatible with the protocol.\",\"methods\":{\"constructor\":{\"params\":{\"aggregatorDecimals\":\"The number of decimals that the value has that comes back from the corresponding Chainlink Aggregator.\",\"chainlinkAggregators\":\"The Chainlink aggregators that have on-chain prices.\",\"tokenDecimals\":\"The number of decimals that each token has.\",\"tokenPairs\":\"The token against which this token's value is compared using the aggregator. The zero address means USD.\",\"tokens\":\"The tokens that are supported by this adapter.\"}},\"isOwner()\":{\"details\":\"Returns true if the caller is the current owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. * NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"ChainlinkPriceOracleV1\"},\"userdoc\":{\"methods\":{\"constructor\":\"Note, these arrays are set up, such that each index corresponds with one-another.\",\"standardizeNumberOfDecimals(uint8,uint256,uint8)\":{\"notice\":\"Standardizes `value` to have `ONE_DOLLAR` - `tokenDecimals` number of decimals.\"}}}},\"settings\":{\"compilationTarget\":{\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/oracles/ChainlinkPriceOracleV1.sol\":\"ChainlinkPriceOracleV1\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/interfaces/IChainlinkAggregator.sol\":{\"keccak256\":\"0xc8c16d8fb7fe57637d33bac84af3ea4c087896612ee629357735c6afe4802a75\",\"urls\":[\"bzz-raw://560ddc4d72da39030111a3ae74dc5f38f0a83eeb30a07bc49c5b6ba3ba07f981\",\"dweb:/ipfs/QmRdYwQRcWHnHmNi6Xuy139AP1SZit5u2NdvmauYjC48V6\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/oracles/ChainlinkPriceOracleV1.sol\":{\"keccak256\":\"0x3d4f8c6c9c44c4029140619500882da0ad09cc2fb7fefe9c4fd0833f0248729e\",\"urls\":[\"bzz-raw://6e8c7014113d5bd5665bea6bb11e3545ba0c50c24d2b9a638481bf13004d9ccc\",\"dweb:/ipfs/QmQLQUL8azWi2ZoHmSaL7MqMU55BQkDsPEUhGHy1rFjTu9\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0x3f7c3d1397390ea44c6d5e5730d49476431c3df3b28334fe38218de5edc31138\",\"urls\":[\"bzz-raw://63ebf926fca9ce33aaabaf93805686acc25daded1648d6dab59c8c4d05116918\",\"dweb:/ipfs/QmeGkDp7ycYstpfqCYBiqoCYwy876gabx8r42o5koj3H5A\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Monetary.sol\":{\"keccak256\":\"0x5257274f2d4d3605f3e97ec45fb902111fe9a22506f0b4cf308ea933bc81bfe2\",\"urls\":[\"bzz-raw://85b8023b78805063a2ec8d376f1f5983994eabd96efd8ceadb0224dbb71c5678\",\"dweb:/ipfs/QmaDhzCzRqsuHuJfhToEC4pATQHwhh7yWWsjwfuRzFT1kG\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0xe641662503ea29ca959e84674188c3e9deaaf64c5623fb9560a4301c521ca1d3\",\"urls\":[\"bzz-raw://b10a04c7d014b99eb792c8c774e203c846d070b30cf0b715325fc07838ed6a6d\",\"dweb:/ipfs/QmUqZWnbchfEY9jM647yQamHe4GzspfUeRQF9k2nn1Hixd\"]},\"@openzeppelin/contracts/GSN/Context.sol\":{\"keccak256\":\"0x90a3995645af7562d84b9d69363ffa5ae7217714ab61e951bf7bc450f40e4061\",\"urls\":[\"bzz-raw://216ef9d6b614db4eb46970b4e84903f2534a45572dd30a79f0041f1a5830f436\",\"dweb:/ipfs/QmNPrJ4MWKUAWzKXpUqeyKRUfosaoANZAqXgvepdrCwZAG\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]},\"@openzeppelin/contracts/ownership/Ownable.sol\":{\"keccak256\":\"0x6fb9d7889769d7cc161225f9ef7a90e468ba9788b253816f8d8b6894d3472c24\",\"urls\":[\"bzz-raw://cf4c00fc3c37cc5acf0c82ec6fd97bab67d72c2567fdc0ebf023d9c09b30a08e\",\"dweb:/ipfs/Qmb7TChG6DsEDX7LooJ4vmxot19f7VXX8S1zUGPeJTWbwZ\"]}},\"version\":1}",
|
|
359
|
+
"bytecode": "0x608060405260058054600860ff199091161761ff0019166112001790553480156200002957600080fd5b5060405162001a6838038062001a688339810160408190526200004c91620003e5565b6000620000616001600160e01b03620001df16565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508351855114620000d85760405162461bcd60e51b8152600401620000cf906200063c565b60405180910390fd5b8251845114620000fc5760405162461bcd60e51b8152600401620000cf906200062a565b8151835114620001205760405162461bcd60e51b8152600401620000cf9062000606565b8051825114620001445760405162461bcd60e51b8152600401620000cf9062000618565b60005b8551811015620001d357620001ca8682815181106200016257fe5b60200260200101518583815181106200017757fe5b60200260200101518784815181106200018c57fe5b6020026020010151858581518110620001a157fe5b6020026020010151878681518110620001b657fe5b6020026020010151620001e360201b60201c565b60010162000147565b505050505050620006dc565b3390565b6001600160a01b03858116600090815260016020908152604080832080546001600160a01b03191688861617905560029091529020805460ff191660ff871617905581161562000272576001600160a01b03858116600090815260036020908152604080832080546001600160a01b031916948616949094179093556004905220805460ff191660ff84161790555b806001600160a01b0316836001600160a01b0316866001600160a01b03167ff6dcff57d435662a867049d43b76e51e72ffba006347ec701ce100b59ee6da3760405160405180910390a45050505050565b8051620002d081620006b7565b92915050565b600082601f830112620002e857600080fd5b8151620002ff620002f98262000675565b6200064e565b915081818352602084019350602081019050838560208402820111156200032557600080fd5b60005b838110156200035557816200033e8882620002c3565b845250602092830192919091019060010162000328565b5050505092915050565b600082601f8301126200037157600080fd5b815162000382620002f98262000675565b91508181835260208401935060208101905083856020840282011115620003a857600080fd5b60005b83811015620003555781620003c18882620003d8565b8452506020928301929190910190600101620003ab565b8051620002d081620006d1565b600080600080600060a08688031215620003fe57600080fd5b85516001600160401b038111156200041557600080fd5b6200042388828901620002d6565b95505060208601516001600160401b038111156200044057600080fd5b6200044e88828901620002d6565b94505060408601516001600160401b038111156200046b57600080fd5b62000479888289016200035f565b93505060608601516001600160401b038111156200049657600080fd5b620004a488828901620002d6565b92505060808601516001600160401b03811115620004c157600080fd5b620004cf888289016200035f565b9150509295509295909350565b6000620004eb60328362000696565b60008051602062001a488339815191528152710e8ded6cadc40e0c2d2e4e640d8cadccee8d60731b602082015260400192915050565b600062000530603a8362000696565b60008051602062001a4883398151915281527f61676772656761746f7220646563696d616c73206c656e677468000000000000602082015260400192915050565b60006200058060358362000696565b60008051602062001a4883398151915281527f746f6b656e20646563696d616c73206c656e6774680000000000000000000000602082015260400192915050565b6000620005d060328362000696565b60008051602062001a488339815191528152710c2cecee4cacec2e8dee4e640d8cadccee8d60731b602082015260400192915050565b60208082528101620002d081620004dc565b60208082528101620002d08162000521565b60208082528101620002d08162000571565b60208082528101620002d081620005c1565b6040518181016001600160401b03811182821017156200066d57600080fd5b604052919050565b60006001600160401b038211156200068c57600080fd5b5060209081020190565b90815260200190565b60006001600160a01b038216620002d0565b60ff1690565b620006c2816200069f565b8114620006ce57600080fd5b50565b620006c281620006b1565b61135c80620006ec6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806378f875b41161008c578063a9c12c8411610066578063a9c12c84146101c2578063d08f9942146101d5578063f042c094146101f5578063f2fde38b146101fd576100ea565b806378f875b4146101925780638da5cb5b146101a55780638f32d59b146101ad576100ea565b80632f4abe92116100c85780632f4abe921461013557806341976e0914610155578063572ca9e714610175578063715018a61461018a576100ea565b806309359d02146100ef57806321fff1c31461011857806323c77b9e1461012d575b600080fd5b6101026100fd366004610e36565b610210565b60405161010f91906111fd565b60405180910390f35b61012b610126366004610e5c565b610225565b005b610102610280565b610148610143366004610e36565b610289565b60405161010f9190611176565b610168610163366004610e36565b6102b1565b60405161010f91906111e1565b61017d610530565b60405161010f91906111ef565b61012b610543565b61017d6101a0366004610eef565b6105f0565b610148610641565b6101b561065d565b60405161010f9190611184565b6101026101d0366004610e36565b61069b565b6101e86101e3366004610e36565b6106b0565b60405161010f9190611192565b6101026106d8565b61012b61020b366004610e36565b6106e6565b60046020526000908152604090205460ff1681565b61022d61065d565b61026c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b60405180910390fd5b6102798585858585610730565b5050505050565b60055460ff1681565b60036020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6102b9610df7565b73ffffffffffffffffffffffffffffffffffffffff82811660009081526001602052604090205461032f911615157f436861696e6c696e6b50726963654f7261636c655631000000000000000000007f696e76616c696420746f6b656e00000000000000000000000000000000000000856108bc565b73ffffffffffffffffffffffffffffffffffffffff80831660009081526001602090815260408083205481517f50d25bcd0000000000000000000000000000000000000000000000000000000081529151939416926350d25bcd92600480840193919291829003018186803b1580156103a757600080fd5b505afa1580156103bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103df9190810190610ed1565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526003602090815260408083205460029092528220549394509091169161045f9060ff168484156104545773ffffffffffffffffffffffffffffffffffffffff881660009081526004602052604090205460ff166101a0565b60055460ff166105f0565b905073ffffffffffffffffffffffffffffffffffffffff821661049557604051806020016040528082815250935050505061052b565b60006104a0836102b1565b5173ffffffffffffffffffffffffffffffffffffffff8416600090815260026020526040812054919250906104e290839060ff16600a0a63ffffffff6109b816565b905060405180602001604052806105216ec097ce7bc90715b34b9f100000000061051585886109b890919063ffffffff16565b9063ffffffff610a1516565b9052955050505050505b919050565b6ec097ce7bc90715b34b9f100000000081565b61054b61065d565b610581576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600060ff8416600a0a816106196ec097ce7bc90715b34b9f10000000008363ffffffff610a1516565b905060ff8416600a0a61063681610515888563ffffffff6109b816565b979650505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6000805473ffffffffffffffffffffffffffffffffffffffff1661067f610a57565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b60026020526000908152604090205460ff1681565b60016020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b600554610100900460ff1681565b6106ee61065d565b610724576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b61072d81610a5b565b50565b73ffffffffffffffffffffffffffffffffffffffff858116600090815260016020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168886161790556002909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff87161790558116156108445773ffffffffffffffffffffffffffffffffffffffff858116600090815260036020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694861694909417909355600490522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff84161790555b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167ff6dcff57d435662a867049d43b76e51e72ffba006347ec701ce100b59ee6da3760405160405180910390a45050505050565b836109b2576108ca83610b35565b7f3a200000000000000000000000000000000000000000000000000000000000006108f484610b35565b7f203c00000000000000000000000000000000000000000000000000000000000061091e85610c0d565b6040516109549594939291907f3e0000000000000000000000000000000000000000000000000000000000000090602001611118565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610263916004016111a0565b50505050565b6000826109c757506000610a0f565b828202828482816109d457fe5b0414610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111c1565b90505b92915050565b6000610a0c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d84565b3390565b73ffffffffffffffffffffffffffffffffffffffff8116610aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111b1565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60608082604051602001610b499190611103565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052905060205b8015610bf25781517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90910190829082908110610bb557fe5b01602001517fff000000000000000000000000000000000000000000000000000000000000001615610bed576001018152905061052b565b610b7c565b5060408051600080825260208201909252905b509392505050565b60408051602a808252606082810190935273ffffffffffffffffffffffffffffffffffffffff8416918391602082018180388339019050509050603060f81b81600081518110610c5957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350607860f81b81600181518110610c9a57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b6014811015610c055760028102610ce5600f8516610dd5565b838260290381518110610cf457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600484901c9350610d36600f8516610dd5565b838260280381518110610d4557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505060049290921c91600101610ccc565b60008183610dbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026391906111a0565b506000838581610dcb57fe5b0495945050505050565b6000600a821015610ded57506030810160f81b61052b565b5060570160f81b90565b6040518060200160405280600081525090565b8035610a0f816112f3565b8051610a0f81611307565b8035610a0f81611307565b8035610a0f81611310565b600060208284031215610e4857600080fd5b6000610e548484610e0a565b949350505050565b600080600080600060a08688031215610e7457600080fd5b6000610e808888610e0a565b9550506020610e9188828901610e2b565b9450506040610ea288828901610e0a565b9350506060610eb388828901610e2b565b9250506080610ec488828901610e0a565b9150509295509295909350565b600060208284031215610ee357600080fd5b6000610e548484610e15565b600080600060608486031215610f0457600080fd5b6000610f108686610e2b565b9350506020610f2186828701610e20565b9250506040610f3286828701610e2b565b9150509250925092565b610f4581611218565b82525050565b610f4581611223565b610f45610f6082611228565b611272565b610f45610f608261124d565b610f45610f6082611272565b6000610f888261120b565b610f92818561052b565b9350610fa281856020860161129f565b9290920192915050565b610f4581611294565b6000610fc08261120b565b610fca818561120f565b9350610fda81856020860161129f565b610fe3816112cb565b9093019392505050565b6000610ffa60268361120f565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b600061105960218361120f565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006110b860208361120f565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b805160208301906109b284825b610f4581611272565b610f458161128e565b600061110f8284610f71565b50602001919050565b60006111248289610f7d565b91506111308288610f65565b6002820191506111408287610f7d565b915061114c8286610f65565b60028201915061115c8285610f7d565b91506111688284610f54565b506001019695505050505050565b60208101610a0f8284610f3c565b60208101610a0f8284610f4b565b60208101610a0f8284610fac565b60208082528101610a0c8184610fb5565b60208082528101610a0f81610fed565b60208082528101610a0f8161104c565b60208082528101610a0f816110ab565b60208101610a0f82846110e4565b60208101610a0f82846110f1565b60208101610a0f82846110fa565b5190565b90815260200190565b6000610a0f82611275565b151590565b7fff000000000000000000000000000000000000000000000000000000000000001690565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b60ff1690565b6000610a0f82611218565b60005b838110156112ba5781810151838201526020016112a2565b838111156109b25750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b6112fc81611218565b811461072d57600080fd5b6112fc81611272565b6112fc8161128e56fea365627a7a723158206d24140663db1aba1732cbfbd782167d4c2ad29aabe1b68db1bf7cc12e4fa6b36c6578706572696d656e74616cf564736f6c63430005100040436861696e6c696e6b50726963654f7261636c6556313a20696e76616c696420",
|
|
360
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806378f875b41161008c578063a9c12c8411610066578063a9c12c84146101c2578063d08f9942146101d5578063f042c094146101f5578063f2fde38b146101fd576100ea565b806378f875b4146101925780638da5cb5b146101a55780638f32d59b146101ad576100ea565b80632f4abe92116100c85780632f4abe921461013557806341976e0914610155578063572ca9e714610175578063715018a61461018a576100ea565b806309359d02146100ef57806321fff1c31461011857806323c77b9e1461012d575b600080fd5b6101026100fd366004610e36565b610210565b60405161010f91906111fd565b60405180910390f35b61012b610126366004610e5c565b610225565b005b610102610280565b610148610143366004610e36565b610289565b60405161010f9190611176565b610168610163366004610e36565b6102b1565b60405161010f91906111e1565b61017d610530565b60405161010f91906111ef565b61012b610543565b61017d6101a0366004610eef565b6105f0565b610148610641565b6101b561065d565b60405161010f9190611184565b6101026101d0366004610e36565b61069b565b6101e86101e3366004610e36565b6106b0565b60405161010f9190611192565b6101026106d8565b61012b61020b366004610e36565b6106e6565b60046020526000908152604090205460ff1681565b61022d61065d565b61026c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b60405180910390fd5b6102798585858585610730565b5050505050565b60055460ff1681565b60036020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6102b9610df7565b73ffffffffffffffffffffffffffffffffffffffff82811660009081526001602052604090205461032f911615157f436861696e6c696e6b50726963654f7261636c655631000000000000000000007f696e76616c696420746f6b656e00000000000000000000000000000000000000856108bc565b73ffffffffffffffffffffffffffffffffffffffff80831660009081526001602090815260408083205481517f50d25bcd0000000000000000000000000000000000000000000000000000000081529151939416926350d25bcd92600480840193919291829003018186803b1580156103a757600080fd5b505afa1580156103bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103df9190810190610ed1565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526003602090815260408083205460029092528220549394509091169161045f9060ff168484156104545773ffffffffffffffffffffffffffffffffffffffff881660009081526004602052604090205460ff166101a0565b60055460ff166105f0565b905073ffffffffffffffffffffffffffffffffffffffff821661049557604051806020016040528082815250935050505061052b565b60006104a0836102b1565b5173ffffffffffffffffffffffffffffffffffffffff8416600090815260026020526040812054919250906104e290839060ff16600a0a63ffffffff6109b816565b905060405180602001604052806105216ec097ce7bc90715b34b9f100000000061051585886109b890919063ffffffff16565b9063ffffffff610a1516565b9052955050505050505b919050565b6ec097ce7bc90715b34b9f100000000081565b61054b61065d565b610581576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600060ff8416600a0a816106196ec097ce7bc90715b34b9f10000000008363ffffffff610a1516565b905060ff8416600a0a61063681610515888563ffffffff6109b816565b979650505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6000805473ffffffffffffffffffffffffffffffffffffffff1661067f610a57565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b60026020526000908152604090205460ff1681565b60016020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b600554610100900460ff1681565b6106ee61065d565b610724576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111d1565b61072d81610a5b565b50565b73ffffffffffffffffffffffffffffffffffffffff858116600090815260016020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168886161790556002909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff87161790558116156108445773ffffffffffffffffffffffffffffffffffffffff858116600090815260036020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694861694909417909355600490522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff84161790555b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167ff6dcff57d435662a867049d43b76e51e72ffba006347ec701ce100b59ee6da3760405160405180910390a45050505050565b836109b2576108ca83610b35565b7f3a200000000000000000000000000000000000000000000000000000000000006108f484610b35565b7f203c00000000000000000000000000000000000000000000000000000000000061091e85610c0d565b6040516109549594939291907f3e0000000000000000000000000000000000000000000000000000000000000090602001611118565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610263916004016111a0565b50505050565b6000826109c757506000610a0f565b828202828482816109d457fe5b0414610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111c1565b90505b92915050565b6000610a0c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d84565b3390565b73ffffffffffffffffffffffffffffffffffffffff8116610aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610263906111b1565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60608082604051602001610b499190611103565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052905060205b8015610bf25781517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90910190829082908110610bb557fe5b01602001517fff000000000000000000000000000000000000000000000000000000000000001615610bed576001018152905061052b565b610b7c565b5060408051600080825260208201909252905b509392505050565b60408051602a808252606082810190935273ffffffffffffffffffffffffffffffffffffffff8416918391602082018180388339019050509050603060f81b81600081518110610c5957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350607860f81b81600181518110610c9a57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b6014811015610c055760028102610ce5600f8516610dd5565b838260290381518110610cf457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600484901c9350610d36600f8516610dd5565b838260280381518110610d4557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505060049290921c91600101610ccc565b60008183610dbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026391906111a0565b506000838581610dcb57fe5b0495945050505050565b6000600a821015610ded57506030810160f81b61052b565b5060570160f81b90565b6040518060200160405280600081525090565b8035610a0f816112f3565b8051610a0f81611307565b8035610a0f81611307565b8035610a0f81611310565b600060208284031215610e4857600080fd5b6000610e548484610e0a565b949350505050565b600080600080600060a08688031215610e7457600080fd5b6000610e808888610e0a565b9550506020610e9188828901610e2b565b9450506040610ea288828901610e0a565b9350506060610eb388828901610e2b565b9250506080610ec488828901610e0a565b9150509295509295909350565b600060208284031215610ee357600080fd5b6000610e548484610e15565b600080600060608486031215610f0457600080fd5b6000610f108686610e2b565b9350506020610f2186828701610e20565b9250506040610f3286828701610e2b565b9150509250925092565b610f4581611218565b82525050565b610f4581611223565b610f45610f6082611228565b611272565b610f45610f608261124d565b610f45610f6082611272565b6000610f888261120b565b610f92818561052b565b9350610fa281856020860161129f565b9290920192915050565b610f4581611294565b6000610fc08261120b565b610fca818561120f565b9350610fda81856020860161129f565b610fe3816112cb565b9093019392505050565b6000610ffa60268361120f565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b600061105960218361120f565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006110b860208361120f565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b805160208301906109b284825b610f4581611272565b610f458161128e565b600061110f8284610f71565b50602001919050565b60006111248289610f7d565b91506111308288610f65565b6002820191506111408287610f7d565b915061114c8286610f65565b60028201915061115c8285610f7d565b91506111688284610f54565b506001019695505050505050565b60208101610a0f8284610f3c565b60208101610a0f8284610f4b565b60208101610a0f8284610fac565b60208082528101610a0c8184610fb5565b60208082528101610a0f81610fed565b60208082528101610a0f8161104c565b60208082528101610a0f816110ab565b60208101610a0f82846110e4565b60208101610a0f82846110f1565b60208101610a0f82846110fa565b5190565b90815260200190565b6000610a0f82611275565b151590565b7fff000000000000000000000000000000000000000000000000000000000000001690565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b60ff1690565b6000610a0f82611218565b60005b838110156112ba5781810151838201526020016112a2565b838111156109b25750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b6112fc81611218565b811461072d57600080fd5b6112fc81611272565b6112fc8161128e56fea365627a7a723158206d24140663db1aba1732cbfbd782167d4c2ad29aabe1b68db1bf7cc12e4fa6b36c6578706572696d656e74616cf564736f6c63430005100040",
|
|
361
361
|
"sourceMap": "1129:6205:25:-;;;1811:39;;;1849:1;-1:-1:-1;;1811:39:25;;;;-1:-1:-1;;1856:40:25;;;;;2619:1228;5:2:-1;;;;30:1;27;20:12;5:2;2619:1228:25;;;;;;;;;;;;;;;;;;;;;698:17:125;718:12;-1:-1:-1;;;;;718:10:125;:12;:::i;:::-;740:6;:18;;-1:-1:-1;;;;;;740:18:125;-1:-1:-1;;;;;740:18:125;;;;;;;773:43;;740:18;;-1:-1:-1;740:18:125;773:43;;740:6;;773:43;664:159;2979:20:25;:27;2962:6;:13;:44;2941:141;;;;-1:-1:-1;;;2941:141:25;;;;;;;;;;;;;;;;;3144:13;:20;3113;:27;:51;3092:151;;;;-1:-1:-1;;;3092:151:25;;;;;;;;;3298:10;:17;3274:13;:20;:41;3253:138;;;;-1:-1:-1;;;3253:138:25;;;;;;;;;3443:18;:25;3422:10;:17;:46;3401:151;;;;-1:-1:-1;;;3401:151:25;;;;;;;;;3568:6;3563:278;3584:6;:13;3580:1;:17;3563:278;;;3618:212;3662:6;3669:1;3662:9;;;;;;;;;;;;;;3689:13;3703:1;3689:16;;;;;;;;;;;;;;3723:20;3744:1;3723:23;;;;;;;;;;;;;;3764:18;3783:1;3764:21;;;;;;;;;;;;;;3803:10;3814:1;3803:13;;;;;;;;;;;;;;3618:26;;;:212;;:::i;:::-;3599:3;;3563:278;;;;2619:1228;;;;;1129:6205;;788:96:122;867:10;788:96;:::o;6571:761:25:-;-1:-1:-1;;;;;6782:27:25;;;;;;;:20;:27;;;;;;;;:71;;-1:-1:-1;;;;;;6782:71:25;;;;;;;6863:18;:25;;;;;:41;;-1:-1:-1;;6863:41:25;;;;;;;6918:23;;;6914:336;;-1:-1:-1;;;;;7133:24:25;;;;;;;:17;:24;;;;;;;;:36;;-1:-1:-1;;;;;;7133:36:25;;;;;;;;;;;7183:28;:35;;;:56;;-1:-1:-1;;7183:56:25;;;;;;;6914:336;7315:9;-1:-1:-1;;;;;7264:61:25;7294:19;-1:-1:-1;;;;;7264:61:25;7287:5;-1:-1:-1;;;;;7264:61:25;;;;;;;;;;;6571:761;;;;;:::o;5:134:-1:-;83:13;;101:33;83:13;101:33;;;68:71;;;;;164:722;;292:3;285:4;277:6;273:17;269:27;259:2;;310:1;307;300:12;259:2;340:6;334:13;362:80;377:64;434:6;377:64;;;362:80;;;353:89;;459:5;484:6;477:5;470:21;514:4;506:6;502:17;492:27;;536:4;531:3;527:14;520:21;;589:6;636:3;628:4;620:6;616:17;611:3;607:27;604:36;601:2;;;653:1;650;643:12;601:2;678:1;663:217;688:6;685:1;682:13;663:217;;;746:3;768:48;812:3;800:10;768:48;;;756:61;;-1:-1;840:4;831:14;;;;859;;;;;710:1;703:9;663:217;;;667:14;252:634;;;;;;;;910:716;;1036:3;1029:4;1021:6;1017:17;1013:27;1003:2;;1054:1;1051;1044:12;1003:2;1084:6;1078:13;1106:78;1121:62;1176:6;1121:62;;1106:78;1097:87;;1201:5;1226:6;1219:5;1212:21;1256:4;1248:6;1244:17;1234:27;;1278:4;1273:3;1269:14;1262:21;;1331:6;1378:3;1370:4;1362:6;1358:17;1353:3;1349:27;1346:36;1343:2;;;1395:1;1392;1385:12;1343:2;1420:1;1405:215;1430:6;1427:1;1424:13;1405:215;;;1488:3;1510:46;1552:3;1540:10;1510:46;;;1498:59;;-1:-1;1580:4;1571:14;;;;1599;;;;;1452:1;1445:9;1405:215;;1634:130;1710:13;;1728:31;1710:13;1728:31;;1771:1446;;;;;;2075:3;2063:9;2054:7;2050:23;2046:33;2043:2;;;2092:1;2089;2082:12;2043:2;2127:24;;-1:-1;;;;;2160:30;;2157:2;;;2203:1;2200;2193:12;2157:2;2223:89;2304:7;2295:6;2284:9;2280:22;2223:89;;;2213:99;;2106:212;2370:2;2359:9;2355:18;2349:25;-1:-1;;;;;2386:6;2383:30;2380:2;;;2426:1;2423;2416:12;2380:2;2446:89;2527:7;2518:6;2507:9;2503:22;2446:89;;;2436:99;;2328:213;2593:2;2582:9;2578:18;2572:25;-1:-1;;;;;2609:6;2606:30;2603:2;;;2649:1;2646;2639:12;2603:2;2669:87;2748:7;2739:6;2728:9;2724:22;2669:87;;;2659:97;;2551:211;2814:2;2803:9;2799:18;2793:25;-1:-1;;;;;2830:6;2827:30;2824:2;;;2870:1;2867;2860:12;2824:2;2890:89;2971:7;2962:6;2951:9;2947:22;2890:89;;;2880:99;;2772:213;3037:3;3026:9;3022:19;3016:26;-1:-1;;;;;3054:6;3051:30;3048:2;;;3094:1;3091;3084:12;3048:2;3114:87;3193:7;3184:6;3173:9;3169:22;3114:87;;;3104:97;;2995:212;2037:1180;;;;;;;;;3225:387;;3385:67;3449:2;3444:3;3385:67;;;-1:-1;;;;;;;;;;;3465:55;;-1:-1;;;3549:2;3540:12;;3533:42;3603:2;3594:12;;3371:241;-1:-1;;3371:241;3621:395;;3781:67;3845:2;3840:3;3781:67;;;-1:-1;;;;;;;;;;;3861:55;;3950:28;3945:2;3936:12;;3929:50;4007:2;3998:12;;3767:249;-1:-1;;3767:249;4025:390;;4185:67;4249:2;4244:3;4185:67;;;-1:-1;;;;;;;;;;;4265:55;;4354:23;4349:2;4340:12;;4333:45;4406:2;4397:12;;4171:244;-1:-1;;4171:244;4424:387;;4584:67;4648:2;4643:3;4584:67;;;-1:-1;;;;;;;;;;;4664:55;;-1:-1;;;4748:2;4739:12;;4732:42;4802:2;4793:12;;4570:241;-1:-1;;4570:241;4819:407;5010:2;5024:47;;;4995:18;;5085:131;4995:18;5085:131;;5233:407;5424:2;5438:47;;;5409:18;;5499:131;5409:18;5499:131;;5647:407;5838:2;5852:47;;;5823:18;;5913:131;5823:18;5913:131;;6061:407;6252:2;6266:47;;;6237:18;;6327:131;6237:18;6327:131;;6475:256;6537:2;6531:9;6563:17;;;-1:-1;;;;;6623:34;;6659:22;;;6620:62;6617:2;;;6695:1;6692;6685:12;6617:2;6711;6704:22;6515:216;;-1:-1;6515:216;6738:304;;-1:-1;;;;;6889:6;6886:30;6883:2;;;6929:1;6926;6919:12;6883:2;-1:-1;6964:4;6952:17;;;7017:15;;6820:222;7359:163;7462:19;;;7511:4;7502:14;;7455:67;7530:91;;-1:-1;;;;;7690:54;;7592:24;7673:76;7756:81;7827:4;7816:16;;7799:38;7844:117;7913:24;7931:5;7913:24;;;7906:5;7903:35;7893:2;;7952:1;7949;7942:12;7893:2;7887:74;;7968:113;8035:22;8051:5;8035:22;;8009:72;1129:6205:25;;;;;;",
|
|
362
362
|
"deployedSourceMap": "1129:6205:25:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1129:6205:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1743:61;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;3903:395;;;;;;;;;:::i;:::-;;1811:39;;;:::i;1616:52::-;;;;;;;;;:::i;:::-;;;;;;;;4355:1644;;;;;;;;;:::i;:::-;;;;;;;;928:45:63;;;:::i;:::-;;;;;;;;1684:137:125;;;:::i;6108:404:25:-;;;;;;;;;:::i;899:77:125:-;;;:::i;1250:92::-;;;:::i;:::-;;;;;;;;1502:51:25;;;;;;;;;:::i;1428:68::-;;;;;;;;;:::i;:::-;;;;;;;;1856:40;;;:::i;1970:107:125:-;;;;;;;;;:::i;1743:61:25:-;;;;;;;;;;;;;;;:::o;3903:395::-;1103:9:125;:7;:9::i;:::-;1095:54;;;;;;;;;;;;;;;;;;;;;;4121:170:25;4161:5;4180:13;4207:19;4240:18;4272:9;4121:26;:170::i;:::-;3903:395;;;;;:::o;1811:39::-;;;;;;:::o;1616:52::-;;;;;;;;;;;;;;;:::o;4355:1644::-;4435:21;;:::i;:::-;4494:50;4502:27;;;4542:1;4502:27;;;:20;:27;;;;;;4468:152;;4502:27;4494:50;;4558:4;4468:152;4523:5;4468:12;:152::i;:::-;4661:27;;;;4631:22;4661:27;;;:20;:27;;;;;;;;;:42;;;;;;;4631:22;;4661:27;;:40;;:42;;;;;:27;;:42;;;;;;:27;:42;;;5:2:-1;;;;30:1;27;20:12;5:2;4661:42:25;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4661:42:25;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;4661:42:25;;;;;;;;;4734:24;;;;4714:17;4734:24;;;:17;:24;;;;;;;;;4938:18;:25;;;;;;4631:73;;-1:-1:-1;4734:24:25;;;;4897:207;;4938:25;;4631:73;5008:23;;:86;;5059:35;;;;;;;:28;:35;;;;;;;;5008:86;;;5034:22;;;;4897:27;:207::i;:::-;4872:232;-1:-1:-1;5119:23:25;;;5115:878;;5218:43;;;;;;;;5242:17;5218:43;;;5211:50;;;;;;;5115:878;5531:31;5565:19;5574:9;5565:8;:19::i;:::-;:25;5734:29;;;5565:25;5734:29;;;:18;:29;;;;;;5565:25;;-1:-1:-1;5565:25:25;5692:73;;5565:25;;5734:29;;5723:2;:41;5692:73;:30;:73;:::i;:::-;5661:104;;5894:88;;;;;;;;5918:62;965:8:63;5918:46:25;5940:23;5918:17;:21;;:46;;;;:::i;:::-;:50;:62;:50;:62;:::i;:::-;5894:88;;5887:95;-1:-1:-1;;;;;;4355:1644:25;;;;:::o;928:45:63:-;965:8;928:45;:::o;1684:137:125:-;1103:9;:7;:9::i;:::-;1095:54;;;;;;;;;;;;;;1782:1;1766:6;;1745:40;;;1766:6;;;;1745:40;;1782:1;;1745:40;1812:1;1795:19;;;;;;1684:137::o;6108:404:25:-;6250:4;6299:19;;;6293:2;:25;6250:4;6347:48;965:8:63;6293:25:25;6347:48;:27;:48;:::i;:::-;6328:67;-1:-1:-1;6430:19:25;;;6424:2;:25;6466:39;6424:25;6466:22;:5;6328:67;6466:22;:9;:22;:::i;:39::-;6459:46;6108:404;-1:-1:-1;;;;;;;6108:404:25:o;899:77:125:-;937:7;963:6;;;899:77;:::o;1250:92::-;1290:4;1329:6;;;;1313:12;:10;:12::i;:::-;:22;;;1306:29;;1250:92;:::o;1502:51:25:-;;;;;;;;;;;;;;;:::o;1428:68::-;;;;;;;;;;;;;;;:::o;1856:40::-;;;;;;;;;:::o;1970:107:125:-;1103:9;:7;:9::i;:::-;1095:54;;;;;;;;;;;;;;2042:28;2061:8;2042:18;:28::i;:::-;1970:107;:::o;6571:761:25:-;6782:27;;;;;;;;:20;:27;;;;;;;;:71;;;;;;;;;;6863:18;:25;;;;;:41;;;;;;;;;;6918:23;;;6914:336;;7133:24;;;;;;;;:17;:24;;;;;;;;:36;;;;;;;;;;;;;;7183:28;:35;;;:56;;;;;;;;;;6914:336;7315:9;7264:61;;7294:19;7264:61;;7287:5;7264:61;;;;;;;;;;;;6571:761;;;;;:::o;2962:561:77:-;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:77;;;;3142:364;;;;;;;;;3117:400;2962:561;;;;:::o;2159:459:124:-;2217:7;2458:6;2454:45;;-1:-1:-1;2487:1:124;2480:8;;2454:45;2521:5;;;2525:1;2521;:5;:1;2544:5;;;;;:10;2536:56;;;;;;;;;;;;;;2610:1;-1:-1:-1;2159:459:124;;;;;:::o;3073:130::-;3131:7;3157:39;3161:1;3164;3157:39;;;;;;;;;;;;;;;;;:3;:39::i;788:96:122:-;867:10;788:96;:::o;2178:225:125:-;2251:22;;;2243:73;;;;;;;;;;;;;;2352:6;;;2331:38;;;;;;;2352:6;;;2331:38;;;2379:6;:17;;;;;;;;;;;;;;;2178:225::o;6359:966:77:-;6462:12;6537:19;6576:5;6559:23;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;6559:23:77;;;;-1:-1:-1;49:4;6688:571:77;6709:5;;6688:571;;6960:9;;6862:3;;;;;6960:6;;6862:3;;6960:9;;;;;;;;;;;;:14;6956:293;;7015:1;7011:5;7141:22;;7148:6;-1:-1:-1;7221:13:77;;6956:293;6688:571;;;-1:-1:-1;7306:12:77;;;7316:1;7306:12;;;;;;;;;;;-1:-1:-1;7299:19:77;6359:966;-1:-1:-1;;;6359:966:77:o;8249:962::-;8521:13;;;8531:2;8521:13;;;8343:12;8521:13;;;;;;8383:14;;;;8343:12;;8521:13;;;21:6:-1;;104:10;8521:13:77;87:34:-1;135:17;;-1:-1;8521:13:77;8499:35;;902:2;8598:23;;8586:6;8593:1;8586:9;;;;;;;;;;;:35;;;;;;;;;;;1010:3;8643:27;;8631:6;8638:1;8631:9;;;;;;;;;;;:39;;;;;;;;;;-1:-1:-1;8784:9:77;8779:402;8803:2;8799:1;:6;8779:402;;;8892:1;8888:5;;8985:23;1232:3;8990:17;;8985:4;:23::i;:::-;8964:6;8976:5;8971:2;:10;8964:18;;;;;;;;;;;:44;;;;;;;;;;;9031:1;9026;:6;;9022:10;;9123:23;1232:3;9128:1;:17;9123:4;:23::i;:::-;9102:6;9114:5;9109:2;:10;9102:18;;;;;;;;;;;:44;;;;;;;;;;-1:-1:-1;;9169:1:77;9164:6;;;;;8807:3;;8779:402;;3718:338:124;3804:7;3904:12;3897:5;3889:28;;;;;;;;;;;;;;;;3927:9;3943:1;3939;:5;;;;;;;3718:338;-1:-1:-1;;;;;3718:338:124:o;10183:325:77:-;10272:4;10340:2;10332:5;:10;10328:79;;;-1:-1:-1;902:2:77;10376:18;;10365:31;;10358:38;;10328:79;-1:-1:-1;956:2:77;10472:27;10461:40;;;10183:325::o;1129:6205:25:-;;;;;;;;;;;;;;:::o;5:130:-1:-;72:20;;97:33;72:20;97:33;;142:132;219:13;;237:32;219:13;237:32;;281:130;348:20;;373:33;348:20;373:33;;418:126;483:20;;508:31;483:20;508:31;;551:241;;655:2;643:9;634:7;630:23;626:32;623:2;;;671:1;668;661:12;623:2;706:1;723:53;768:7;748:9;723:53;;;713:63;617:175;-1:-1;;;;617:175;799:735;;;;;;967:3;955:9;946:7;942:23;938:33;935:2;;;984:1;981;974:12;935:2;1019:1;1036:53;1081:7;1061:9;1036:53;;;1026:63;;998:97;1126:2;1144:51;1187:7;1178:6;1167:9;1163:22;1144:51;;;1134:61;;1105:96;1232:2;1250:53;1295:7;1286:6;1275:9;1271:22;1250:53;;;1240:63;;1211:98;1340:2;1358:51;1401:7;1392:6;1381:9;1377:22;1358:51;;;1348:61;;1319:96;1446:3;1465:53;1510:7;1501:6;1490:9;1486:22;1465:53;;;1455:63;;1425:99;929:605;;;;;;;;;1541:261;;1655:2;1643:9;1634:7;1630:23;1626:32;1623:2;;;1671:1;1668;1661:12;1623:2;1706:1;1723:63;1778:7;1758:9;1723:63;;1809:483;;;;1943:2;1931:9;1922:7;1918:23;1914:32;1911:2;;;1959:1;1956;1949:12;1911:2;1994:1;2011:51;2054:7;2034:9;2011:51;;;2001:61;;1973:95;2099:2;2117:53;2162:7;2153:6;2142:9;2138:22;2117:53;;;2107:63;;2078:98;2207:2;2225:51;2268:7;2259:6;2248:9;2244:22;2225:51;;;2215:61;;2186:96;1905:387;;;;;;2299:113;2382:24;2400:5;2382:24;;;2377:3;2370:37;2364:48;;;2419:104;2496:21;2511:5;2496:21;;2530:148;2629:43;2648:23;2665:5;2648:23;;;2629:43;;2685:148;2784:43;2803:23;2820:5;2803:23;;2840:152;2941:45;2961:24;2979:5;2961:24;;2999:356;;3127:38;3159:5;3127:38;;;3177:88;3258:6;3253:3;3177:88;;;3170:95;;3270:52;3315:6;3310:3;3303:4;3296:5;3292:16;3270:52;;;3334:16;;;;;3107:248;-1:-1;;3107:248;3362:184;3474:66;3534:5;3474:66;;3553:347;;3665:39;3698:5;3665:39;;;3716:71;3780:6;3775:3;3716:71;;;3709:78;;3792:52;3837:6;3832:3;3825:4;3818:5;3814:16;3792:52;;;3865:29;3887:6;3865:29;;;3856:39;;;;3645:255;-1:-1;;;3645:255;3908:375;;4068:67;4132:2;4127:3;4068:67;;;4168:34;4148:55;;4237:8;4232:2;4223:12;;4216:30;4274:2;4265:12;;4054:229;-1:-1;;4054:229;4292:370;;4452:67;4516:2;4511:3;4452:67;;;4552:34;4532:55;;4621:3;4616:2;4607:12;;4600:25;4653:2;4644:12;;4438:224;-1:-1;;4438:224;4671:332;;4831:67;4895:2;4890:3;4831:67;;;4931:34;4911:55;;4994:2;4985:12;;4817:186;-1:-1;;4817:186;5064:321;5272:23;;5205:4;5196:14;;;5301:63;5200:3;5272:23;5392:103;5465:24;5483:5;5465:24;;5622:107;5701:22;5717:5;5701:22;;5736:244;;5855:75;5926:3;5917:6;5855:75;;;-1:-1;5952:2;5943:12;;5843:137;-1:-1;5843:137;5987:978;;6301:93;6390:3;6381:6;6301:93;;;6294:100;;6405:73;6474:3;6465:6;6405:73;;;6500:1;6495:3;6491:11;6484:18;;6520:93;6609:3;6600:6;6520:93;;;6513:100;;6624:73;6693:3;6684:6;6624:73;;;6719:1;6714:3;6710:11;6703:18;;6739:93;6828:3;6819:6;6739:93;;;6732:100;;6843:73;6912:3;6903:6;6843:73;;;-1:-1;6938:1;6929:11;;6282:683;-1:-1;;;;;;6282:683;6972:213;7090:2;7075:18;;7104:71;7079:9;7148:6;7104:71;;7192:201;7304:2;7289:18;;7318:65;7293:9;7356:6;7318:65;;7400:271;7547:2;7532:18;;7561:100;7536:9;7634:6;7561:100;;7678:301;7816:2;7830:47;;;7801:18;;7891:78;7801:18;7955:6;7891:78;;7986:407;8177:2;8191:47;;;8162:18;;8252:131;8162:18;8252:131;;8400:407;8591:2;8605:47;;;8576:18;;8666:131;8576:18;8666:131;;8814:407;9005:2;9019:47;;;8990:18;;9080:131;8990:18;9080:131;;9228:309;9394:2;9379:18;;9408:119;9383:9;9500:6;9408:119;;9544:213;9662:2;9647:18;;9676:71;9651:9;9720:6;9676:71;;9764:205;9878:2;9863:18;;9892:67;9867:9;9932:6;9892:67;;9976:121;10063:12;;10034:63;10387:163;10490:19;;;10539:4;10530:14;;10483:67;10558:91;;10620:24;10638:5;10620:24;;10656:85;10722:13;10715:21;;10698:43;10748:144;10820:66;10809:78;;10792:100;10899:144;10971:66;10960:78;;10943:100;11050:72;11112:5;11095:27;11207:121;11280:42;11269:54;;11252:76;11414:81;11485:4;11474:16;;11457:38;11502:179;;11610:66;11670:5;11610:66;;11833:268;11898:1;11905:101;11919:6;11916:1;11913:13;11905:101;;;11986:11;;;11980:18;11967:11;;;11960:39;11941:2;11934:10;11905:101;;;12021:6;12018:1;12015:13;12012:2;;;-1:-1;;12086:1;12068:16;;12061:27;11882:219;12350:97;12438:2;12418:14;12434:7;12414:28;;12398:49;12455:117;12524:24;12542:5;12524:24;;;12517:5;12514:35;12504:2;;12563:1;12560;12553:12;12579:115;12647:23;12664:5;12647:23;;12825:113;12892:22;12908:5;12892:22;",
|
|
363
363
|
"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 \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/ownership/Ownable.sol\";\n\nimport \"../../protocol/interfaces/IPriceOracle.sol\";\nimport \"../../protocol/lib/Monetary.sol\";\nimport \"../../protocol/lib/Require.sol\";\n\nimport \"../interfaces/IChainlinkAggregator.sol\";\n\n\n/**\n * @title ChainlinkPriceOracleV1\n * @author Dolomite\n *\n * An implementation of the dYdX IPriceOracle interface that makes Chainlink prices compatible with the protocol.\n */\ncontract ChainlinkPriceOracleV1 is IPriceOracle, Ownable {\n using SafeMath for uint;\n\n bytes32 private constant FILE = \"ChainlinkPriceOracleV1\";\n\n event TokenInsertedOrUpdated(\n address indexed token,\n address indexed aggregator,\n address indexed tokenPair\n );\n\n mapping(address => IChainlinkAggregator) public tokenToAggregatorMap;\n mapping(address => uint8) public tokenToDecimalsMap;\n\n // Defaults to USD if the value is the ZERO address\n mapping(address => address) public tokenToPairingMap;\n // Should defaults to CHAINLINK_USD_DECIMALS when value is empty\n mapping(address => uint8) public tokenToAggregatorDecimalsMap;\n\n uint8 public CHAINLINK_USD_DECIMALS = 8;\n uint8 public CHAINLINK_ETH_DECIMALS = 18;\n\n /**\n * Note, these arrays are set up, such that each index corresponds with one-another.\n *\n * @param tokens The tokens that are supported by this adapter.\n * @param chainlinkAggregators The Chainlink aggregators that have on-chain prices.\n * @param tokenDecimals The number of decimals that each token has.\n * @param tokenPairs The token against which this token's value is compared using the aggregator. The\n * zero address means USD.\n * @param aggregatorDecimals The number of decimals that the value has that comes back from the corresponding\n * Chainlink Aggregator.\n */\n constructor(\n address[] memory tokens,\n address[] memory chainlinkAggregators,\n uint8[] memory tokenDecimals,\n address[] memory tokenPairs,\n uint8[] memory aggregatorDecimals\n ) public {\n // can't use Require.that because it causes the compiler to hang for some reason\n require(\n tokens.length == chainlinkAggregators.length,\n \"ChainlinkPriceOracleV1: invalid aggregators length\"\n );\n require(\n chainlinkAggregators.length == tokenDecimals.length,\n \"ChainlinkPriceOracleV1: invalid token decimals length\"\n );\n require(\n tokenDecimals.length == tokenPairs.length,\n \"ChainlinkPriceOracleV1: invalid token pairs length\"\n );\n require(\n tokenPairs.length == aggregatorDecimals.length,\n \"ChainlinkPriceOracleV1: invalid aggregator decimals length\"\n );\n\n for (uint i = 0; i < tokens.length; i++) {\n _insertOrUpdateOracleToken(\n tokens[i],\n tokenDecimals[i],\n chainlinkAggregators[i],\n aggregatorDecimals[i],\n tokenPairs[i]\n );\n }\n }\n\n // ============ Admin Functions ============\n\n function insertOrUpdateOracleToken(\n address token,\n uint8 tokenDecimals,\n address chainlinkAggregator,\n uint8 aggregatorDecimals,\n address tokenPair\n ) public onlyOwner {\n _insertOrUpdateOracleToken(\n token,\n tokenDecimals,\n chainlinkAggregator,\n aggregatorDecimals,\n tokenPair\n );\n }\n\n // ============ Public Functions ============\n\n function getPrice(\n address token\n )\n public\n view\n returns (Monetary.Price memory) {\n Require.that(\n address(tokenToAggregatorMap[token]) != address(0),\n FILE,\n \"invalid token\",\n token\n );\n\n uint rawChainlinkPrice = uint(tokenToAggregatorMap[token].latestAnswer());\n address tokenPair = tokenToPairingMap[token];\n\n // standardize the Chainlink price to be the proper number of decimals of (36 - tokenDecimals)\n uint standardizedPrice = standardizeNumberOfDecimals(\n tokenToDecimalsMap[token],\n rawChainlinkPrice,\n tokenPair == address(0) ? CHAINLINK_USD_DECIMALS : tokenToAggregatorDecimalsMap[token]\n );\n\n if (tokenPair == address(0)) {\n // The pair has a USD base, we are done.\n return Monetary.Price({value : standardizedPrice});\n } else {\n // The price we just got and converted is NOT against USD. So we need to get its pair's price against USD.\n // We can do so by recursively calling #getPrice using the `tokenPair` as the parameter instead of `token`.\n uint tokenPairStandardizedPrice = getPrice(tokenPair).value;\n // Standardize the price to use 36 decimals.\n uint tokenPairWith36Decimals = tokenPairStandardizedPrice.mul(10 ** uint(tokenToDecimalsMap[tokenPair]));\n // Now that the chained price uses 36 decimals (and thus is standardized), we can do easy math.\n return Monetary.Price({value : standardizedPrice.mul(tokenPairWith36Decimals).div(ONE_DOLLAR)});\n }\n }\n\n /**\n * Standardizes `value` to have `ONE_DOLLAR` - `tokenDecimals` number of decimals.\n */\n function standardizeNumberOfDecimals(\n uint8 tokenDecimals,\n uint value,\n uint8 valueDecimals\n ) public pure returns (uint) {\n uint tokenDecimalsFactor = 10 ** uint(tokenDecimals);\n uint priceFactor = IPriceOracle.ONE_DOLLAR.div(tokenDecimalsFactor);\n uint valueFactor = 10 ** uint(valueDecimals);\n return value.mul(priceFactor).div(valueFactor);\n }\n\n // ============ Internal Functions ============\n\n function _insertOrUpdateOracleToken(\n address token,\n uint8 tokenDecimals,\n address chainlinkAggregator,\n uint8 aggregatorDecimals,\n address tokenPair\n ) internal {\n tokenToAggregatorMap[token] = IChainlinkAggregator(chainlinkAggregator);\n tokenToDecimalsMap[token] = tokenDecimals;\n if (tokenPair != address(0)) {\n // The aggregator's price is NOT against USD. Therefore, we need to store what it's against as well as the\n // # of decimals the aggregator's price has.\n tokenToPairingMap[token] = tokenPair;\n tokenToAggregatorDecimalsMap[token] = aggregatorDecimals;\n }\n emit TokenInsertedOrUpdated(token, chainlinkAggregator, tokenPair);\n }\n}\n",
|
|
364
|
-
"sourcePath": "/
|
|
364
|
+
"sourcePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/oracles/ChainlinkPriceOracleV1.sol",
|
|
365
365
|
"ast": {
|
|
366
|
-
"absolutePath": "/
|
|
366
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/oracles/ChainlinkPriceOracleV1.sol",
|
|
367
367
|
"exportedSymbols": {
|
|
368
368
|
"ChainlinkPriceOracleV1": [
|
|
369
369
|
8147
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
"unitAlias": ""
|
|
416
416
|
},
|
|
417
417
|
{
|
|
418
|
-
"absolutePath": "/
|
|
418
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/interfaces/IPriceOracle.sol",
|
|
419
419
|
"file": "../../protocol/interfaces/IPriceOracle.sol",
|
|
420
420
|
"id": 7792,
|
|
421
421
|
"nodeType": "ImportDirective",
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
"unitAlias": ""
|
|
427
427
|
},
|
|
428
428
|
{
|
|
429
|
-
"absolutePath": "/
|
|
429
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Monetary.sol",
|
|
430
430
|
"file": "../../protocol/lib/Monetary.sol",
|
|
431
431
|
"id": 7793,
|
|
432
432
|
"nodeType": "ImportDirective",
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
"unitAlias": ""
|
|
438
438
|
},
|
|
439
439
|
{
|
|
440
|
-
"absolutePath": "/
|
|
440
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol",
|
|
441
441
|
"file": "../../protocol/lib/Require.sol",
|
|
442
442
|
"id": 7794,
|
|
443
443
|
"nodeType": "ImportDirective",
|
|
@@ -448,7 +448,7 @@
|
|
|
448
448
|
"unitAlias": ""
|
|
449
449
|
},
|
|
450
450
|
{
|
|
451
|
-
"absolutePath": "/
|
|
451
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/interfaces/IChainlinkAggregator.sol",
|
|
452
452
|
"file": "../interfaces/IChainlinkAggregator.sol",
|
|
453
453
|
"id": 7795,
|
|
454
454
|
"nodeType": "ImportDirective",
|
|
@@ -5319,7 +5319,7 @@
|
|
|
5319
5319
|
"src": "595:6740:25"
|
|
5320
5320
|
},
|
|
5321
5321
|
"legacyAST": {
|
|
5322
|
-
"absolutePath": "/
|
|
5322
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/oracles/ChainlinkPriceOracleV1.sol",
|
|
5323
5323
|
"exportedSymbols": {
|
|
5324
5324
|
"ChainlinkPriceOracleV1": [
|
|
5325
5325
|
8147
|
|
@@ -5371,7 +5371,7 @@
|
|
|
5371
5371
|
"unitAlias": ""
|
|
5372
5372
|
},
|
|
5373
5373
|
{
|
|
5374
|
-
"absolutePath": "/
|
|
5374
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/interfaces/IPriceOracle.sol",
|
|
5375
5375
|
"file": "../../protocol/interfaces/IPriceOracle.sol",
|
|
5376
5376
|
"id": 7792,
|
|
5377
5377
|
"nodeType": "ImportDirective",
|
|
@@ -5382,7 +5382,7 @@
|
|
|
5382
5382
|
"unitAlias": ""
|
|
5383
5383
|
},
|
|
5384
5384
|
{
|
|
5385
|
-
"absolutePath": "/
|
|
5385
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Monetary.sol",
|
|
5386
5386
|
"file": "../../protocol/lib/Monetary.sol",
|
|
5387
5387
|
"id": 7793,
|
|
5388
5388
|
"nodeType": "ImportDirective",
|
|
@@ -5393,7 +5393,7 @@
|
|
|
5393
5393
|
"unitAlias": ""
|
|
5394
5394
|
},
|
|
5395
5395
|
{
|
|
5396
|
-
"absolutePath": "/
|
|
5396
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol",
|
|
5397
5397
|
"file": "../../protocol/lib/Require.sol",
|
|
5398
5398
|
"id": 7794,
|
|
5399
5399
|
"nodeType": "ImportDirective",
|
|
@@ -5404,7 +5404,7 @@
|
|
|
5404
5404
|
"unitAlias": ""
|
|
5405
5405
|
},
|
|
5406
5406
|
{
|
|
5407
|
-
"absolutePath": "/
|
|
5407
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/interfaces/IChainlinkAggregator.sol",
|
|
5408
5408
|
"file": "../interfaces/IChainlinkAggregator.sol",
|
|
5409
5409
|
"id": 7795,
|
|
5410
5410
|
"nodeType": "ImportDirective",
|
|
@@ -10328,11 +10328,11 @@
|
|
|
10328
10328
|
},
|
|
10329
10329
|
"links": {},
|
|
10330
10330
|
"address": "0x1b88Bdb8269A1aB1372459F5a4eC3663D6f5cCc4",
|
|
10331
|
-
"transactionHash": "
|
|
10331
|
+
"transactionHash": "0xab7e2614bd707054df7d7005f9cf7e4dd1a5ed3ee50dea542700a6f1b7fbf60e"
|
|
10332
10332
|
}
|
|
10333
10333
|
},
|
|
10334
10334
|
"schemaVersion": "3.0.23",
|
|
10335
|
-
"updatedAt": "2022-02-
|
|
10335
|
+
"updatedAt": "2022-02-07T07:18:44.889Z",
|
|
10336
10336
|
"devdoc": {
|
|
10337
10337
|
"author": "Dolomite * An implementation of the dYdX IPriceOracle interface that makes Chainlink prices compatible with the protocol.",
|
|
10338
10338
|
"methods": {
|