@vporton/future-contracts
Version:
Ethereum accounts bid on future financing (essentially, transfer money from the future) - smart contracts
907 lines (906 loc) • 509 kB
JSON
{
"contractName": "EnumerableMap",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Library for managing an enumerable variant of Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] type. Maps have the following properties: - Entries are added, removed, and checked for existence in constant time (O(1)). - Entries are enumerated in O(n). No guarantees are made on the ordering. ``` contract Example { // Add the library methods using EnumerableMap for EnumerableMap.UintToAddressMap; // Declare a set state variable EnumerableMap.UintToAddressMap private myMap; } ``` As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are supported.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/EnumerableMap.sol\":\"EnumerableMap\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/EnumerableMap.sol\":{\"keccak256\":\"0xf6bdf22fe038e5310b6f0372ecd01f221e2c0b248b45efc404542d94fcac9133\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6e798f3492180627d6616fa94925b61a9f105347eed9e895f3e18a0eb3dfcd3d\",\"dweb:/ipfs/QmQcTro5nv3Lopf4c4rEe1BuykCfPsjRsJmysdNXtHNUdt\"]}},\"version\":1}",
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c3de050bb9cc951aea53594d94bb81e0b38fd96b919a5b21fa07e0370dab9db364736f6c63430007060033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c3de050bb9cc951aea53594d94bb81e0b38fd96b919a5b21fa07e0370dab9db364736f6c63430007060033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "772:7555:35:-:0;;;;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "772:7555:35:-:0;;;;;;;;",
"source": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Library for managing an enumerable variant of Solidity's\n * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]\n * type.\n *\n * Maps have the following properties:\n *\n * - Entries are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Entries are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableMap for EnumerableMap.UintToAddressMap;\n *\n * // Declare a set state variable\n * EnumerableMap.UintToAddressMap private myMap;\n * }\n * ```\n *\n * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are\n * supported.\n */\nlibrary EnumerableMap {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Map type with\n // bytes32 keys and values.\n // The Map implementation uses private functions, and user-facing\n // implementations (such as Uint256ToAddressMap) are just wrappers around\n // the underlying Map.\n // This means that we can only create new EnumerableMaps for types that fit\n // in bytes32.\n\n struct MapEntry {\n bytes32 _key;\n bytes32 _value;\n }\n\n struct Map {\n // Storage of map keys and values\n MapEntry[] _entries;\n\n // Position of the entry defined by a key in the `entries` array, plus 1\n // because index 0 means a key is not in the map.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Adds a key-value pair to a map, or updates the value for an existing\n * key. O(1).\n *\n * Returns true if the key was added to the map, that is if it was not\n * already present.\n */\n function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {\n // We read and store the key's index to prevent multiple reads from the same storage slot\n uint256 keyIndex = map._indexes[key];\n\n if (keyIndex == 0) { // Equivalent to !contains(map, key)\n map._entries.push(MapEntry({ _key: key, _value: value }));\n // The entry is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n map._indexes[key] = map._entries.length;\n return true;\n } else {\n map._entries[keyIndex - 1]._value = value;\n return false;\n }\n }\n\n /**\n * @dev Removes a key-value pair from a map. O(1).\n *\n * Returns true if the key was removed from the map, that is if it was present.\n */\n function _remove(Map storage map, bytes32 key) private returns (bool) {\n // We read and store the key's index to prevent multiple reads from the same storage slot\n uint256 keyIndex = map._indexes[key];\n\n if (keyIndex != 0) { // Equivalent to contains(map, key)\n // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one\n // in the array, and then remove the last entry (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = keyIndex - 1;\n uint256 lastIndex = map._entries.length - 1;\n\n // When the entry 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 MapEntry storage lastEntry = map._entries[lastIndex];\n\n // Move the last entry to the index where the entry to delete is\n map._entries[toDeleteIndex] = lastEntry;\n // Update the index for the moved entry\n map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved entry was stored\n map._entries.pop();\n\n // Delete the index for the deleted slot\n delete map._indexes[key];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the key is in the map. O(1).\n */\n function _contains(Map storage map, bytes32 key) private view returns (bool) {\n return map._indexes[key] != 0;\n }\n\n /**\n * @dev Returns the number of key-value pairs in the map. O(1).\n */\n function _length(Map storage map) private view returns (uint256) {\n return map._entries.length;\n }\n\n /**\n * @dev Returns the key-value pair stored at position `index` in the map. O(1).\n *\n * Note that there are no guarantees on the ordering of entries inside the\n * array, and it may change when more entries are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {\n require(map._entries.length > index, \"EnumerableMap: index out of bounds\");\n\n MapEntry storage entry = map._entries[index];\n return (entry._key, entry._value);\n }\n\n /**\n * @dev Returns the value associated with `key`. O(1).\n *\n * Requirements:\n *\n * - `key` must be in the map.\n */\n function _get(Map storage map, bytes32 key) private view returns (bytes32) {\n return _get(map, key, \"EnumerableMap: nonexistent key\");\n }\n\n /**\n * @dev Same as {_get}, with a custom error message when `key` is not in the map.\n */\n function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {\n uint256 keyIndex = map._indexes[key];\n require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)\n return map._entries[keyIndex - 1]._value; // All indexes are 1-based\n }\n\n // UintToAddressMap\n\n struct UintToAddressMap {\n Map _inner;\n }\n\n /**\n * @dev Adds a key-value pair to a map, or updates the value for an existing\n * key. O(1).\n *\n * Returns true if the key was added to the map, that is if it was not\n * already present.\n */\n function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {\n return _set(map._inner, bytes32(key), bytes32(uint256(value)));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the key was removed from the map, that is if it was present.\n */\n function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {\n return _remove(map._inner, bytes32(key));\n }\n\n /**\n * @dev Returns true if the key is in the map. O(1).\n */\n function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {\n return _contains(map._inner, bytes32(key));\n }\n\n /**\n * @dev Returns the number of elements in the map. O(1).\n */\n function length(UintToAddressMap storage map) internal view returns (uint256) {\n return _length(map._inner);\n }\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 at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {\n (bytes32 key, bytes32 value) = _at(map._inner, index);\n return (uint256(key), address(uint256(value)));\n }\n\n /**\n * @dev Returns the value associated with `key`. O(1).\n *\n * Requirements:\n *\n * - `key` must be in the map.\n */\n function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {\n return address(uint256(_get(map._inner, bytes32(key))));\n }\n\n /**\n * @dev Same as {get}, with a custom error message when `key` is not in the map.\n */\n function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {\n return address(uint256(_get(map._inner, bytes32(key), errorMessage)));\n }\n}\n",
"sourcePath": "@openzeppelin/contracts/utils/EnumerableMap.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/utils/EnumerableMap.sol",
"exportedSymbols": {
"EnumerableMap": [
7276
]
},
"id": 7277,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6823,
"literals": [
"solidity",
">=",
"0.6",
".0",
"<",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:31:35"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 6824,
"nodeType": "StructuredDocumentation",
"src": "66:705:35",
"text": " @dev Library for managing an enumerable variant of Solidity's\n https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]\n type.\n Maps have the following properties:\n - Entries are added, removed, and checked for existence in constant time\n (O(1)).\n - Entries are enumerated in O(n). No guarantees are made on the ordering.\n ```\n contract Example {\n // Add the library methods\n using EnumerableMap for EnumerableMap.UintToAddressMap;\n // Declare a set state variable\n EnumerableMap.UintToAddressMap private myMap;\n }\n ```\n As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are\n supported."
},
"fullyImplemented": true,
"id": 7276,
"linearizedBaseContracts": [
7276
],
"name": "EnumerableMap",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "EnumerableMap.MapEntry",
"id": 6829,
"members": [
{
"constant": false,
"id": 6826,
"mutability": "mutable",
"name": "_key",
"nodeType": "VariableDeclaration",
"scope": 6829,
"src": "1284:12:35",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6825,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1284:7:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6828,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 6829,
"src": "1306:14:35",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6827,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1306:7:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"name": "MapEntry",
"nodeType": "StructDefinition",
"scope": 7276,
"src": "1258:69:35",
"visibility": "public"
},
{
"canonicalName": "EnumerableMap.Map",
"id": 6837,
"members": [
{
"constant": false,
"id": 6832,
"mutability": "mutable",
"name": "_entries",
"nodeType": "VariableDeclaration",
"scope": 6837,
"src": "1396:19:35",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_MapEntry_$6829_storage_$dyn_storage_ptr",
"typeString": "struct EnumerableMap.MapEntry[]"
},
"typeName": {
"baseType": {
"id": 6830,
"name": "MapEntry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6829,
"src": "1396:8:35",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MapEntry_$6829_storage_ptr",
"typeString": "struct EnumerableMap.MapEntry"
}
},
"id": 6831,
"nodeType": "ArrayTypeName",
"src": "1396:10:35",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_MapEntry_$6829_storage_$dyn_storage_ptr",
"typeString": "struct EnumerableMap.MapEntry[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6836,
"mutability": "mutable",
"name": "_indexes",
"nodeType": "VariableDeclaration",
"scope": 6837,
"src": "1565:37:35",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
"typeString": "mapping(bytes32 => uint256)"
},
"typeName": {
"id": 6835,
"keyType": {
"id": 6833,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1574:7:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Mapping",
"src": "1565:28:35",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
"typeString": "mapping(bytes32 => uint256)"
},
"valueType": {
"id": 6834,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1585:7:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"visibility": "internal"
}
],
"name": "Map",
"nodeType": "StructDefinition",
"scope": 7276,
"src": "1333:276:35",
"visibility": "public"
},
{
"body": {
"id": 6898,
"nodeType": "Block",
"src": "1918:596:35",
"statements": [
{
"assignments": [
6850
],
"declarations": [
{
"constant": false,
"id": 6850,
"mutability": "mutable",
"name": "keyIndex",
"nodeType": "VariableDeclaration",
"scope": 6898,
"src": "2026:16:35",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6849,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2026:7:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 6855,
"initialValue": {
"baseExpression": {
"expression": {
"id": 6851,
"name": "map",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6840,
"src": "2045:3:35",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Map_$6837_storage_ptr",
"typeString": "struct EnumerableMap.Map storage pointer"
}
},
"id": 6852,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_indexes",
"nodeType": "MemberAccess",
"referencedDeclaration": 6836,
"src": "2045:12:35",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
"typeString": "mapping(bytes32 => uint256)"
}
},
"id": 6854,
"indexExpression": {
"id": 6853,
"name": "key",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6842,
"src": "2058:3:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2045:17:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2026:36:35"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6858,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 6856,
"name": "keyIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6850,
"src": "2077:8:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "30",
"id": 6857,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2089:1:35",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2077:13:35",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 6896,
"nodeType": "Block",
"src": "2416:92:35",
"statements": [
{
"expression": {
"id": 6892,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"expression": {
"baseExpression": {
"expression": {
"id": 6883,
"name": "map",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6840,
"src": "2430:3:35",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Map_$6837_storage_ptr",
"typeString": "struct EnumerableMap.Map storage pointer"
}
},
"id": 6888,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_entries",
"nodeType": "MemberAccess",
"referencedDeclaration": 6832,
"src": "2430:12:35",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_MapEntry_$6829_storage_$dyn_storage",
"typeString": "struct EnumerableMap.MapEntry storage ref[] storage ref"
}
},
"id": 6889,
"indexExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6887,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 6885,
"name": "keyIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6850,
"src": "2443:8:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"hexValue": "31",
"id": 6886,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2454:1:35",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2443:12:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2430:26:35",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MapEntry_$6829_storage",
"typeString": "struct EnumerableMap.MapEntry storage ref"
}
},
"id": 6890,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "_value",
"nodeType": "MemberAccess",
"referencedDeclaration": 6828,
"src": "2430:33:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 6891,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6844,
"src": "2466:5:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "2430:41:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 6893,
"nodeType": "ExpressionStatement",
"src": "2430:41:35"
},
{
"expression": {
"hexValue": "66616c7365",
"id": 6894,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2492:5:35",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"functionReturnParameters": 6848,
"id": 6895,
"nodeType": "Return",
"src": "2485:12:35"
}
]
},
"id": 6897,
"nodeType": "IfStatement",
"src": "2073:435:35",
"trueBody": {
"id": 6882,
"nodeType": "Block",
"src": "2092:318:35",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"id": 6865,
"name": "key",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6842,
"src": "2178:3:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"id": 6866,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6844,
"src": "2191:5:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 6864,
"name": "MapEntry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6829,
"src": "2161:8:35",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_MapEntry_$6829_storage_ptr_$",
"typeString": "type(struct EnumerableMap.MapEntry storage pointer)"
}
},
"id": 6867,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"_key",
"_value"
],
"nodeType": "FunctionCall",
"src": "2161:38:35",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_MapEntry_$6829_memory_ptr",
"typeString": "struct EnumerableMap.MapEntry memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_struct$_MapEntry_$6829_memory_ptr",
"typeString": "struct EnumerableMap.MapEntry memory"
}
],
"expression": {
"expression": {
"id": 6859,
"name": "map",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6840,
"src": "2143:3:35",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Map_$6837_storage_ptr",
"typeString": "struct EnumerableMap.Map storage pointer"
}
},
"id": 6862,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_entries",
"nodeType": "MemberAccess",
"referencedDeclaration": 6832,
"src": "2143:12:35",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_MapEntry_$6829_storage_$dyn_storage",
"typeString": "struct EnumerableMap.MapEntry storage ref[] storage ref"
}
},
"id": 6863,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"src": "2143:17:35",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_struct$_MapEntry_$6829_storage_$returns$__$",
"typeString": "function (struct EnumerableMap.MapEntry storage ref)"
}
},
"id": 6868,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2143:57:35",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6869,
"nodeType": "ExpressionStatement",
"src": "2143:57:35"
},
{
"expression": {
"id": 6878,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"expression": {
"id": 6870,
"name": "map",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6840,
"src": "2335:3:35",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Map_$6837_storage_ptr",
"typeString": "struct EnumerableMap.Map storage pointer"
}
},
"id": 6873,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_indexes",
"nodeType": "MemberAccess",
"referencedDeclaration": 6836,
"src": "2335:12:35",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
"typeString": "mapping(bytes32 => uint256)"
}
},
"id": 6874,
"indexExpression": {
"id": 6872,
"name": "key",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6842,
"src": "2348:3:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2335:17:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"expression": {
"expression": {
"id": 6875,
"name": "map",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6840,
"src": "2355:3:35",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Map_$6837_storage_ptr",
"typeString": "struct EnumerableMap.Map storage pointer"
}
},
"id": 6876,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_entries",
"nodeType": "MemberAccess",
"referencedDeclaration": 6832,
"src": "2355:12:35",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_MapEntry_$6829_storage_$dyn_storage",
"typeString": "struct EnumerableMap.MapEntry storage ref[] storage ref"
}
},
"id": 6877,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"src": "2355:19:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2335:39:35",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 6879,
"nodeType": "ExpressionStatement",
"src": "2335:39:35"
},
{
"expression": {
"hexValue": "74727565",
"id": 6880,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2395:4:35",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"functionReturnParameters": 6848,
"id": 6881,
"nodeType": "Return",
"src": "2388:11:35"
}
]
}
}
]
},
"documentation": {
"id": 6838,
"nodeType": "StructuredDocumentation",
"src": "1615:216:35",
"text": " @dev Adds a key-value pair to a map, or updates the value for an existing\n key. O(1).\n Returns true if the key was added to the map, that is if it was not\n already present."
},
"id": 6899,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_set",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6845,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6840,
"mutability": "mutable",
"name": "map",
"nodeType": "VariableDeclaration",
"scope": 6899,
"src": "1850:15:35",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Map_$6837_storage_ptr",
"typeString": "struct EnumerableMap.Map"
},
"typeName": {
"id": 6839,
"name": "Map",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6837,
"src": "1850:3:35",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Map_$6837_storage_ptr",
"typeString": "struct EnumerableMap.Map"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6842,
"mutability": "mutable",
"name": "key",
"nodeType": "VariableDeclaration",
"scope": 6899,
"src": "1867:11:35",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6841,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1867:7:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6844,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 6899,
"src": "1880:13:35",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6843,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1880:7:35",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"src": "1849:45:35"
},
"returnParameters": {
"id": 6848,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6847,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",