@dolomite-exchange/dolomite-margin
Version:
Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol
1,096 lines • 74.3 kB
JSON
{
"contractName": "IIsolationModeUnwrapperTrader",
"abi": [
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_tradeOriginator",
"type": "address"
},
{
"internalType": "address",
"name": "_receiver",
"type": "address"
},
{
"internalType": "address",
"name": "_makerToken",
"type": "address"
},
{
"internalType": "address",
"name": "_takerToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_requestedFillAmount",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_orderData",
"type": "bytes"
}
],
"name": "exchange",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "_makerToken",
"type": "address"
},
{
"internalType": "address",
"name": "_takerToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_desiredMakerToken",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_orderData",
"type": "bytes"
}
],
"name": "getExchangeCost",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "token",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "_outputToken",
"type": "address"
}
],
"name": "isValidOutputToken",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "actionsLength",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"components": [
{
"internalType": "uint256",
"name": "primaryAccountId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "otherAccountId",
"type": "uint256"
},
{
"internalType": "address",
"name": "primaryAccountOwner",
"type": "address"
},
{
"internalType": "uint256",
"name": "primaryAccountNumber",
"type": "uint256"
},
{
"internalType": "address",
"name": "otherAccountOwner",
"type": "address"
},
{
"internalType": "uint256",
"name": "otherAccountNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "outputMarket",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "inputMarket",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minOutputAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "inputAmount",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "orderData",
"type": "bytes"
}
],
"internalType": "struct IIsolationModeUnwrapperTrader.CreateActionsForUnwrappingParams",
"name": "_params",
"type": "tuple"
}
],
"name": "createActionsForUnwrapping",
"outputs": [
{
"components": [
{
"internalType": "enum Actions.ActionType",
"name": "actionType",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "accountId",
"type": "uint256"
},
{
"components": [
{
"internalType": "bool",
"name": "sign",
"type": "bool"
},
{
"internalType": "enum Types.AssetDenomination",
"name": "denomination",
"type": "uint8"
},
{
"internalType": "enum Types.AssetReference",
"name": "ref",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"internalType": "struct Types.AssetAmount",
"name": "amount",
"type": "tuple"
},
{
"internalType": "uint256",
"name": "primaryMarketId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "secondaryMarketId",
"type": "uint256"
},
{
"internalType": "address",
"name": "otherAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "otherAccountId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"internalType": "struct Actions.ActionArgs[]",
"name": "",
"type": "tuple[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"actionsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"primaryAccountId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"otherAccountId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"primaryAccountOwner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"primaryAccountNumber\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"otherAccountOwner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"otherAccountNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputMarket\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputMarket\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minOutputAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"orderData\",\"type\":\"bytes\"}],\"internalType\":\"struct IIsolationModeUnwrapperTrader.CreateActionsForUnwrappingParams\",\"name\":\"_params\",\"type\":\"tuple\"}],\"name\":\"createActionsForUnwrapping\",\"outputs\":[{\"components\":[{\"internalType\":\"enum Actions.ActionType\",\"name\":\"actionType\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"accountId\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"sign\",\"type\":\"bool\"},{\"internalType\":\"enum Types.AssetDenomination\",\"name\":\"denomination\",\"type\":\"uint8\"},{\"internalType\":\"enum Types.AssetReference\",\"name\":\"ref\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"struct Types.AssetAmount\",\"name\":\"amount\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"primaryMarketId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"secondaryMarketId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"otherAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"otherAccountId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"struct Actions.ActionArgs[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tradeOriginator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_makerToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_takerToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_requestedFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_orderData\",\"type\":\"bytes\"}],\"name\":\"exchange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_makerToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_takerToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_desiredMakerToken\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_orderData\",\"type\":\"bytes\"}],\"name\":\"getExchangeCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_outputToken\",\"type\":\"address\"}],\"name\":\"isValidOutputToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Dolomite * Interface for a contract that can convert an isolation mode token into an underlying component token.\",\"methods\":{\"actionsLength()\":{\"return\":\"The number of actions used to unwrap the Isolation Mode token into a valid output token.\"},\"createActionsForUnwrapping((uint256,uint256,address,uint256,address,uint256,uint256,uint256,uint256,uint256,bytes))\":{\"params\":{\"_params\":\"The parameters for creating the actions for unwrapping.\"},\"return\":\"The actions that will be executed to unwrap the `_inputMarket` into `_outputMarket`.\"},\"exchange(address,address,address,address,uint256,bytes)\":{\"params\":{\"_makerToken\":\"The token to receive (target asset; IE path[path.length - 1])\",\"_orderData\":\"Arbitrary bytes data for any information to pass to the exchange\",\"_receiver\":\"Address to set allowance on once the trade has completed\",\"_requestedFillAmount\":\"Amount of takerToken being paid\",\"_takerToken\":\"The token to pay (originator asset; IE path[0])\",\"_tradeOriginator\":\"Address of the initiator of the trade (however, this value cannot always be trusted as it is set at the discretion of the msg.sender)\"},\"return\":\"The amount of makerToken received\"},\"getExchangeCost(address,address,uint256,bytes)\":{\"params\":{\"_desiredMakerToken\":\"Amount of `_makerToken` requested\",\"_makerToken\":\"The token to receive (target asset; IE path[path.length - 1])\",\"_orderData\":\"Arbitrary bytes data for any information to pass to the exchange\",\"_takerToken\":\"The token to pay (originator asset; IE path[0])\"},\"return\":\"Amount of `_takerToken` the needed to complete the exchange\"},\"isValidOutputToken(address)\":{\"return\":\"True if the `_outputToken` is a valid output token for this contract, to be unwrapped by `token()`.\"},\"token()\":{\"return\":\"The isolation mode token that this contract can unwrap\"}},\"title\":\"IIsolationModeUnwrapperTrader\"},\"userdoc\":{\"methods\":{\"createActionsForUnwrapping((uint256,uint256,address,uint256,address,uint256,uint256,uint256,uint256,uint256,bytes))\":{\"notice\":\"Creates the necessary actions for selling the `_inputMarket` into `_outputMarket`. Note, the `_inputMarket` should be equal to `token()` and `_outputMarket` should be validated to be a correct market that can be transformed into `token()`.\"},\"exchange(address,address,address,address,uint256,bytes)\":{\"notice\":\"Exchange some amount of takerToken for makerToken.\"},\"getExchangeCost(address,address,uint256,bytes)\":{\"notice\":\"Get amount of takerToken required to buy a certain amount of makerToken for a given trade. Should match the takerToken amount used in exchangeForAmount. If the order cannot provide exactly desiredMakerToken, then it must return the price to buy the minimum amount greater than desiredMakerToken\"}}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IIsolationModeUnwrapperTrader.sol\":\"IIsolationModeUnwrapperTrader\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IIsolationModeUnwrapperTrader.sol\":{\"keccak256\":\"0x6b46e389ec0dff927670d76a98902763b517bf81967f9e5b73c3ff6ced2a78c8\",\"urls\":[\"bzz-raw://17cd690e571d488432192852db474420c7e8d54db3169ab9b9c7d6963e9a708a\",\"dweb:/ipfs/Qmaam6B6WyYZmrtVWkJTKc6njrbZXHnERK2ngbwyK9WckM\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IExchangeWrapper.sol\":{\"keccak256\":\"0x74799c3fac16738be41e270a70d3f7ad4f75d1dc7e5d8c58f0fe4c6128345112\",\"urls\":[\"bzz-raw://d9602af1001189d199736d17266d5fb34a32f71cd05fbcf4c0f97c0b3a642eee\",\"dweb:/ipfs/QmPto2DkZ1nKqicBMdMkaek7kGSSXqSKnf697h5zuthvsy\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Account.sol\":{\"keccak256\":\"0x2059276ea5e478bd5ac7f2712e7b1b6c85d291c647a54b264909044844828e67\",\"urls\":[\"bzz-raw://f153777051d12131b13a57e5c3af10a2670927cfc7d22c9519ab20c9b4b9bc89\",\"dweb:/ipfs/QmQMP3qS5xDAVGYKDfNkbkSqBKozQGQsGqX4e8VyjRtxPS\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Actions.sol\":{\"keccak256\":\"0x7b2fcf441c034952dd042b6c8b20b148359db771e7c9ac07d06369560a9f0301\",\"urls\":[\"bzz-raw://84665ee4a780360fe6160d197ba98f0bf0ab0d7c6ad87bfed6226bf2f88d8d30\",\"dweb:/ipfs/QmRDfRdAd8hSXeu4SAeeYKkKoXBhStu7n4uReYBce2JD5Z\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/DolomiteMarginMath.sol\":{\"keccak256\":\"0x53f205f6a779d579be29faa9412c806a892b3e605fff092dfd9d14d936fa019f\",\"urls\":[\"bzz-raw://0ff936f89602a63b8e6a4eb4ce8f87673c0f45b7ce29694920905a3f0b5a6a69\",\"dweb:/ipfs/QmbYME9BeEvPC1ndV8EaUDX5fDMghLc3rocNUxFtgHmg8m\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/EnumerableSet.sol\":{\"keccak256\":\"0x41a3460e34b7b8635d936e35e6568ceb5354b638f53b884530e0d4875fa0f151\",\"urls\":[\"bzz-raw://d1a5ba866ee95d455afe5075dadd91fc71c2806371f2c1b358a1f67c632bb0df\",\"dweb:/ipfs/QmW4qCjmsG8J3UJv97GwDLDM7wt1K4yLDKAwzWMY7TFYi5\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0x05a2a90b41b6a5f42f0a72da63d015fb0b406a9ba2172823352e522e8bf3a606\",\"urls\":[\"bzz-raw://19883f0c6d33266f756ec5c3d17539524aa24b993c46c33f8400801d09373a6c\",\"dweb:/ipfs/QmYX2fwK3vQQDSZLMrc5wMfeb8RWrcC9CGX8XECLty8QDk\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Types.sol\":{\"keccak256\":\"0xe1bab8c8799d83e86c7a49aaf815d8e3bc8d09562d46d44d921500db5e98de0e\",\"urls\":[\"bzz-raw://8ea3d0cc4fdab6dd9bba545a792170f939b342d8d1a7051c1c6365009af72658\",\"dweb:/ipfs/QmaLJgbavu88eEit6JPqfWnw6NmGBDZfveMXxumgWywBFG\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "/*\n\n Copyright 2022 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 { Actions } from \"../../protocol/lib/Actions.sol\";\n\nimport { IExchangeWrapper } from \"../../protocol/interfaces/IExchangeWrapper.sol\";\n\n\n/**\n * @title IIsolationModeUnwrapperTrader\n * @author Dolomite\n *\n * Interface for a contract that can convert an isolation mode token into an underlying component token.\n */\ncontract IIsolationModeUnwrapperTrader is IExchangeWrapper {\n\n struct CreateActionsForUnwrappingParams {\n /// @dev The index of the account (according the Accounts[] array) that is performing the sell.\n uint256 primaryAccountId;\n /// @dev The index of the account (according the Accounts[] array) that is being liquidated. This is set to\n /// `_primaryAccountId` if a liquidation is not occurring.\n uint256 otherAccountId;\n /// @dev The address of the owner of the account that is performing the sell.\n address primaryAccountOwner;\n /// @dev The account number of the owner of the account that is performing the sell.\n uint256 primaryAccountNumber;\n /// @dev The address of the owner of the account that is being liquidated. This is set to\n /// `_primaryAccountOwner` if a liquidation is not occurring.\n address otherAccountOwner;\n /// @dev The account number of the owner of the account that is being liquidated. This is set to\n /// `_primaryAccountNumber` if a liquidation is not occurring.\n uint256 otherAccountNumber;\n /// @dev The market that is being outputted by the unwrapping.\n uint256 outputMarket;\n /// @dev The market that is being unwrapped, should be equal to `token()`.\n uint256 inputMarket;\n /// @dev The min amount of `_outputMarket` that must be outputted by the unwrapping.\n uint256 minOutputAmount;\n /// @dev The amount of the `_inputMarket` that the _primaryAccountId must sell.\n uint256 inputAmount;\n /// @dev The calldata to pass through to any external sales that occur.\n bytes orderData;\n }\n\n /**\n * @return The isolation mode token that this contract can unwrap\n */\n function token() external view returns (address);\n\n /**\n * @return True if the `_outputToken` is a valid output token for this contract, to be unwrapped by `token()`.\n */\n function isValidOutputToken(address _outputToken) external view returns (bool);\n\n /**\n * @return The number of actions used to unwrap the Isolation Mode token into a valid output token.\n */\n function actionsLength() external pure returns (uint256);\n\n /**\n * @notice Creates the necessary actions for selling the `_inputMarket` into `_outputMarket`. Note, the\n * `_inputMarket` should be equal to `token()` and `_outputMarket` should be validated to be a correct\n * market that can be transformed into `token()`.\n *\n * @param _params The parameters for creating the actions for unwrapping.\n * @return The actions that will be executed to unwrap the `_inputMarket` into `_outputMarket`.\n */\n function createActionsForUnwrapping(\n CreateActionsForUnwrappingParams calldata _params\n ) external view returns (Actions.ActionArgs[] memory); // solium-disable-line indentation\n}\n",
"sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IIsolationModeUnwrapperTrader.sol",
"ast": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IIsolationModeUnwrapperTrader.sol",
"exportedSymbols": {
"IIsolationModeUnwrapperTrader": [
4770
]
},
"id": 4771,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 4714,
"literals": [
"solidity",
"^",
"0.5",
".7"
],
"nodeType": "PragmaDirective",
"src": "595:23:28"
},
{
"id": 4715,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "619:33:28"
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Actions.sol",
"file": "../../protocol/lib/Actions.sol",
"id": 4717,
"nodeType": "ImportDirective",
"scope": 4771,
"sourceUnit": 25370,
"src": "654:57:28",
"symbolAliases": [
{
"foreign": 4716,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IExchangeWrapper.sol",
"file": "../../protocol/interfaces/IExchangeWrapper.sol",
"id": 4719,
"nodeType": "ImportDirective",
"scope": 4771,
"sourceUnit": 24750,
"src": "713:82:28",
"symbolAliases": [
{
"foreign": 4718,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4720,
"name": "IExchangeWrapper",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24749,
"src": "1019:16:28",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IExchangeWrapper_$24749",
"typeString": "contract IExchangeWrapper"
}
},
"id": 4721,
"nodeType": "InheritanceSpecifier",
"src": "1019:16:28"
}
],
"contractDependencies": [
24749
],
"contractKind": "contract",
"documentation": "@title IIsolationModeUnwrapperTrader\n@author Dolomite\n * Interface for a contract that can convert an isolation mode token into an underlying component token.",
"fullyImplemented": false,
"id": 4770,
"linearizedBaseContracts": [
4770,
24749
],
"name": "IIsolationModeUnwrapperTrader",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "IIsolationModeUnwrapperTrader.CreateActionsForUnwrappingParams",
"id": 4744,
"members": [
{
"constant": false,
"id": 4723,
"name": "primaryAccountId",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "1200:24:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4722,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1200:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4725,
"name": "otherAccountId",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "1428:22:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4724,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1428:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4727,
"name": "primaryAccountOwner",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "1549:27:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4726,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1549:7:28",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4729,
"name": "primaryAccountNumber",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "1682:28:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4728,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1682:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4731,
"name": "otherAccountOwner",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "1899:25:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4730,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1899:7:28",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4733,
"name": "otherAccountNumber",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "2121:26:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4732,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2121:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4735,
"name": "outputMarket",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "2231:20:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4734,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2231:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4737,
"name": "inputMarket",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "2347:19:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4736,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2347:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4739,
"name": "minOutputAmount",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "2472:23:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4738,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2472:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4741,
"name": "inputAmount",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "2596:19:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4740,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2596:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4743,
"name": "orderData",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "2708:15:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 4742,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "2708:5:28",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "CreateActionsForUnwrappingParams",
"nodeType": "StructDefinition",
"scope": 4770,
"src": "1043:1687:28",
"visibility": "public"
},
{
"body": null,
"documentation": "@return The isolation mode token that this contract can unwrap",
"id": 4749,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "token",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4745,
"nodeType": "ParameterList",
"parameters": [],
"src": "2836:2:28"
},
"returnParameters": {
"id": 4748,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4747,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 4749,
"src": "2862:7:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4746,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2862:7:28",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2861:9:28"
},
"scope": 4770,
"src": "2822:49:28",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": "@return True if the `_outputToken` is a valid output token for this contract, to be unwrapped by `token()`.",
"id": 4756,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "isValidOutputToken",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4752,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4751,
"name": "_outputToken",
"nodeType": "VariableDeclaration",
"scope": 4756,
"src": "3036:20:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4750,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3036:7:28",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3035:22:28"
},
"returnParameters": {
"id": 4755,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4754,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 4756,
"src": "3081:4:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 4753,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "3081:4:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3080:6:28"
},
"scope": 4770,
"src": "3008:79:28",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": "@return The number of actions used to unwrap the Isolation Mode token into a valid output token.",
"id": 4761,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "actionsLength",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4757,
"nodeType": "ParameterList",
"parameters": [],
"src": "3236:2:28"
},
"returnParameters": {
"id": 4760,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4759,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 4761,
"src": "3262:7:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4758,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3262:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3261:9:28"
},
"scope": 4770,
"src": "3214:57:28",
"stateMutability": "pure",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": "@notice Creates the necessary actions for selling the `_inputMarket` into `_outputMarket`. Note, the\n `_inputMarket` should be equal to `token()` and `_outputMarket` should be validated to be a correct\n market that can be transformed into `token()`.\n * @param _params The parameters for creating the actions for unwrapping.\n@return The actions that will be executed to unwrap the `_inputMarket` into `_outputMarket`.",
"id": 4769,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "createActionsForUnwrapping",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4764,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4763,
"name": "_params",
"nodeType": "VariableDeclaration",
"scope": 4769,
"src": "3823:49:28",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_CreateActionsForUnwrappingParams_$4744_calldata_ptr",
"typeString": "struct IIsolationModeUnwrapperTrader.CreateActionsForUnwrappingParams"
},
"typeName": {
"contractScope": null,
"id": 4762,
"name": "CreateActionsForUnwrappingParams",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4744,
"src": "3823:32:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_CreateActionsForUnwrappingParams_$4744_storage_ptr",
"typeString": "struct IIsolationModeUnwrapperTrader.CreateActionsForUnwrappingParams"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3813:65:28"
},
"returnParameters": {
"id": 4768,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4767,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 4769,
"src": "3902:27:28",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ActionArgs_$24930_memory_$dyn_memory_ptr",
"typeString": "struct Actions.ActionArgs[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 4765,
"name": "Actions.ActionArgs",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24930,
"src": "3902:18:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ActionArgs_$24930_storage_ptr",
"typeString": "struct Actions.ActionArgs"
}
},
"id": 4766,
"length": null,
"nodeType": "ArrayTypeName",
"src": "3902:20:28",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ActionArgs_$24930_storage_$dyn_storage_ptr",
"typeString": "struct Actions.ActionArgs[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3901:29:28"
},
"scope": 4770,
"src": "3778:153:28",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
}
],
"scope": 4771,
"src": "977:2991:28"
}
],
"src": "595:3374:28"
},
"legacyAST": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IIsolationModeUnwrapperTrader.sol",
"exportedSymbols": {
"IIsolationModeUnwrapperTrader": [
4770
]
},
"id": 4771,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 4714,
"literals": [
"solidity",
"^",
"0.5",
".7"
],
"nodeType": "PragmaDirective",
"src": "595:23:28"
},
{
"id": 4715,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "619:33:28"
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Actions.sol",
"file": "../../protocol/lib/Actions.sol",
"id": 4717,
"nodeType": "ImportDirective",
"scope": 4771,
"sourceUnit": 25370,
"src": "654:57:28",
"symbolAliases": [
{
"foreign": 4716,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IExchangeWrapper.sol",
"file": "../../protocol/interfaces/IExchangeWrapper.sol",
"id": 4719,
"nodeType": "ImportDirective",
"scope": 4771,
"sourceUnit": 24750,
"src": "713:82:28",
"symbolAliases": [
{
"foreign": 4718,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4720,
"name": "IExchangeWrapper",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24749,
"src": "1019:16:28",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IExchangeWrapper_$24749",
"typeString": "contract IExchangeWrapper"
}
},
"id": 4721,
"nodeType": "InheritanceSpecifier",
"src": "1019:16:28"
}
],
"contractDependencies": [
24749
],
"contractKind": "contract",
"documentation": "@title IIsolationModeUnwrapperTrader\n@author Dolomite\n * Interface for a contract that can convert an isolation mode token into an underlying component token.",
"fullyImplemented": false,
"id": 4770,
"linearizedBaseContracts": [
4770,
24749
],
"name": "IIsolationModeUnwrapperTrader",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "IIsolationModeUnwrapperTrader.CreateActionsForUnwrappingParams",
"id": 4744,
"members": [
{
"constant": false,
"id": 4723,
"name": "primaryAccountId",
"nodeType": "VariableDeclaration",
"scope": 4744,
"src": "1200:24:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4722,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1200:7:28",
"typeDescriptions": {
"typeIdentifier": "t_uint2