UNPKG

@vporton/future-contracts

Version:

Ethereum accounts bid on future financing (essentially, transfer money from the future) - smart contracts

914 lines 513 kB
{ "contractName": "EnumerableSet", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"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\":1000000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"keccak256\":\"0xae0992eb1ec30fd1ecdf2e04a6036decfc9797bf11dc1ec84b546b74318d5ec2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3b61f99a64e999682ad7bfbb3a1c762a20a0a5b30f9f2011693fa857969af61f\",\"dweb:/ipfs/QmZystFY76wkWCf7V3yKh3buZuKVKbswiE7y6yU62kk3zi\"]}},\"version\":1}", "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212205ee0e7b82594236d819f23d5f92a013aeac048b8742b69c45d9411f4676515e164736f6c63430007060033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212205ee0e7b82594236d819f23d5f92a013aeac048b8742b69c45d9411f4676515e164736f6c63430007060033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "753:8598:36:-:0;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "753:8598:36:-: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(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(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(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(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": [ 7756 ] }, "id": 7757, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 7278, "literals": [ "solidity", ">=", "0.6", ".0", "<", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "33:31:36" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 7279, "nodeType": "StructuredDocumentation", "src": "66:686:36", "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": 7756, "linearizedBaseContracts": [ 7756 ], "name": "EnumerableSet", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "EnumerableSet.Set", "id": 7287, "members": [ { "constant": false, "id": 7282, "mutability": "mutable", "name": "_values", "nodeType": "VariableDeclaration", "scope": 7287, "src": "1275:17:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" }, "typeName": { "baseType": { "id": 7280, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1275:7:36", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 7281, "nodeType": "ArrayTypeName", "src": "1275:9:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" } }, "visibility": "internal" }, { "constant": false, "id": 7286, "mutability": "mutable", "name": "_indexes", "nodeType": "VariableDeclaration", "scope": 7287, "src": "1426:37:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "typeName": { "id": 7285, "keyType": { "id": 7283, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1435:7:36", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "1426:28:36", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "valueType": { "id": 7284, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1446:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "visibility": "internal" } ], "name": "Set", "nodeType": "StructDefinition", "scope": 7756, "src": "1221:249:36", "visibility": "public" }, { "body": { "id": 7327, "nodeType": "Block", "src": "1709:335:36", "statements": [ { "condition": { "id": 7301, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "1723:22:36", "subExpression": { "arguments": [ { "id": 7298, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7290, "src": "1734:3:36", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$7287_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, { "id": 7299, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7292, "src": "1739:5:36", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_struct$_Set_$7287_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 7297, "name": "_contains", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7426, "src": "1724:9:36", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_Set_$7287_storage_ptr_$_t_bytes32_$returns$_t_bool_$", "typeString": "function (struct EnumerableSet.Set storage pointer,bytes32) view returns (bool)" } }, "id": 7300, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1724:21:36", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 7325, "nodeType": "Block", "src": "2001:37:36", "statements": [ { "expression": { "hexValue": "66616c7365", "id": 7323, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2022:5:36", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 7296, "id": 7324, "nodeType": "Return", "src": "2015:12:36" } ] }, "id": 7326, "nodeType": "IfStatement", "src": "1719:319:36", "trueBody": { "id": 7322, "nodeType": "Block", "src": "1747:248:36", "statements": [ { "expression": { "arguments": [ { "id": 7307, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7292, "src": "1778:5:36", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "expression": { "id": 7302, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7290, "src": "1761:3:36", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$7287_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, "id": 7305, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "_values", "nodeType": "MemberAccess", "referencedDeclaration": 7282, "src": "1761:11:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", "typeString": "bytes32[] storage ref" } }, "id": 7306, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "push", "nodeType": "MemberAccess", "src": "1761:16:36", "typeDescriptions": { "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, "id": 7308, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1761:23:36", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 7309, "nodeType": "ExpressionStatement", "src": "1761:23:36" }, { "expression": { "id": 7318, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "expression": { "id": 7310, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7290, "src": "1919:3:36", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$7287_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, "id": 7313, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "_indexes", "nodeType": "MemberAccess", "referencedDeclaration": 7286, "src": "1919:12:36", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" } }, "id": 7314, "indexExpression": { "id": 7312, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7292, "src": "1932:5:36", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1919:19:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "expression": { "expression": { "id": 7315, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7290, "src": "1941:3:36", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$7287_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, "id": 7316, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "_values", "nodeType": "MemberAccess", "referencedDeclaration": 7282, "src": "1941:11:36", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", "typeString": "bytes32[] storage ref" } }, "id": 7317, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "src": "1941:18:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1919:40:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 7319, "nodeType": "ExpressionStatement", "src": "1919:40:36" }, { "expression": { "hexValue": "74727565", "id": 7320, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1980:4:36", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "functionReturnParameters": 7296, "id": 7321, "nodeType": "Return", "src": "1973:11:36" } ] } } ] }, "documentation": { "id": 7288, "nodeType": "StructuredDocumentation", "src": "1476:159:36", "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": 7328, "implemented": true, "kind": "function", "modifiers": [], "name": "_add", "nodeType": "FunctionDefinition", "parameters": { "id": 7293, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7290, "mutability": "mutable", "name": "set", "nodeType": "VariableDeclaration", "scope": 7328, "src": "1654:15:36", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$7287_storage_ptr", "typeString": "struct EnumerableSet.Set" }, "typeName": { "id": 7289, "name": "Set", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 7287, "src": "1654:3:36", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$7287_storage_ptr", "typeString": "struct EnumerableSet.Set" } }, "visibility": "internal" }, { "constant": false, "id": 7292, "mutability": "mutable", "name": "value", "nodeType": "VariableDeclaration", "scope": 7328, "src": "1671:13:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 7291, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1671:7:36", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" } ], "src": "1653:32:36" }, "returnParameters": { "id": 7296, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7295, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 7328, "src": "1703:4:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 7294, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1703:4:36", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "1702:6:36" }, "scope": 7756, "src": "1640:404:36", "stateMutability": "nonpayable", "virtual": false, "visibility": "private" }, { "body": { "id": 7407, "nodeType": "Block", "src": "2284:1440:36", "statements": [ { "assignments": [ 7339 ], "declarations": [ { "constant": false, "id": 7339, "mutability": "mutable", "name": "valueIndex", "nodeType": "VariableDeclaration", "scope": 7407, "src": "2394:18:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7338, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2394:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 7344, "initialValue": { "baseExpression": { "expression": { "id": 7340, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7331, "src": "2415:3:36", "typeDescriptions": { "typeIdentifier": "t_struct$_Set_$7287_storage_ptr", "typeString": "struct EnumerableSet.Set storage pointer" } }, "id": 7341, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "_indexes", "nodeType": "MemberAccess", "referencedDeclaration": 7286, "src": "2415:12:36", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" } }, "id": 7343, "indexExpression": { "id": 7342, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7333, "src": "2428:5:36", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "2415:19:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "2394:40:36" }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 7347, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 7345, "name": "valueIndex", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7339, "src": "2449:10:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "hexValue": "30", "id": 7346, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2463:1:36", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "2449:15:36", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 7405, "nodeType": "Block", "src": "3681:37:36", "statements": [ { "expression": { "hexValue": "66616c7365", "id": 7403, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "3702:5:36", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 7337, "id": 7404, "nodeType": "Return", "src": "3695:12:36" } ] }, "id": 7406, "nodeType": "IfStatement", "src": "2445:1273:36", "trueBody": { "id": 7402, "nodeType": "Block", "src": "2466:1209:36", "statements": [ { "assignments": [ 7349 ], "declarations": [ { "constant": false, "id": 7349, "mutability": "mutable", "name": "toDeleteIndex", "nodeType": "VariableDeclaration", "scope": 7402, "src": "2806:21:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7348, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2806:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 7353, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 7352, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 7350, "name": "valueIndex", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7339, "src": "2830:10:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "hexValue": "31", "id": 7351, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2843:1:36", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "2830:14:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "2806:38:36" }, { "assignments": [ 7355 ], "declarations": [ { "constant": false, "id": 7355, "mutability": "mutable", "name": "lastIndex", "nodeType": "VariableDeclaration", "scope": 7402, "src": "2858:17:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7354, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2858:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 7361, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 7360, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "expression": { "id": 7356, "name": "set", "nodeType": "Identifier", "overloadedDeclarations": [], "referen