@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": "LiquidatorProxyHelper",
|
|
3
3
|
"abi": [],
|
|
4
|
-
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Dolomite * Inheritable contract that allows sharing code across different liquidator proxy contracts\",\"methods\":{},\"title\":\"LiquidatorProxyHelper\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/
|
|
5
|
-
"bytecode": "
|
|
6
|
-
"deployedBytecode": "
|
|
4
|
+
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Dolomite * Inheritable contract that allows sharing code across different liquidator proxy contracts\",\"methods\":{},\"title\":\"LiquidatorProxyHelper\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/helpers/LiquidatorProxyHelper.sol\":\"LiquidatorProxyHelper\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/helpers/LiquidatorProxyHelper.sol\":{\"keccak256\":\"0x87d4f290fa884c943dafbbc3457449f5d6de153e1ff5891762ae4313949fc371\",\"urls\":[\"bzz-raw://a996eaaf35b7ba5e4d5ff543e1af89fdb5a0e095fe593f3cfff6232c48fabb15\",\"dweb:/ipfs/QmZaZoJWVYFMtVd5rjXP7wXYJxPjfDGftMbriG2Nzwdfoy\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/interfaces/IDolomiteMargin.sol\":{\"keccak256\":\"0x1e73364879c267fdd2bfd871e62ee58ee3d65fbef3b71e3cc104fbff499eca6c\",\"urls\":[\"bzz-raw://e3b1327980a5949afd52cff4713f47ee4fdee9a8b376ceaa3402f5c9696b8c1b\",\"dweb:/ipfs/QmbhQzVEdaraPJizT5DTtk6CDzH3guHNipHW5T23uTtFkX\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/interfaces/IERC20Detailed.sol\":{\"keccak256\":\"0x22a62e2a8155e70300773721902f4b9118e17aa0bb5d9d1b046050a014cfb223\",\"urls\":[\"bzz-raw://03af737a33c552fbe58f6f1fbd5496854fdc28dd57be4365d56663725c083a18\",\"dweb:/ipfs/QmbgLqGAQEd6tXsZB8QaPNCAMiU6nNzP75wNbKdS65BuUF\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/interfaces/IInterestSetter.sol\":{\"keccak256\":\"0x546825f65490a30e29d0f6446acec49c1e895ce6b33d48ca5c05092725a63a57\",\"urls\":[\"bzz-raw://6ad3013aed985bdf6e6234ae0f7f37e6bba76c3470c33bfa24678cf19b3b412c\",\"dweb:/ipfs/QmfYaSBzxGpgiHoR7ontMJY66S5L26XwkLYoEuzsEjpbQH\"]},\"/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/Account.sol\":{\"keccak256\":\"0x0ab9a3fabc89984dff748af63d4319ee134051de2d7fc560e34ebaac86198396\",\"urls\":[\"bzz-raw://ab67f499a8ef83dc7e7cf7176a0f66eced40fa228eda8dd2d47e066ab985cf42\",\"dweb:/ipfs/QmXRHbsEYxr2Qsfsj5psXGV5LaPZHuzLiEXzSQJ77WSE27\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Actions.sol\":{\"keccak256\":\"0x44ec62b766a88a2f65267991e76cab88711e733b826dc9e578cb6ad6b38b2445\",\"urls\":[\"bzz-raw://731a8d44e57c9dcd7fbdefc37a6b5889c0d06defb3bd66b921b2a7db0edf0103\",\"dweb:/ipfs/QmcVbXc9oi5DMxjPtsBF76oJzD6zVjm7RuXgJfP3Goqrrb\"]},\"/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/Decimal.sol\":{\"keccak256\":\"0x66990bbe3c58d0edf57d3f67ab5280e2a53958ce44f75c335c4c50542321bccb\",\"urls\":[\"bzz-raw://724cfdb5c99121aab5262679e46766a2883e344749870d7dbfa92d1617f68bf2\",\"dweb:/ipfs/QmYjAsS45f6UG2u3zuTks2HVfMYtyFCVMgUvD7Gt7XtU3R\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/EnumerableSet.sol\":{\"keccak256\":\"0x9710b0ab43cc2d964d8722a0aabbedbf7e9d4756dcc0b4ab7c46c1ee68653042\",\"urls\":[\"bzz-raw://2405593d37f0f224bfca556f01634a9755bb0ed626f74dd15293106a8b4dd7d3\",\"dweb:/ipfs/QmTZ16S336jsoDnK5p3vAZRzimBkmdEJibncHVBJxBt469\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Interest.sol\":{\"keccak256\":\"0x73e75454568c5dfc3bdcf7dbf2ddce6ab8d3d317618bc1f1957f7667e15d3799\",\"urls\":[\"bzz-raw://7b1c8a9a79c8ffdbb0fa633f713ae3dfeac93b31d2b1639614ac32d473fb8250\",\"dweb:/ipfs/QmfARP93W2mgeVwD9Lkd3yVmbCLF2Mos7o8HJ1x6WYQmxZ\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Math.sol\":{\"keccak256\":\"0x0c0c913b6ccdb69063f9ec84879fcad20a1ee6f44402c9f5ec2b4f5b9f2fa16b\",\"urls\":[\"bzz-raw://89b32eefb57e5e63ad8c6e079ae7bf2d2c8622776cd45af0cf304e1cafd6e078\",\"dweb:/ipfs/Qmcj7yRnYuTgKC3ZqZqe8rynHGYVDS3UrFExcVGcqeaDHY\"]},\"/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\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Storage.sol\":{\"keccak256\":\"0xf930fbde3ab43ec8f079dbad062453b502542f53b7eec670c8e86c7a2e47dd9a\",\"urls\":[\"bzz-raw://e1c402fc55471e8372be478e99f91c28373f096e31f0ef1d5072dfdb81541c29\",\"dweb:/ipfs/QmTc8WSfFCbxNQqNpq1vptUVFxteKQ8HWEhyXREyPZ2neu\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Time.sol\":{\"keccak256\":\"0x233d6ebf965711bf980f4bb2e672fb1a11b4b879fd41c884b3c2b704417d0d0c\",\"urls\":[\"bzz-raw://6478ff81706d531f9438b96274a7b904abbbd9c631540c68c6a89c3accf27abf\",\"dweb:/ipfs/QmWe9vkz3qwVjrcbmcTL8wgkjLPsrEqxcqPJL9ujM8PPbp\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Token.sol\":{\"keccak256\":\"0xd7bcae9e3c570544fc946a00cc7695106a64c20bc130d0183612c0410a531d19\",\"urls\":[\"bzz-raw://0ff5ffd6abb9ed223a64128c131afd962bec07fb9867cb62593906b339c76920\",\"dweb:/ipfs/QmbTrJL4bekvBqqaw6wXnBhYzS9uAqULSWF2VzW4cdfsM5\"]},\"/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Types.sol\":{\"keccak256\":\"0xab134538648a2e223a7fe61db03c14f687657a5d37147f93c9088f11735aa311\",\"urls\":[\"bzz-raw://79dc7d2b30576d2349b99267642ac8d5fb7939c920b8d8045379d3614238bdc3\",\"dweb:/ipfs/QmaQJYg1nirHoWSC6G38Cjsk9pZBzEaNrGXKqTsvAzbyES\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzz-raw://59fd025151435da35faa8093a5c7a17de02de9d08ad27275c5cdf05050820d91\",\"dweb:/ipfs/QmQMvwEcPhoRXzbXyrdoeRtvLoifUW9Qh7Luho7bmUPRkc\"]}},\"version\":1}",
|
|
5
|
+
"bytecode": "0x6080604052348015600f57600080fd5b50604c80601d6000396000f3fe6080604052600080fdfea365627a7a7231582007b3a789d994c9205e4493cebd93810e99e57ac72deb2a6f9900c605332be39e6c6578706572696d656e74616cf564736f6c63430005100040",
|
|
6
|
+
"deployedBytecode": "0x6080604052600080fdfea365627a7a7231582007b3a789d994c9205e4493cebd93810e99e57ac72deb2a6f9900c605332be39e6c6578706572696d656e74616cf564736f6c63430005100040",
|
|
7
7
|
"sourceMap": "1373:6702:5:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1373:6702:5;;;;;;;",
|
|
8
8
|
"deployedSourceMap": "1373:6702:5:-;;;;;",
|
|
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 { SafeMath } from \"@openzeppelin/contracts/math/SafeMath.sol\";\n\nimport { IDolomiteMargin } from \"../../protocol/interfaces/IDolomiteMargin.sol\";\n\nimport { Account } from \"../../protocol/lib/Account.sol\";\nimport { Bits } from \"../../protocol/lib/Bits.sol\";\nimport { Decimal } from \"../../protocol/lib/Decimal.sol\";\nimport { Interest } from \"../../protocol/lib/Interest.sol\";\nimport { Monetary } from \"../../protocol/lib/Monetary.sol\";\nimport { Require } from \"../../protocol/lib/Require.sol\";\nimport { Types } from \"../../protocol/lib/Types.sol\";\n\n\n/**\n * @title LiquidatorProxyHelper\n * @author Dolomite\n *\n * Inheritable contract that allows sharing code across different liquidator proxy contracts\n */\ncontract LiquidatorProxyHelper {\n using SafeMath for uint;\n using Types for Types.Par;\n\n // ============ Constants ============\n\n bytes32 private constant FILE = \"LiquidatorProxyHelper\";\n uint256 private constant MAX_UINT_BITS = 256;\n uint256 private constant ONE = 1;\n\n // ============ Structs ============\n\n struct MarketInfo {\n uint256 marketId;\n Decimal.D256 spreadPremium;\n Monetary.Price price;\n Interest.Index index;\n }\n\n /**\n * Gets the current total supplyValue and borrowValue for some account. Takes into account what\n * the current index will be once updated.\n */\n function getAccountValues(\n IDolomiteMargin dolomiteMargin,\n MarketInfo[] memory marketInfos,\n Account.Info memory account,\n uint256[] memory marketIds\n )\n internal\n view\n returns (\n Monetary.Value memory,\n Monetary.Value memory\n )\n {\n return getAccountValues(\n dolomiteMargin,\n marketInfos,\n account,\n marketIds,\n /* adjustForSpreadPremiums = */ false // solium-disable-line indentation\n );\n }\n\n /**\n * Gets the adjusted current total supplyValue and borrowValue for some account. Takes into account what\n * the current index will be once updated and the spread premium.\n */\n function getAdjustedAccountValues(\n IDolomiteMargin dolomiteMargin,\n MarketInfo[] memory marketInfos,\n Account.Info memory account,\n uint256[] memory marketIds\n )\n internal\n view\n returns (\n Monetary.Value memory,\n Monetary.Value memory\n )\n {\n return getAccountValues(\n dolomiteMargin,\n marketInfos,\n account,\n marketIds,\n /* adjustForSpreadPremiums = */ true // solium-disable-line indentation\n );\n }\n\n // ============ Internal Functions ============\n\n function getMarketInfos(\n IDolomiteMargin dolomiteMargin,\n uint256[] memory solidMarkets,\n uint256[] memory liquidMarkets\n ) internal view returns (MarketInfo[] memory) {\n uint[] memory marketBitmaps = Bits.createBitmaps(dolomiteMargin.getNumMarkets());\n uint marketsLength = 0;\n marketsLength = _addMarketsToBitmap(solidMarkets, marketBitmaps, marketsLength);\n marketsLength = _addMarketsToBitmap(liquidMarkets, marketBitmaps, marketsLength);\n// Require.that(false, FILE, \"<marketsLength, bitmap>\", marketsLength, marketBitmaps[0]);\n\n uint counter = 0;\n MarketInfo[] memory marketInfos = new MarketInfo[](marketsLength);\n for (uint i = 0; i < marketBitmaps.length; i++) {\n uint bitmap = marketBitmaps[i];\n while (bitmap != 0) {\n uint nextSetBit = Bits.getLeastSignificantBit(bitmap);\n uint marketId = Bits.getMarketIdFromBit(i, nextSetBit);\n\n marketInfos[counter++] = MarketInfo({\n marketId: marketId,\n spreadPremium: dolomiteMargin.getMarketSpreadPremium(marketId),\n price: dolomiteMargin.getMarketPrice(marketId),\n index: dolomiteMargin.getMarketCurrentIndex(marketId)\n });\n\n // unset the set bit\n bitmap = Bits.unsetBit(bitmap, nextSetBit);\n }\n if (counter == marketsLength) {\n break;\n }\n }\n\n return marketInfos;\n }\n\n function binarySearch(\n MarketInfo[] memory markets,\n uint marketId\n ) internal pure returns (MarketInfo memory) {\n return _binarySearch(\n markets,\n 0,\n markets.length,\n marketId\n );\n }\n\n // Private Functions\n\n function getAccountValues(\n IDolomiteMargin dolomiteMargin,\n MarketInfo[] memory marketInfos,\n Account.Info memory account,\n uint256[] memory marketIds,\n bool adjustForSpreadPremiums\n )\n private\n view\n returns (\n Monetary.Value memory,\n Monetary.Value memory\n )\n {\n Monetary.Value memory supplyValue;\n Monetary.Value memory borrowValue;\n\n for (uint256 i = 0; i < marketIds.length; i++) {\n Types.Par memory par = dolomiteMargin.getAccountPar(account, marketIds[i]);\n if (par.isZero()) {\n // This if statement should never fire\n continue;\n }\n MarketInfo memory marketInfo = binarySearch(marketInfos, marketIds[i]);\n Types.Wei memory userWei = Interest.parToWei(par, marketInfo.index);\n uint256 assetValue = userWei.value.mul(marketInfo.price.value);\n Decimal.D256 memory spreadPremium = Decimal.one();\n if (adjustForSpreadPremiums) {\n spreadPremium = Decimal.onePlus(marketInfo.spreadPremium);\n }\n if (userWei.sign) {\n supplyValue.value = supplyValue.value.add(Decimal.div(assetValue, spreadPremium));\n } else {\n borrowValue.value = borrowValue.value.add(Decimal.mul(assetValue, spreadPremium));\n }\n }\n\n return (supplyValue, borrowValue);\n }\n\n // solium-disable-next-line security/no-assign-params\n function _addMarketsToBitmap(\n uint256[] memory markets,\n uint256[] memory bitmaps,\n uint marketsLength\n ) private pure returns (uint) {\n for (uint i = 0; i < markets.length; i++) {\n if (!Bits.hasBit(bitmaps, markets[i])) {\n Bits.setBit(bitmaps, markets[i]);\n marketsLength += 1;\n }\n }\n return marketsLength;\n }\n\n function _binarySearch(\n MarketInfo[] memory markets,\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 && markets[beginInclusive].marketId != marketId)) {\n revert(\"LiquidatorProxyHelper: item not found\");\n }\n\n uint mid = beginInclusive + len / 2;\n uint midMarketId = markets[mid].marketId;\n if (marketId < midMarketId) {\n return _binarySearch(\n markets,\n beginInclusive,\n mid,\n marketId\n );\n } else if (marketId > midMarketId) {\n return _binarySearch(\n markets,\n mid + 1,\n endExclusive,\n marketId\n );\n } else {\n return markets[mid];\n }\n }\n\n}\n",
|
|
10
|
-
"sourcePath": "/
|
|
10
|
+
"sourcePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/helpers/LiquidatorProxyHelper.sol",
|
|
11
11
|
"ast": {
|
|
12
|
-
"absolutePath": "/
|
|
12
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/helpers/LiquidatorProxyHelper.sol",
|
|
13
13
|
"exportedSymbols": {
|
|
14
14
|
"LiquidatorProxyHelper": [
|
|
15
15
|
3285
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"unitAlias": ""
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
"absolutePath": "/
|
|
58
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/interfaces/IDolomiteMargin.sol",
|
|
59
59
|
"file": "../../protocol/interfaces/IDolomiteMargin.sol",
|
|
60
60
|
"id": 2752,
|
|
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/Account.sol",
|
|
75
75
|
"file": "../../protocol/lib/Account.sol",
|
|
76
76
|
"id": 2754,
|
|
77
77
|
"nodeType": "ImportDirective",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"unitAlias": ""
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
|
-
"absolutePath": "/
|
|
90
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol",
|
|
91
91
|
"file": "../../protocol/lib/Bits.sol",
|
|
92
92
|
"id": 2756,
|
|
93
93
|
"nodeType": "ImportDirective",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"unitAlias": ""
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
|
-
"absolutePath": "/
|
|
106
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Decimal.sol",
|
|
107
107
|
"file": "../../protocol/lib/Decimal.sol",
|
|
108
108
|
"id": 2758,
|
|
109
109
|
"nodeType": "ImportDirective",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"unitAlias": ""
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
|
-
"absolutePath": "/
|
|
122
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Interest.sol",
|
|
123
123
|
"file": "../../protocol/lib/Interest.sol",
|
|
124
124
|
"id": 2760,
|
|
125
125
|
"nodeType": "ImportDirective",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"unitAlias": ""
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
|
-
"absolutePath": "/
|
|
138
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Monetary.sol",
|
|
139
139
|
"file": "../../protocol/lib/Monetary.sol",
|
|
140
140
|
"id": 2762,
|
|
141
141
|
"nodeType": "ImportDirective",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"unitAlias": ""
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
|
-
"absolutePath": "/
|
|
154
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol",
|
|
155
155
|
"file": "../../protocol/lib/Require.sol",
|
|
156
156
|
"id": 2764,
|
|
157
157
|
"nodeType": "ImportDirective",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"unitAlias": ""
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
|
-
"absolutePath": "/
|
|
170
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Types.sol",
|
|
171
171
|
"file": "../../protocol/lib/Types.sol",
|
|
172
172
|
"id": 2766,
|
|
173
173
|
"nodeType": "ImportDirective",
|
|
@@ -6974,7 +6974,7 @@
|
|
|
6974
6974
|
"src": "603:7473:5"
|
|
6975
6975
|
},
|
|
6976
6976
|
"legacyAST": {
|
|
6977
|
-
"absolutePath": "/
|
|
6977
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/external/helpers/LiquidatorProxyHelper.sol",
|
|
6978
6978
|
"exportedSymbols": {
|
|
6979
6979
|
"LiquidatorProxyHelper": [
|
|
6980
6980
|
3285
|
|
@@ -7020,7 +7020,7 @@
|
|
|
7020
7020
|
"unitAlias": ""
|
|
7021
7021
|
},
|
|
7022
7022
|
{
|
|
7023
|
-
"absolutePath": "/
|
|
7023
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/interfaces/IDolomiteMargin.sol",
|
|
7024
7024
|
"file": "../../protocol/interfaces/IDolomiteMargin.sol",
|
|
7025
7025
|
"id": 2752,
|
|
7026
7026
|
"nodeType": "ImportDirective",
|
|
@@ -7036,7 +7036,7 @@
|
|
|
7036
7036
|
"unitAlias": ""
|
|
7037
7037
|
},
|
|
7038
7038
|
{
|
|
7039
|
-
"absolutePath": "/
|
|
7039
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Account.sol",
|
|
7040
7040
|
"file": "../../protocol/lib/Account.sol",
|
|
7041
7041
|
"id": 2754,
|
|
7042
7042
|
"nodeType": "ImportDirective",
|
|
@@ -7052,7 +7052,7 @@
|
|
|
7052
7052
|
"unitAlias": ""
|
|
7053
7053
|
},
|
|
7054
7054
|
{
|
|
7055
|
-
"absolutePath": "/
|
|
7055
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Bits.sol",
|
|
7056
7056
|
"file": "../../protocol/lib/Bits.sol",
|
|
7057
7057
|
"id": 2756,
|
|
7058
7058
|
"nodeType": "ImportDirective",
|
|
@@ -7068,7 +7068,7 @@
|
|
|
7068
7068
|
"unitAlias": ""
|
|
7069
7069
|
},
|
|
7070
7070
|
{
|
|
7071
|
-
"absolutePath": "/
|
|
7071
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Decimal.sol",
|
|
7072
7072
|
"file": "../../protocol/lib/Decimal.sol",
|
|
7073
7073
|
"id": 2758,
|
|
7074
7074
|
"nodeType": "ImportDirective",
|
|
@@ -7084,7 +7084,7 @@
|
|
|
7084
7084
|
"unitAlias": ""
|
|
7085
7085
|
},
|
|
7086
7086
|
{
|
|
7087
|
-
"absolutePath": "/
|
|
7087
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Interest.sol",
|
|
7088
7088
|
"file": "../../protocol/lib/Interest.sol",
|
|
7089
7089
|
"id": 2760,
|
|
7090
7090
|
"nodeType": "ImportDirective",
|
|
@@ -7100,7 +7100,7 @@
|
|
|
7100
7100
|
"unitAlias": ""
|
|
7101
7101
|
},
|
|
7102
7102
|
{
|
|
7103
|
-
"absolutePath": "/
|
|
7103
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Monetary.sol",
|
|
7104
7104
|
"file": "../../protocol/lib/Monetary.sol",
|
|
7105
7105
|
"id": 2762,
|
|
7106
7106
|
"nodeType": "ImportDirective",
|
|
@@ -7116,7 +7116,7 @@
|
|
|
7116
7116
|
"unitAlias": ""
|
|
7117
7117
|
},
|
|
7118
7118
|
{
|
|
7119
|
-
"absolutePath": "/
|
|
7119
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Require.sol",
|
|
7120
7120
|
"file": "../../protocol/lib/Require.sol",
|
|
7121
7121
|
"id": 2764,
|
|
7122
7122
|
"nodeType": "ImportDirective",
|
|
@@ -7132,7 +7132,7 @@
|
|
|
7132
7132
|
"unitAlias": ""
|
|
7133
7133
|
},
|
|
7134
7134
|
{
|
|
7135
|
-
"absolutePath": "/
|
|
7135
|
+
"absolutePath": "/Users/corey/Leavitt-Innovations/dolomite-v2-protocol/contracts/protocol/lib/Types.sol",
|
|
7136
7136
|
"file": "../../protocol/lib/Types.sol",
|
|
7137
7137
|
"id": 2766,
|
|
7138
7138
|
"nodeType": "ImportDirective",
|
|
@@ -13944,7 +13944,7 @@
|
|
|
13944
13944
|
},
|
|
13945
13945
|
"networks": {},
|
|
13946
13946
|
"schemaVersion": "3.0.23",
|
|
13947
|
-
"updatedAt": "2022-02-
|
|
13947
|
+
"updatedAt": "2022-02-07T07:18:44.807Z",
|
|
13948
13948
|
"devdoc": {
|
|
13949
13949
|
"author": "Dolomite * Inheritable contract that allows sharing code across different liquidator proxy contracts",
|
|
13950
13950
|
"methods": {},
|