UNPKG

@ethsub/sol

Version:
912 lines 567 kB
{ "contractName": "EnumerableSet", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"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. ``` contract Example { // Add the library methods using EnumerableSet for EnumerableSet.AddressSet; // Declare a set state variable EnumerableSet.AddressSet private mySet; } ``` As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) and `uint256` (`UintSet`) are supported.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/EnumerableSet.sol\":\"EnumerableSet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4580d57781513d98870d9738c7d39094336e0a70cdb90d68dad549c6ced466ec\",\"dweb:/ipfs/Qmf9YZzzRFuvMnav9dgmeRUpdYMMECiZX8w25sHWVbA18V\"]}},\"version\":1}", "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220891a4d13d235b4848b426ddc7df9c0545fcd7927a94773117eb543b51a1c0b0364736f6c634300060c0033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220891a4d13d235b4848b426ddc7df9c0545fcd7927a94773117eb543b51a1c0b0364736f6c634300060c0033", "immutableReferences": {}, "sourceMap": "753:8634:31:-:0;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "753:8634:31:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.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 * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\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 (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\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(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\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 * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\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 * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\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) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\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 * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\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 * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n", "sourcePath": "@openzeppelin/contracts/utils/EnumerableSet.sol", "ast": { "absolutePath": "@openzeppelin/contracts/utils/EnumerableSet.sol", "exportedSymbols": { "EnumerableSet": [ 5943 ] }, "id": 5944, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 5453, "literals": [ "solidity", ">=", "0.6", ".0", "<", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "33:31:31" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 5454, "nodeType": "StructuredDocumentation", "src": "66:686:31", "text": " @dev Library for managing\n https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n types.\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 ```\n contract Example {\n // Add the library methods\n using EnumerableSet for EnumerableSet.AddressSet;\n // Declare a set state variable\n EnumerableSet.AddressSet private mySet;\n }\n ```\n As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n and `uint256` (`UintSet`) are supported." }, "fullyImplemented": true, "id": 5943, "linearizedBaseContracts": [ 5943 ], "name": "EnumerableSet", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "EnumerableSet.Set", "id": 5462, "members": [ { "constant": false, "id": 5457, "mutability": "mutable", "name": "_values", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5462, "src": "1275:17:31", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" }, "typeName": { "baseType": { "id": 5455, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1275:7:31", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 5456, "length": null, "nodeType": "ArrayTypeName", "src": "1275:9:31", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5461, "mutability": "mutable", "name": "_indexes", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5462, "src": "1426:37:31", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "typeName": { "id": 5460, "keyType": { "id": 5458, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1435:7:31", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "1426:28:31", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "valueType": { "id": 5459, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1446:7:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "internal" } ], "name": "Set", "nodeType": "StructDefinition", "scope": 5943, "src": "1221:249:31", "visibility": "public" }, { "body": { "id": 5502, "nodeType": "Block", "src": "1709:335:31", "statements": [ { "condition": { "argumentTypes": null, "id": 5476, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "1723:22:31", "subExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5473, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5465, "src": "1734:3:31", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$5462_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, { "argumentTypes": null, "id": 5474, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5467, "src": "1739:5:31", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_struct$_Set_$5462_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 5472, "name": "_contains", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5601, "src": "1724:9:31", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_Set_$5462_storage_ptr_$_t_bytes32_$returns$_t_bool_$", "typeString": "function (struct EnumerableSet.Set storage pointer,bytes32) view returns (bool)" } }, "id": 5475, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1724:21:31", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 5500, "nodeType": "Block", "src": "2001:37:31", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 5498, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2022:5:31", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 5471, "id": 5499, "nodeType": "Return", "src": "2015:12:31" } ] }, "id": 5501, "nodeType": "IfStatement", "src": "1719:319:31", "trueBody": { "id": 5497, "nodeType": "Block", "src": "1747:248:31", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5482, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5467, "src": "1778:5:31", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 5477, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5465, "src": "1761:3:31", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$5462_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, "id": 5480, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "_values", "nodeType": "MemberAccess", "referencedDeclaration": 5457, "src": "1761:11:31", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", "typeString": "bytes32[] storage ref" } }, "id": 5481, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "push", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1761:16:31", "typeDescriptions": { "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, "id": 5483, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1761:23:31", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5484, "nodeType": "ExpressionStatement", "src": "1761:23:31" }, { "expression": { "argumentTypes": null, "id": 5493, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 5485, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5465, "src": "1919:3:31", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$5462_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, "id": 5488, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "_indexes", "nodeType": "MemberAccess", "referencedDeclaration": 5461, "src": "1919:12:31", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" } }, "id": 5489, "indexExpression": { "argumentTypes": null, "id": 5487, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5467, "src": "1932:5:31", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1919:19:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 5490, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5465, "src": "1941:3:31", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$5462_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, "id": 5491, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "_values", "nodeType": "MemberAccess", "referencedDeclaration": 5457, "src": "1941:11:31", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", "typeString": "bytes32[] storage ref" } }, "id": 5492, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1941:18:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1919:40:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5494, "nodeType": "ExpressionStatement", "src": "1919:40:31" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", "id": 5495, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1980:4:31", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "functionReturnParameters": 5471, "id": 5496, "nodeType": "Return", "src": "1973:11:31" } ] } } ] }, "documentation": { "id": 5463, "nodeType": "StructuredDocumentation", "src": "1476:159:31", "text": " @dev Add a value to a set. O(1).\n Returns true if the value was added to the set, that is if it was not\n already present." }, "id": 5503, "implemented": true, "kind": "function", "modifiers": [], "name": "_add", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 5468, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5465, "mutability": "mutable", "name": "set", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5503, "src": "1654:15:31", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$5462_storage_ptr", "typeString": "struct EnumerableSet.Set" }, "typeName": { "contractScope": null, "id": 5464, "name": "Set", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5462, "src": "1654:3:31", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$5462_storage_ptr", "typeString": "struct EnumerableSet.Set" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5467, "mutability": "mutable", "name": "value", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5503, "src": "1671:13:31", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5466, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1671:7:31", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "1653:32:31" }, "returnParameters": { "id": 5471, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5470, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5503, "src": "1703:4:31", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 5469, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1703:4:31", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "1702:6:31" }, "scope": 5943, "src": "1640:404:31", "stateMutability": "nonpayable", "virtual": false, "visibility": "private" }, { "body": { "id": 5582, "nodeType": "Block", "src": "2284:1440:31", "statements": [ { "assignments": [ 5514 ], "declarations": [ { "constant": false, "id": 5514, "mutability": "mutable", "name": "valueIndex", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5582, "src": "2394:18:31", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5513, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2394:7:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5519, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 5515, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5506, "src": "2415:3:31", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$5462_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, "id": 5516, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "_indexes", "nodeType": "MemberAccess", "referencedDeclaration": 5461, "src": "2415:12:31", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" } }, "id": 5518, "indexExpression": { "argumentTypes": null, "id": 5517, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5508, "src": "2428:5:31", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "2415:19:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "2394:40:31" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5522, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5520, "name": "valueIndex", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5514, "src": "2449:10:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 5521, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2463:1:31", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "2449:15:31", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 5580, "nodeType": "Block", "src": "3681:37:31", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 5578, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "3702:5:31", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 5512, "id": 5579, "nodeType": "Return", "src": "3695:12:31" } ] }, "id": 5581, "nodeType": "IfStatement", "src": "2445:1273:31", "trueBody": { "id": 5577, "nodeType": "Block", "src": "2466:1209:31", "statements": [ { "assignments": [ 5524 ], "declarations": [ { "constant": false, "id": 5524, "mutability": "mutable", "name": "toDeleteIndex", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5577, "src": "2806:21:31", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5523, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2806:7:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5528, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5527, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5525, "name": "valueIndex", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5514, "src": "2830:10:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 5526, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2843:1:31", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "2830:14:31", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclara