UNPKG

@dolomite-exchange/dolomite-margin

Version:

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

998 lines 240 kB
{ "contractName": "EnumerableSet", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Alberto Cuesta Ca\\u00f1ada\",\"details\":\"Library for managing https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive types. * Sets have the following properties: * - Elements are added, removed, and checked for existence in constant time (O(1)). - Elements are enumerated in O(n). No guarantees are made on the ordering. * As of v2.5.0, only `address` sets are supported. * Include with `using EnumerableSet for EnumerableSet.AddressSet;`. * _Available since v2.5.0._\",\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/EnumerableSet.sol\":\"EnumerableSet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"keccak256\":\"0xcce1d35afae7905e2fd76ff67c3fe866091e223c50133527c302a31ffce9a5d7\",\"urls\":[\"bzz-raw://0fb055ae3a79a6ff6136feeabf8905a535fe90ee273b5099b4405fbeda0dc411\",\"dweb:/ipfs/QmYiqVcFnYuGGX8m7hzASfo7HMPhEqTxSvvGRX1ZipDknF\"]}},\"version\":1}", "bytecode": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158208a689c8cc306c7098bbc1fed6dc592fd0e7b29f03ba1a68536fd1a221b6720d564736f6c63430005100032", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158208a689c8cc306c7098bbc1fed6dc592fd0e7b29f03ba1a68536fd1a221b6720d564736f6c63430005100032", "sourceMap": "556:3394:155:-;;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": "556:3394:155:-;;;;;;;;", "source": "pragma solidity ^0.5.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * As of v2.5.0, only `address` sets are supported.\n *\n * Include with `using EnumerableSet for EnumerableSet.AddressSet;`.\n *\n * _Available since v2.5.0._\n *\n * @author Alberto Cuesta Cañada\n */\nlibrary EnumerableSet {\n\n struct AddressSet {\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (address => uint256) index;\n address[] values;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n * Returns false if the value was already in the set.\n */\n function add(AddressSet storage set, address value)\n internal\n returns (bool)\n {\n if (!contains(set, value)){\n set.index[value] = set.values.push(value);\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n * Returns false if the value was not present in the set.\n */\n function remove(AddressSet storage set, address value)\n internal\n returns (bool)\n {\n if (contains(set, value)){\n uint256 toDeleteIndex = set.index[value] - 1;\n uint256 lastIndex = set.values.length - 1;\n\n // If the element we're deleting is the last one, we can just remove it without doing a swap\n if (lastIndex != toDeleteIndex) {\n address lastValue = set.values[lastIndex];\n\n // Move the last value to the index where the deleted value is\n set.values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set.index[lastValue] = toDeleteIndex + 1; // All indexes are 1-based\n }\n\n // Delete the index entry for the deleted value\n delete set.index[value];\n\n // Delete the old entry for the moved value\n set.values.pop();\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value)\n internal\n view\n returns (bool)\n {\n return set.index[value] != 0;\n }\n\n /**\n * @dev Returns an array with all values in the set. O(N).\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n\n * WARNING: This function may run out of gas on large sets: use {length} and\n * {get} instead in these cases.\n */\n function enumerate(AddressSet storage set)\n internal\n view\n returns (address[] memory)\n {\n address[] memory output = new address[](set.values.length);\n for (uint256 i; i < set.values.length; i++){\n output[i] = set.values[i];\n }\n return output;\n }\n\n /**\n * @dev Returns the number of elements on the set. O(1).\n */\n function length(AddressSet storage set)\n internal\n view\n returns (uint256)\n {\n return set.values.length;\n }\n\n /** @dev Returns the element stored at position `index` in the set. O(1).\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function get(AddressSet storage set, uint256 index)\n internal\n view\n returns (address)\n {\n return set.values[index];\n }\n}\n", "sourcePath": "@openzeppelin/contracts/utils/EnumerableSet.sol", "ast": { "absolutePath": "@openzeppelin/contracts/utils/EnumerableSet.sol", "exportedSymbols": { "EnumerableSet": [ 38062 ] }, "id": 38063, "nodeType": "SourceUnit", "nodes": [ { "id": 37849, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:155" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@dev Library for managing\nhttps://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\ntypes.\n * Sets have the following properties:\n * - Elements are added, removed, and checked for existence in constant time\n(O(1)).\n- Elements are enumerated in O(n). No guarantees are made on the ordering.\n * As of v2.5.0, only `address` sets are supported.\n * Include with `using EnumerableSet for EnumerableSet.AddressSet;`.\n * _Available since v2.5.0._\n * @author Alberto Cuesta Cañada", "fullyImplemented": true, "id": 38062, "linearizedBaseContracts": [ 38062 ], "name": "EnumerableSet", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "EnumerableSet.AddressSet", "id": 37857, "members": [ { "constant": false, "id": 37853, "name": "index", "nodeType": "VariableDeclaration", "scope": 37857, "src": "736:34:155", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 37852, "keyType": { "id": 37850, "name": "address", "nodeType": "ElementaryTypeName", "src": "745:7:155", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "736:28:155", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 37851, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "756:7:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 37856, "name": "values", "nodeType": "VariableDeclaration", "scope": 37857, "src": "780:16:155", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", "typeString": "address[]" }, "typeName": { "baseType": { "id": 37854, "name": "address", "nodeType": "ElementaryTypeName", "src": "780:7:155", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 37855, "length": null, "nodeType": "ArrayTypeName", "src": "780:9:155", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", "typeString": "address[]" } }, "value": null, "visibility": "internal" } ], "name": "AddressSet", "nodeType": "StructDefinition", "scope": 38062, "src": "585:218:155", "visibility": "public" }, { "body": { "id": 37890, "nodeType": "Block", "src": "1019:176:155", "statements": [ { "condition": { "argumentTypes": null, "id": 37870, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "1033:21:155", "subExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 37867, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37859, "src": "1043:3:155", "typeDescriptions": { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet storage pointer" } }, { "argumentTypes": null, "id": 37868, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37861, "src": "1048:5:155", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet storage pointer" }, { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 37866, "name": "contains", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37989, "src": "1034:8:155", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_AddressSet_$37857_storage_ptr_$_t_address_$returns$_t_bool_$", "typeString": "function (struct EnumerableSet.AddressSet storage pointer,address) view returns (bool)" } }, "id": 37869, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1034:20:155", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 37888, "nodeType": "Block", "src": "1152:37:155", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 37886, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1173:5:155", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 37865, "id": 37887, "nodeType": "Return", "src": "1166:12:155" } ] }, "id": 37889, "nodeType": "IfStatement", "src": "1029:160:155", "trueBody": { "id": 37885, "nodeType": "Block", "src": "1055:91:155", "statements": [ { "expression": { "argumentTypes": null, "id": 37881, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 37871, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37859, "src": "1069:3:155", "typeDescriptions": { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet storage pointer" } }, "id": 37874, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "index", "nodeType": "MemberAccess", "referencedDeclaration": 37853, "src": "1069:9:155", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 37875, "indexExpression": { "argumentTypes": null, "id": 37873, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37861, "src": "1079:5:155", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1069:16:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 37879, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37861, "src": "1104:5:155", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 37876, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37859, "src": "1088:3:155", "typeDescriptions": { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet storage pointer" } }, "id": 37877, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "values", "nodeType": "MemberAccess", "referencedDeclaration": 37856, "src": "1088:10:155", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage", "typeString": "address[] storage ref" } }, "id": 37878, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "push", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1088:15:155", "typeDescriptions": { "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", "typeString": "function (address) returns (uint256)" } }, "id": 37880, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1088:22:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1069:41:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 37882, "nodeType": "ExpressionStatement", "src": "1069:41:155" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", "id": 37883, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1131:4:155", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "functionReturnParameters": 37865, "id": 37884, "nodeType": "Return", "src": "1124:11:155" } ] } } ] }, "documentation": "@dev Add a value to a set. O(1).\nReturns false if the value was already in the set.", "id": 37891, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 37862, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 37859, "name": "set", "nodeType": "VariableDeclaration", "scope": 37891, "src": "936:22:155", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet" }, "typeName": { "contractScope": null, "id": 37858, "name": "AddressSet", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 37857, "src": "936:10:155", "typeDescriptions": { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 37861, "name": "value", "nodeType": "VariableDeclaration", "scope": 37891, "src": "960:13:155", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 37860, "name": "address", "nodeType": "ElementaryTypeName", "src": "960:7:155", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "935:39:155" }, "returnParameters": { "id": 37865, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 37864, "name": "", "nodeType": "VariableDeclaration", "scope": 37891, "src": "1009:4:155", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 37863, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1009:4:155", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "1008:6:155" }, "scope": 38062, "src": "923:272:155", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 37971, "nodeType": "Block", "src": "1424:920:155", "statements": [ { "condition": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 37901, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37893, "src": "1447:3:155", "typeDescriptions": { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet storage pointer" } }, { "argumentTypes": null, "id": 37902, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37895, "src": "1452:5:155", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet storage pointer" }, { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 37900, "name": "contains", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37989, "src": "1438:8:155", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_AddressSet_$37857_storage_ptr_$_t_address_$returns$_t_bool_$", "typeString": "function (struct EnumerableSet.AddressSet storage pointer,address) view returns (bool)" } }, "id": 37903, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1438:20:155", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 37969, "nodeType": "Block", "src": "2301:37:155", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 37967, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2322:5:155", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 37899, "id": 37968, "nodeType": "Return", "src": "2315:12:155" } ] }, "id": 37970, "nodeType": "IfStatement", "src": "1434:904:155", "trueBody": { "id": 37966, "nodeType": "Block", "src": "1459:836:155", "statements": [ { "assignments": [ 37905 ], "declarations": [ { "constant": false, "id": 37905, "name": "toDeleteIndex", "nodeType": "VariableDeclaration", "scope": 37966, "src": "1473:21:155", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 37904, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1473:7:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 37912, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 37911, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 37906, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37893, "src": "1497:3:155", "typeDescriptions": { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet storage pointer" } }, "id": 37907, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "index", "nodeType": "MemberAccess", "referencedDeclaration": 37853, "src": "1497:9:155", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 37909, "indexExpression": { "argumentTypes": null, "id": 37908, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37895, "src": "1507:5:155", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "1497:16:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 37910, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1516:1:155", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1497:20:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1473:44:155" }, { "assignments": [ 37914 ], "declarations": [ { "constant": false, "id": 37914, "name": "lastIndex", "nodeType": "VariableDeclaration", "scope": 37966, "src": "1531:17:155", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 37913, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1531:7:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 37920, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 37919, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 37915, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37893, "src": "1551:3:155", "typeDescriptions": { "typeIdentifier": "t_struct$_AddressSet_$37857_storage_ptr", "typeString": "struct EnumerableSet.AddressSet storage pointer" } }, "id": 37916, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "values", "nodeType": "MemberAccess", "referencedDeclaration": 37856, "src": "1551:10:155", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage", "typeString": "address[] storage ref" } }, "id": 37917, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1551:17:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 37918, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1571:1:155", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1551:21:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1531:41:155" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 37923, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 37921, "name": "lastIndex", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37914, "src": "1696:9:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "id": 37922, "name": "toDeleteIndex", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37905, "src": "1709:13:155", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1696:26:155", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 37950, "nodeType": "IfStatement", "src": "1692:382:155", "trueBody": { "id": 37949, "nodeType": "Block", "src": "1724:350:155", "statements": [ { "assignments": [ 37925 ], "declarations": [ { "constant": false, "id": 37925, "name": "lastValue", "nodeType": "VariableDeclaration", "scope": 37949, "src": "1742:17:155", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 37924, "name": "address", "nodeType": "ElementaryTypeName", "src": "1742:7:155", "stateMutability": "nonpayable", "typeDescrip