UNPKG

@dolomite-exchange/dolomite-margin

Version:

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

1,090 lines (1,089 loc) 125 kB
{ "contractName": "HasLiquidatorRegistry", "abi": [ { "inputs": [ { "internalType": "address", "name": "_liquidatorAssetRegistry", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": true, "inputs": [], "name": "LIQUIDATOR_ASSET_REGISTRY", "outputs": [ { "internalType": "contract ILiquidatorAssetRegistry", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_liquidatorAssetRegistry\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"constant\":true,\"inputs\":[],\"name\":\"LIQUIDATOR_ASSET_REGISTRY\",\"outputs\":[{\"internalType\":\"contract ILiquidatorAssetRegistry\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/external/helpers/HasLiquidatorRegistry.sol\":\"HasLiquidatorRegistry\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/external/helpers/HasLiquidatorRegistry.sol\":{\"keccak256\":\"0xf7fb6d26d662f5a7ae5df8e30110664c7254f1a4969c31a3504e166018358e42\",\"urls\":[\"bzz-raw://b1a8adc3fdddce8ad10ce2420570b73218c3dd23238ab0000938051194834389\",\"dweb:/ipfs/QmPE47PxyM2xEat3xCWkiogpNRGkx26KLePGQZhGRGJpk8\"]},\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/external/interfaces/ILiquidatorAssetRegistry.sol\":{\"keccak256\":\"0x0d99615ee12fad08fbdf59a67683af9c7cdcfd2f25cf20b6767ebb6988eec514\",\"urls\":[\"bzz-raw://90230d7a44d9936cda8d1b1fef170daf91750b97d3da9634ed6c079fb8dbd15a\",\"dweb:/ipfs/QmfQxDE36en2hecxS4Y2i4BH6TsSEDEzKNxooysW4GsdKb\"]},\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0x05a2a90b41b6a5f42f0a72da63d015fb0b406a9ba2172823352e522e8bf3a606\",\"urls\":[\"bzz-raw://19883f0c6d33266f756ec5c3d17539524aa24b993c46c33f8400801d09373a6c\",\"dweb:/ipfs/QmYX2fwK3vQQDSZLMrc5wMfeb8RWrcC9CGX8XECLty8QDk\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506040516101113803806101118339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b031990921691909117905560ad806100646000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063cf530f8814602d575b600080fd5b6033605c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60005473ffffffffffffffffffffffffffffffffffffffff168156fea265627a7a723158206d96ea544ab8d3229de64a793d86ca0db3a5eb12ea15fba1f9046d088ad59c9264736f6c63430005100032", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063cf530f8814602d575b600080fd5b6033605c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60005473ffffffffffffffffffffffffffffffffffffffff168156fea265627a7a723158206d96ea544ab8d3229de64a793d86ca0db3a5eb12ea15fba1f9046d088ad59c9264736f6c63430005100032", "sourceMap": "767:1688:3:-;;;1403:170;8:9:-1;5:2;;;30:1;27;20:12;5:2;1403:170:3;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1403:170:3;1488:25;:78;;-1:-1:-1;;;;;1488:78:3;;;-1:-1:-1;;;;;;1488:78:3;;;;;;;;;767:1688;;;;;;", "deployedSourceMap": "767:1688:3:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;767:1688:3;;;;;;;;;;;;;;;;;;;953:57;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;:::o", "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;\n\nimport { Require } from \"../../protocol/lib/Require.sol\";\nimport { ILiquidatorAssetRegistry } from \"../interfaces/ILiquidatorAssetRegistry.sol\";\n\n\ncontract HasLiquidatorRegistry {\n\n // ============ Constants ============\n\n bytes32 private constant FILE = \"HasLiquidatorRegistry\";\n\n // ============ Storage ============\n\n ILiquidatorAssetRegistry public LIQUIDATOR_ASSET_REGISTRY;\n\n // ============ Modifiers ============\n\n modifier requireIsAssetWhitelistedForLiquidation(uint256 _marketId) {\n _validateAssetForLiquidation(_marketId);\n _;\n }\n\n modifier requireIsAssetsWhitelistedForLiquidation(uint256[] memory _marketIds) {\n _validateAssetsForLiquidation(_marketIds);\n _;\n }\n\n // ============ Constructors ============\n\n constructor(\n address _liquidatorAssetRegistry\n )\n public\n {\n LIQUIDATOR_ASSET_REGISTRY = ILiquidatorAssetRegistry(_liquidatorAssetRegistry);\n }\n\n // ============ Internal Functions ============\n\n function _validateAssetForLiquidation(uint256 _marketId) internal view {\n Require.that(\n LIQUIDATOR_ASSET_REGISTRY.isAssetWhitelistedForLiquidation(_marketId, address(this)),\n FILE,\n \"Asset not whitelisted\",\n _marketId\n );\n }\n\n function _validateAssetsForLiquidation(uint256[] memory _marketIds) internal view {\n ILiquidatorAssetRegistry liquidatorAssetRegistry = LIQUIDATOR_ASSET_REGISTRY;\n uint256 marketIdsLength = _marketIds.length;\n for (uint256 i; i < marketIdsLength; ++i) {\n Require.that(\n liquidatorAssetRegistry.isAssetWhitelistedForLiquidation(_marketIds[i], address(this)),\n FILE,\n \"Asset not whitelisted\",\n _marketIds[i]\n );\n }\n }\n\n}\n", "sourcePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/external/helpers/HasLiquidatorRegistry.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/external/helpers/HasLiquidatorRegistry.sol", "exportedSymbols": { "HasLiquidatorRegistry": [ 1722 ] }, "id": 1723, "nodeType": "SourceUnit", "nodes": [ { "id": 1612, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "595:23:3" }, { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Require.sol", "file": "../../protocol/lib/Require.sol", "id": 1614, "nodeType": "ImportDirective", "scope": 1723, "sourceUnit": 28453, "src": "620:57:3", "symbolAliases": [ { "foreign": 1613, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/external/interfaces/ILiquidatorAssetRegistry.sol", "file": "../interfaces/ILiquidatorAssetRegistry.sol", "id": 1616, "nodeType": "ImportDirective", "scope": 1723, "sourceUnit": 4875, "src": "678:86:3", "symbolAliases": [ { "foreign": 1615, "local": null } ], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 1722, "linearizedBaseContracts": [ 1722 ], "name": "HasLiquidatorRegistry", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 1619, "name": "FILE", "nodeType": "VariableDeclaration", "scope": 1722, "src": "849:55:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1617, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "849:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "hexValue": "4861734c697175696461746f725265676973747279", "id": 1618, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "881:23:3", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_8c097863d0475b8da0857f2b56c9b9a380b8d4fb0c35c50b5eb3c31038f48f6c", "typeString": "literal_string \"HasLiquidatorRegistry\"" }, "value": "HasLiquidatorRegistry" }, "visibility": "private" }, { "constant": false, "id": 1621, "name": "LIQUIDATOR_ASSET_REGISTRY", "nodeType": "VariableDeclaration", "scope": 1722, "src": "953:57:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" }, "typeName": { "contractScope": null, "id": 1620, "name": "ILiquidatorAssetRegistry", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4874, "src": "953:24:3", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" } }, "value": null, "visibility": "public" }, { "body": { "id": 1630, "nodeType": "Block", "src": "1129:67:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1626, "name": "_marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1623, "src": "1168:9:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1625, "name": "_validateAssetForLiquidation", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1675, "src": "1139:28:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$__$", "typeString": "function (uint256) view" } }, "id": 1627, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1139:39:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1628, "nodeType": "ExpressionStatement", "src": "1139:39:3" }, { "id": 1629, "nodeType": "PlaceholderStatement", "src": "1188:1:3" } ] }, "documentation": null, "id": 1631, "name": "requireIsAssetWhitelistedForLiquidation", "nodeType": "ModifierDefinition", "parameters": { "id": 1624, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1623, "name": "_marketId", "nodeType": "VariableDeclaration", "scope": 1631, "src": "1110:17:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1622, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1110:7:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1109:19:3" }, "src": "1061:135:3", "visibility": "internal" }, { "body": { "id": 1641, "nodeType": "Block", "src": "1281:69:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1637, "name": "_marketIds", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1634, "src": "1321:10:3", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" } ], "id": 1636, "name": "_validateAssetsForLiquidation", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1721, "src": "1291:29:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", "typeString": "function (uint256[] memory) view" } }, "id": 1638, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1291:41:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1639, "nodeType": "ExpressionStatement", "src": "1291:41:3" }, { "id": 1640, "nodeType": "PlaceholderStatement", "src": "1342:1:3" } ] }, "documentation": null, "id": 1642, "name": "requireIsAssetsWhitelistedForLiquidation", "nodeType": "ModifierDefinition", "parameters": { "id": 1635, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1634, "name": "_marketIds", "nodeType": "VariableDeclaration", "scope": 1642, "src": "1252:27:3", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[]" }, "typeName": { "baseType": { "id": 1632, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1252:7:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1633, "length": null, "nodeType": "ArrayTypeName", "src": "1252:9:3", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", "typeString": "uint256[]" } }, "value": null, "visibility": "internal" } ], "src": "1251:29:3" }, "src": "1202:148:3", "visibility": "internal" }, { "body": { "id": 1653, "nodeType": "Block", "src": "1478:95:3", "statements": [ { "expression": { "argumentTypes": null, "id": 1651, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 1647, "name": "LIQUIDATOR_ASSET_REGISTRY", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1621, "src": "1488:25:3", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1649, "name": "_liquidatorAssetRegistry", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1644, "src": "1541:24:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1648, "name": "ILiquidatorAssetRegistry", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4874, "src": "1516:24:3", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_ILiquidatorAssetRegistry_$4874_$", "typeString": "type(contract ILiquidatorAssetRegistry)" } }, "id": 1650, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1516:50:3", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" } }, "src": "1488:78:3", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" } }, "id": 1652, "nodeType": "ExpressionStatement", "src": "1488:78:3" } ] }, "documentation": null, "id": 1654, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 1645, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1644, "name": "_liquidatorAssetRegistry", "nodeType": "VariableDeclaration", "scope": 1654, "src": "1424:32:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1643, "name": "address", "nodeType": "ElementaryTypeName", "src": "1424:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1414:48:3" }, "returnParameters": { "id": 1646, "nodeType": "ParameterList", "parameters": [], "src": "1478:0:3" }, "scope": 1722, "src": "1403:170:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 1674, "nodeType": "Block", "src": "1703:215:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1664, "name": "_marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1656, "src": "1798:9:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1666, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38201, "src": "1817:4:3", "typeDescriptions": { "typeIdentifier": "t_contract$_HasLiquidatorRegistry_$1722", "typeString": "contract HasLiquidatorRegistry" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_HasLiquidatorRegistry_$1722", "typeString": "contract HasLiquidatorRegistry" } ], "id": 1665, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1809:7:3", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 1667, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1809:13:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 1662, "name": "LIQUIDATOR_ASSET_REGISTRY", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1621, "src": "1739:25:3", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" } }, "id": 1663, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "isAssetWhitelistedForLiquidation", "nodeType": "MemberAccess", "referencedDeclaration": 4873, "src": "1739:58:3", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_uint256_$_t_address_$returns$_t_bool_$", "typeString": "function (uint256,address) view external returns (bool)" } }, "id": 1668, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1739:84:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 1669, "name": "FILE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1619, "src": "1837:4:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "hexValue": "4173736574206e6f742077686974656c6973746564", "id": 1670, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1855:23:3", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_d49662a14d3ab59cd6ede2c58c4cc5b76a91260aabfeda80695115666f8ca9f4", "typeString": "literal_string \"Asset not whitelisted\"" }, "value": "Asset not whitelisted" }, { "argumentTypes": null, "id": 1671, "name": "_marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1656, "src": "1892:9:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_stringliteral_d49662a14d3ab59cd6ede2c58c4cc5b76a91260aabfeda80695115666f8ca9f4", "typeString": "literal_string \"Asset not whitelisted\"" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 1659, "name": "Require", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 28452, "src": "1713:7:3", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Require_$28452_$", "typeString": "type(library Require)" } }, "id": 1661, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "that", "nodeType": "MemberAccess", "referencedDeclaration": 27852, "src": "1713:12:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_bytes32_$_t_bytes32_$_t_uint256_$returns$__$", "typeString": "function (bool,bytes32,bytes32,uint256) pure" } }, "id": 1672, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1713:198:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1673, "nodeType": "ExpressionStatement", "src": "1713:198:3" } ] }, "documentation": null, "id": 1675, "implemented": true, "kind": "function", "modifiers": [], "name": "_validateAssetForLiquidation", "nodeType": "FunctionDefinition", "parameters": { "id": 1657, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1656, "name": "_marketId", "nodeType": "VariableDeclaration", "scope": 1675, "src": "1670:17:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1655, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1670:7:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1669:19:3" }, "returnParameters": { "id": 1658, "nodeType": "ParameterList", "parameters": [], "src": "1703:0:3" }, "scope": 1722, "src": "1632:286:3", "stateMutability": "view", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1720, "nodeType": "Block", "src": "2006:446:3", "statements": [ { "assignments": [ 1682 ], "declarations": [ { "constant": false, "id": 1682, "name": "liquidatorAssetRegistry", "nodeType": "VariableDeclaration", "scope": 1720, "src": "2016:48:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" }, "typeName": { "contractScope": null, "id": 1681, "name": "ILiquidatorAssetRegistry", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4874, "src": "2016:24:3", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" } }, "value": null, "visibility": "internal" } ], "id": 1684, "initialValue": { "argumentTypes": null, "id": 1683, "name": "LIQUIDATOR_ASSET_REGISTRY", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1621, "src": "2067:25:3", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" } }, "nodeType": "VariableDeclarationStatement", "src": "2016:76:3" }, { "assignments": [ 1686 ], "declarations": [ { "constant": false, "id": 1686, "name": "marketIdsLength", "nodeType": "VariableDeclaration", "scope": 1720, "src": "2102:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1685, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2102:7:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1689, "initialValue": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1687, "name": "_marketIds", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1678, "src": "2128:10:3", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" } }, "id": 1688, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2128:17:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "2102:43:3" }, { "body": { "id": 1718, "nodeType": "Block", "src": "2197:249:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 1704, "name": "_marketIds", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1678, "src": "2298:10:3", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", "typeString": "uint256[] memory" } }, "id": 1706, "indexExpression": { "argumentTypes": null, "id": 1705, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1691, "src": "2309:1:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "2298:13:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1708, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38201, "src": "2321:4:3", "typeDescriptions": { "typeIdentifier": "t_contract$_HasLiquidatorRegistry_$1722", "typeString": "contract HasLiquidatorRegistry" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_HasLiquidatorRegistry_$1722", "typeString": "contract HasLiquidatorRegistry" } ], "id": 1707, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2313:7:3", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 1709, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2313:13:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 1702, "name": "liquidatorAssetRegistry", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1682, "src": "2241:23:3", "typeDescriptions": { "typeIdentifier": "t_contract$_ILiquidatorAssetRegistry_$4874", "typeString": "contract ILiquidatorAssetRegistry" } }, "id": 1703, "isConstant": false, "isLValue": false,