@dolomite-exchange/dolomite-margin
Version:
Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol
959 lines • 556 kB
JSON
{
"contractName": "Actions",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"dYdX * Library that defines and parses valid Actions\",\"methods\":{},\"title\":\"Actions\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Actions.sol\":\"Actions\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/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": "0x60636023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a72315820ebdb6a0055710f3f33315c86f95a72948141990f6be16b66e13b7920e27d42b46c6578706572696d656e74616cf564736f6c63430005100040",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a72315820ebdb6a0055710f3f33315c86f95a72948141990f6be16b66e13b7920e27d42b46c6578706572696d656e74616cf564736f6c63430005100040",
"sourceMap": "836:12038:88:-;;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",
"deployedSourceMap": "836:12038:88:-;;;;;;;;",
"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 { Account } from \"./Account.sol\";\nimport { Types } from \"./Types.sol\";\n\n\n/**\n * @title Actions\n * @author dYdX\n *\n * Library that defines and parses valid Actions\n */\nlibrary Actions {\n\n // ============ Constants ============\n\n bytes32 private constant FILE = \"Actions\";\n\n // ============ Enums ============\n\n enum ActionType {\n Deposit, // supply tokens\n Withdraw, // borrow tokens\n Transfer, // transfer balance between accounts\n Buy, // buy an amount of some token (externally)\n Sell, // sell an amount of some token (externally)\n Trade, // trade tokens against another account\n Liquidate, // liquidate an undercollateralized or expiring account\n Vaporize, // use excess tokens to zero-out a completely negative account\n Call // send arbitrary data to an address\n }\n\n enum AccountLayout {\n OnePrimary,\n TwoPrimary,\n PrimaryAndSecondary\n }\n\n enum MarketLayout {\n ZeroMarkets,\n OneMarket,\n TwoMarkets\n }\n\n // ============ Structs ============\n\n /*\n * Arguments that are passed to DolomiteMargin in an ordered list as part of a single operation.\n * Each ActionArgs has an actionType which specifies which action struct that this data will be\n * parsed into before being processed.\n */\n struct ActionArgs {\n ActionType actionType;\n uint256 accountId;\n Types.AssetAmount amount;\n uint256 primaryMarketId;\n uint256 secondaryMarketId;\n address otherAddress;\n uint256 otherAccountId;\n bytes data;\n }\n\n // ============ Action Types ============\n\n /*\n * Moves tokens from an address to DolomiteMargin. Can either repay a borrow or provide additional supply.\n */\n struct DepositArgs {\n Types.AssetAmount amount;\n Account.Info account;\n uint256 market;\n address from;\n }\n\n /*\n * Moves tokens from DolomiteMargin to another address. Can either borrow tokens or reduce the amount\n * previously supplied.\n */\n struct WithdrawArgs {\n Types.AssetAmount amount;\n Account.Info account;\n uint256 market;\n address to;\n }\n\n /*\n * Transfers balance between two accounts. The msg.sender must be an operator for both accounts.\n * The amount field applies to accountOne.\n * This action does not require any token movement since the trade is done internally to DolomiteMargin.\n */\n struct TransferArgs {\n Types.AssetAmount amount;\n Account.Info accountOne;\n Account.Info accountTwo;\n uint256 market;\n }\n\n /*\n * Acquires a certain amount of tokens by spending other tokens. Sends takerMarket tokens to the\n * specified exchangeWrapper contract and expects makerMarket tokens in return. The amount field\n * applies to the makerMarket.\n */\n struct BuyArgs {\n Types.AssetAmount amount;\n Account.Info account;\n uint256 makerMarket;\n uint256 takerMarket;\n address exchangeWrapper;\n bytes orderData;\n }\n\n /*\n * Spends a certain amount of tokens to acquire other tokens. Sends takerMarket tokens to the\n * specified exchangeWrapper and expects makerMarket tokens in return. The amount field applies\n * to the takerMarket.\n */\n struct SellArgs {\n Types.AssetAmount amount;\n Account.Info account;\n uint256 takerMarket;\n uint256 makerMarket;\n address exchangeWrapper;\n bytes orderData;\n }\n\n /*\n * Trades balances between two accounts using any external contract that implements the\n * AutoTrader interface. The AutoTrader contract must be an operator for the makerAccount (for\n * which it is trading on-behalf-of). The amount field applies to the makerAccount and the\n * inputMarket. This proposed change to the makerAccount is passed to the AutoTrader which will\n * quote a change for the makerAccount in the outputMarket (or will disallow the trade).\n * This action does not require any token movement since the trade is done internally to DolomiteMargin.\n */\n struct TradeArgs {\n Types.AssetAmount amount;\n bool calculateAmountWithMakerAccount;\n Account.Info takerAccount;\n Account.Info makerAccount;\n uint256 inputMarket;\n uint256 outputMarket;\n address autoTrader;\n bytes tradeData;\n }\n\n /*\n * Each account must maintain a certain margin-ratio (specified globally). If the account falls\n * below this margin-ratio, it can be liquidated by any other account. This allows anyone else\n * (arbitrageurs) to repay any borrowed asset (owedMarket) of the liquidating account in\n * exchange for any collateral asset (heldMarket) of the liquidAccount. The ratio is determined\n * by the price ratio (given by the oracles) plus a spread (specified globally). Liquidating an\n * account also sets a flag on the account that the account is being liquidated. This allows\n * anyone to continue liquidating the account until there are no more borrows being taken by the\n * liquidating account. Liquidators do not have to liquidate the entire account all at once but\n * can liquidate as much as they choose. The liquidating flag allows liquidators to continue\n * liquidating the account even if it becomes collateralized through partial liquidation or\n * price movement.\n */\n struct LiquidateArgs {\n Types.AssetAmount amount;\n Account.Info solidAccount;\n Account.Info liquidAccount;\n uint256 owedMarket;\n uint256 heldMarket;\n }\n\n /*\n * Similar to liquidate, but vaporAccounts are accounts that have only negative balances remaining. The arbitrageur\n * pays back the negative asset (owedMarket) of the vaporAccount in exchange for a collateral asset (heldMarket) at\n * a favorable spread. However, since the liquidAccount has no collateral assets, the collateral must come from\n * DolomiteMargin's excess tokens.\n */\n struct VaporizeArgs {\n Types.AssetAmount amount;\n Account.Info solidAccount;\n Account.Info vaporAccount;\n uint256 owedMarket;\n uint256 heldMarket;\n }\n\n /*\n * Passes arbitrary bytes of data to an external contract that implements the Callee interface.\n * Does not change any asset amounts. This function may be useful for setting certain variables\n * on layer-two contracts for certain accounts without having to make a separate Ethereum\n * transaction for doing so. Also, the second-layer contracts can ensure that the call is coming\n * from an operator of the particular account.\n */\n struct CallArgs {\n Account.Info account;\n address callee;\n bytes data;\n }\n\n // ============ Helper Functions ============\n\n function getMarketLayout(\n ActionType actionType\n )\n internal\n pure\n returns (MarketLayout)\n {\n if (\n actionType == Actions.ActionType.Deposit\n || actionType == Actions.ActionType.Withdraw\n || actionType == Actions.ActionType.Transfer\n ) {\n return MarketLayout.OneMarket;\n }\n else if (actionType == Actions.ActionType.Call) {\n return MarketLayout.ZeroMarkets;\n }\n return MarketLayout.TwoMarkets;\n }\n\n function getAccountLayout(\n ActionType actionType\n )\n internal\n pure\n returns (AccountLayout)\n {\n if (\n actionType == Actions.ActionType.Transfer\n || actionType == Actions.ActionType.Trade\n ) {\n return AccountLayout.TwoPrimary;\n } else if (\n actionType == Actions.ActionType.Liquidate\n || actionType == Actions.ActionType.Vaporize\n ) {\n return AccountLayout.PrimaryAndSecondary;\n }\n return AccountLayout.OnePrimary;\n }\n\n // ============ Parsing Functions ============\n\n function parseDepositArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (DepositArgs memory)\n {\n return DepositArgs({\n amount: args.amount,\n account: accounts[args.accountId],\n market: args.primaryMarketId,\n from: args.otherAddress\n });\n }\n\n function parseWithdrawArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (WithdrawArgs memory)\n {\n return WithdrawArgs({\n amount: args.amount,\n account: accounts[args.accountId],\n market: args.primaryMarketId,\n to: args.otherAddress\n });\n }\n\n function parseTransferArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (TransferArgs memory)\n {\n return TransferArgs({\n amount: args.amount,\n accountOne: accounts[args.accountId],\n accountTwo: accounts[args.otherAccountId],\n market: args.primaryMarketId\n });\n }\n\n function parseBuyArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (BuyArgs memory)\n {\n return BuyArgs({\n amount: args.amount,\n account: accounts[args.accountId],\n makerMarket: args.primaryMarketId,\n takerMarket: args.secondaryMarketId,\n exchangeWrapper: args.otherAddress,\n orderData: args.data\n });\n }\n\n function parseSellArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (SellArgs memory)\n {\n return SellArgs({\n amount: args.amount,\n account: accounts[args.accountId],\n takerMarket: args.primaryMarketId,\n makerMarket: args.secondaryMarketId,\n exchangeWrapper: args.otherAddress,\n orderData: args.data\n });\n }\n\n function parseTradeArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (TradeArgs memory)\n {\n (bool calculateAmountWithMakerAccount, bytes memory tradeData) = abi.decode(args.data, (bool, bytes));\n return TradeArgs({\n amount: args.amount,\n calculateAmountWithMakerAccount: calculateAmountWithMakerAccount,\n takerAccount: accounts[args.accountId],\n makerAccount: accounts[args.otherAccountId],\n inputMarket: args.primaryMarketId,\n outputMarket: args.secondaryMarketId,\n autoTrader: args.otherAddress,\n tradeData: tradeData\n });\n }\n\n function parseLiquidateArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (LiquidateArgs memory)\n {\n return LiquidateArgs({\n amount: args.amount,\n solidAccount: accounts[args.accountId],\n liquidAccount: accounts[args.otherAccountId],\n owedMarket: args.primaryMarketId,\n heldMarket: args.secondaryMarketId\n });\n }\n\n function parseVaporizeArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (VaporizeArgs memory)\n {\n return VaporizeArgs({\n amount: args.amount,\n solidAccount: accounts[args.accountId],\n vaporAccount: accounts[args.otherAccountId],\n owedMarket: args.primaryMarketId,\n heldMarket: args.secondaryMarketId\n });\n }\n\n function parseCallArgs(\n Account.Info[] memory accounts,\n ActionArgs memory args\n )\n internal\n pure\n returns (CallArgs memory)\n {\n return CallArgs({\n account: accounts[args.accountId],\n callee: args.otherAddress,\n data: args.data\n });\n }\n}\n",
"sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Actions.sol",
"ast": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Actions.sol",
"exportedSymbols": {
"Actions": [
25369
]
},
"id": 25370,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 24887,
"literals": [
"solidity",
"^",
"0.5",
".7"
],
"nodeType": "PragmaDirective",
"src": "603:23:88"
},
{
"id": 24888,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "627:33:88"
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Account.sol",
"file": "./Account.sol",
"id": 24890,
"nodeType": "ImportDirective",
"scope": 25370,
"sourceUnit": 24886,
"src": "662:40:88",
"symbolAliases": [
{
"foreign": 24889,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Types.sol",
"file": "./Types.sol",
"id": 24892,
"nodeType": "ImportDirective",
"scope": 25370,
"sourceUnit": 31362,
"src": "703:36:88",
"symbolAliases": [
{
"foreign": 24891,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title Actions\n@author dYdX\n * Library that defines and parses valid Actions",
"fullyImplemented": true,
"id": 25369,
"linearizedBaseContracts": [
25369
],
"name": "Actions",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": true,
"id": 24895,
"name": "FILE",
"nodeType": "VariableDeclaration",
"scope": 25369,
"src": "903:41:88",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 24893,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "903:7:88",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "416374696f6e73",
"id": 24894,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "935:9:88",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5579ba3e7402081c88cab7c7c31a20dd798f0fce0700d2238a95622b3397d009",
"typeString": "literal_string \"Actions\""
},
"value": "Actions"
},
"visibility": "private"
},
{
"canonicalName": "Actions.ActionType",
"id": 24905,
"members": [
{
"id": 24896,
"name": "Deposit",
"nodeType": "EnumValue",
"src": "1017:7:88"
},
{
"id": 24897,
"name": "Withdraw",
"nodeType": "EnumValue",
"src": "1053:8:88"
},
{
"id": 24898,
"name": "Transfer",
"nodeType": "EnumValue",
"src": "1089:8:88"
},
{
"id": 24899,
"name": "Buy",
"nodeType": "EnumValue",
"src": "1145:3:88"
},
{
"id": 24900,
"name": "Sell",
"nodeType": "EnumValue",
"src": "1208:4:88"
},
{
"id": 24901,
"name": "Trade",
"nodeType": "EnumValue",
"src": "1272:5:88"
},
{
"id": 24902,
"name": "Liquidate",
"nodeType": "EnumValue",
"src": "1331:9:88"
},
{
"id": 24903,
"name": "Vaporize",
"nodeType": "EnumValue",
"src": "1406:8:88"
},
{
"id": 24904,
"name": "Call",
"nodeType": "EnumValue",
"src": "1488:4:88"
}
],
"name": "ActionType",
"nodeType": "EnumDefinition",
"src": "991:550:88"
},
{
"canonicalName": "Actions.AccountLayout",
"id": 24909,
"members": [
{
"id": 24906,
"name": "OnePrimary",
"nodeType": "EnumValue",
"src": "1576:10:88"
},
{
"id": 24907,
"name": "TwoPrimary",
"nodeType": "EnumValue",
"src": "1596:10:88"
},
{
"id": 24908,
"name": "PrimaryAndSecondary",
"nodeType": "EnumValue",
"src": "1616:19:88"
}
],
"name": "AccountLayout",
"nodeType": "EnumDefinition",
"src": "1547:94:88"
},
{
"canonicalName": "Actions.MarketLayout",
"id": 24913,
"members": [
{
"id": 24910,
"name": "ZeroMarkets",
"nodeType": "EnumValue",
"src": "1675:11:88"
},
{
"id": 24911,
"name": "OneMarket",
"nodeType": "EnumValue",
"src": "1696:9:88"
},
{
"id": 24912,
"name": "TwoMarkets",
"nodeType": "EnumValue",
"src": "1715:10:88"
}
],
"name": "MarketLayout",
"nodeType": "EnumDefinition",
"src": "1647:84:88"
},
{
"canonicalName": "Actions.ActionArgs",
"id": 24930,
"members": [
{
"constant": false,
"id": 24915,
"name": "actionType",
"nodeType": "VariableDeclaration",
"scope": 24930,
"src": "2066:21:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_enum$_ActionType_$24905",
"typeString": "enum Actions.ActionType"
},
"typeName": {
"contractScope": null,
"id": 24914,
"name": "ActionType",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24905,
"src": "2066:10:88",
"typeDescriptions": {
"typeIdentifier": "t_enum$_ActionType_$24905",
"typeString": "enum Actions.ActionType"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24917,
"name": "accountId",
"nodeType": "VariableDeclaration",
"scope": 24930,
"src": "2097:17:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24916,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2097:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24919,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 24930,
"src": "2124:24:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
},
"typeName": {
"contractScope": null,
"id": 24918,
"name": "Types.AssetAmount",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 30880,
"src": "2124:17:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24921,
"name": "primaryMarketId",
"nodeType": "VariableDeclaration",
"scope": 24930,
"src": "2158:23:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24920,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2158:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24923,
"name": "secondaryMarketId",
"nodeType": "VariableDeclaration",
"scope": 24930,
"src": "2191:25:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24922,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2191:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24925,
"name": "otherAddress",
"nodeType": "VariableDeclaration",
"scope": 24930,
"src": "2226:20:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 24924,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2226:7:88",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24927,
"name": "otherAccountId",
"nodeType": "VariableDeclaration",
"scope": 24930,
"src": "2256:22:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24926,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2256:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24929,
"name": "data",
"nodeType": "VariableDeclaration",
"scope": 24930,
"src": "2288:10:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 24928,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "2288:5:88",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "ActionArgs",
"nodeType": "StructDefinition",
"scope": 25369,
"src": "2038:267:88",
"visibility": "public"
},
{
"canonicalName": "Actions.DepositArgs",
"id": 24939,
"members": [
{
"constant": false,
"id": 24932,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 24939,
"src": "2513:24:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
},
"typeName": {
"contractScope": null,
"id": 24931,
"name": "Types.AssetAmount",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 30880,
"src": "2513:17:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24934,
"name": "account",
"nodeType": "VariableDeclaration",
"scope": 24939,
"src": "2547:20:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24933,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "2547:12:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24936,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 24939,
"src": "2577:14:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24935,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2577:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24938,
"name": "from",
"nodeType": "VariableDeclaration",
"scope": 24939,
"src": "2601:12:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 24937,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2601:7:88",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "DepositArgs",
"nodeType": "StructDefinition",
"scope": 25369,
"src": "2484:136:88",
"visibility": "public"
},
{
"canonicalName": "Actions.WithdrawArgs",
"id": 24948,
"members": [
{
"constant": false,
"id": 24941,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 24948,
"src": "2805:24:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
},
"typeName": {
"contractScope": null,
"id": 24940,
"name": "Types.AssetAmount",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 30880,
"src": "2805:17:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24943,
"name": "account",
"nodeType": "VariableDeclaration",
"scope": 24948,
"src": "2839:20:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24942,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "2839:12:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24945,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 24948,
"src": "2869:14:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24944,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2869:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24947,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 24948,
"src": "2893:10:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 24946,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2893:7:88",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "WithdrawArgs",
"nodeType": "StructDefinition",
"scope": 25369,
"src": "2775:135:88",
"visibility": "public"
},
{
"canonicalName": "Actions.TransferArgs",
"id": 24957,
"members": [
{
"constant": false,
"id": 24950,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 24957,
"src": "3218:24:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
},
"typeName": {
"contractScope": null,
"id": 24949,
"name": "Types.AssetAmount",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 30880,
"src": "3218:17:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24952,
"name": "accountOne",
"nodeType": "VariableDeclaration",
"scope": 24957,
"src": "3252:23:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24951,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "3252:12:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24954,
"name": "accountTwo",
"nodeType": "VariableDeclaration",
"scope": 24957,
"src": "3285:23:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24953,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "3285:12:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24956,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 24957,
"src": "3318:14:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24955,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3318:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "TransferArgs",
"nodeType": "StructDefinition",
"scope": 25369,
"src": "3188:151:88",
"visibility": "public"
},
{
"canonicalName": "Actions.BuyArgs",
"id": 24970,
"members": [
{
"constant": false,
"id": 24959,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 24970,
"src": "3622:24:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
},
"typeName": {
"contractScope": null,
"id": 24958,
"name": "Types.AssetAmount",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 30880,
"src": "3622:17:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_AssetAmount_$30880_storage_ptr",
"typeString": "struct Types.AssetAmount"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24961,
"name": "account",
"nodeType": "VariableDeclaration",
"scope": 24970,
"src": "3656:20:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24960,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "3656:12:88",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24963,
"name": "makerMarket",
"nodeType": "VariableDeclaration",
"scope": 24970,
"src": "3686:19:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24962,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3686:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24965,
"name": "takerMarket",
"nodeType": "VariableDeclaration",
"scope": 24970,
"src": "3715:19:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24964,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3715:7:88",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24967,
"name": "exchangeWrapper",
"nodeType": "VariableDeclaration",
"scope": 24970,
"src": "3744:23:88",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 24966,
"name": "address",
"no