@latticexyz/world-modules 2.0.0-main-e20633d4 → 2.0.0-main-071aadb9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/out/ArrayLib.sol/ArrayLib.json +255 -255
  2. package/out/CallboundDelegationControl.sol/CallboundDelegationControl.json +220 -220
  3. package/out/CallboundDelegations.sol/CallboundDelegations.json +4463 -4463
  4. package/out/DecodeSlice.sol/DecodeSlice.json +3250 -3250
  5. package/out/DelegationControl.sol/DelegationControl.json +98 -98
  6. package/out/EncodeArray.sol/EncodeArray.json +3345 -3345
  7. package/out/FieldLayout.sol/FieldLayoutInstance.json +47 -47
  8. package/out/FieldLayout.sol/FieldLayoutLib.json +47 -47
  9. package/out/Hook.sol/HookInstance.json +13 -13
  10. package/out/Hook.sol/HookLib.json +13 -13
  11. package/out/Hooks.sol/Hooks.json +3186 -3186
  12. package/out/IAccessManagementSystem.sol/IAccessManagementSystem.json +106 -100
  13. package/out/IBalanceTransferSystem.sol/IBalanceTransferSystem.json +98 -92
  14. package/out/IBaseWorld.sol/IBaseWorld.json +79 -79
  15. package/out/IBatchCallSystem.sol/IBatchCallSystem.json +92 -86
  16. package/out/ICoreSystem.sol/ICoreSystem.json +19 -13
  17. package/out/IDelegationControl.sol/IDelegationControl.json +62 -62
  18. package/out/IModule.sol/IModule.json +78 -78
  19. package/out/IModuleInstallationSystem.sol/IModuleInstallationSystem.json +52 -46
  20. package/out/ISystemHook.sol/ISystemHook.json +86 -86
  21. package/out/IUniqueEntitySystem.sol/IUniqueEntitySystem.json +13 -13
  22. package/out/IWorldContextConsumer.sol/IWorldContextConsumer.json +71 -71
  23. package/out/IWorldErrors.sol/IWorldErrors.json +152 -152
  24. package/out/IWorldKernel.sol/IWorldCall.json +154 -154
  25. package/out/IWorldKernel.sol/IWorldKernel.json +154 -154
  26. package/out/IWorldKernel.sol/IWorldModuleInstallation.json +154 -154
  27. package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.json +329 -323
  28. package/out/KeysInTable.sol/KeysInTable.json +18239 -18239
  29. package/out/KeysInTableHook.sol/KeysInTableHook.json +882 -882
  30. package/out/KeysInTableModule.sol/KeysInTableModule.json +564 -564
  31. package/out/KeysWithValue.sol/KeysWithValue.json +6661 -6661
  32. package/out/KeysWithValueHook.sol/KeysWithValueHook.json +1023 -1023
  33. package/out/KeysWithValueModule.sol/KeysWithValueModule.json +450 -450
  34. package/out/Memory.sol/Memory.json +4 -4
  35. package/out/Module.sol/Module.json +88 -88
  36. package/out/ResourceIds.sol/ResourceIds.json +1237 -1231
  37. package/out/Schema.sol/SchemaInstance.json +72 -72
  38. package/out/Schema.sol/SchemaLib.json +72 -72
  39. package/out/SchemaType.sol/SchemaType.json +276 -276
  40. package/out/Slice.sol/SliceInstance.json +4 -4
  41. package/out/Slice.sol/SliceLib.json +4 -4
  42. package/out/StandardDelegationsModule.sol/StandardDelegationsModule.json +330 -330
  43. package/out/Storage.sol/Storage.json +7 -7
  44. package/out/StoreCore.sol/StoreCore.json +101 -101
  45. package/out/StoreCore.sol/StoreCoreInternal.json +101 -101
  46. package/out/StoreHook.sol/StoreHook.json +368 -368
  47. package/out/StoreHooks.sol/StoreHooks.json +6042 -6042
  48. package/out/StoreSwitch.sol/StoreSwitch.json +13 -13
  49. package/out/System.sol/System.json +32 -32
  50. package/out/Tables.sol/Tables.json +10401 -10401
  51. package/out/TightCoder.sol/TightCoder.json +124 -124
  52. package/out/TimeboundDelegationControl.sol/TimeboundDelegationControl.json +124 -124
  53. package/out/TimeboundDelegations.sol/TimeboundDelegations.json +3442 -3442
  54. package/out/UniqueEntity.sol/UniqueEntity.json +2344 -2344
  55. package/out/UniqueEntityModule.sol/UniqueEntityModule.json +351 -351
  56. package/out/UniqueEntitySystem.sol/UniqueEntitySystem.json +98 -98
  57. package/out/UsedKeysIndex.sol/UsedKeysIndex.json +4568 -4562
  58. package/out/WorldContext.sol/WorldContextConsumer.json +376 -376
  59. package/out/WorldContext.sol/WorldContextProvider.json +376 -376
  60. package/out/WorldResourceId.sol/WorldResourceIdInstance.json +476 -476
  61. package/out/WorldResourceId.sol/WorldResourceIdLib.json +476 -476
  62. package/out/constants.sol/LayoutOffsets.json +79 -79
  63. package/out/constants.sol/constants.json +115 -115
  64. package/out/getKeysInTable.sol/getKeysInTable.json +564 -564
  65. package/out/getKeysWithValue.sol/getKeysWithValue.json +264 -264
  66. package/out/getTargetTableId.sol/getTargetTableId.json +163 -163
  67. package/out/getUniqueEntity.sol/getUniqueEntity.json +88 -88
  68. package/out/hasKey.sol/hasKey.json +130 -130
  69. package/out/index.sol/index.json +53 -53
  70. package/out/interfaces/IBaseWorld.sol/IBaseWorld.json +186 -186
  71. package/out/leftMask.sol/leftMask.json +31 -31
  72. package/out/query.sol/query.json +1154 -1154
  73. package/out/revertWithBytes.sol/revertWithBytes.json +15 -15
  74. package/out/src/Bytes.sol/Bytes.json +1338 -1338
  75. package/out/src/FieldLayout.sol/FieldLayoutInstance.json +698 -698
  76. package/out/src/FieldLayout.sol/FieldLayoutLib.json +698 -698
  77. package/out/src/IStore.sol/IStore.json +52 -52
  78. package/out/src/IWorldKernel.sol/IWorldCall.json +154 -154
  79. package/out/src/IWorldKernel.sol/IWorldKernel.json +154 -154
  80. package/out/src/IWorldKernel.sol/IWorldModuleInstallation.json +154 -154
  81. package/out/src/Memory.sol/Memory.json +91 -91
  82. package/out/src/PackedCounter.sol/PackedCounterInstance.json +929 -929
  83. package/out/src/PackedCounter.sol/PackedCounterLib.json +929 -929
  84. package/out/src/ResourceId.sol/ResourceIdInstance.json +116 -116
  85. package/out/src/ResourceId.sol/ResourceIdLib.json +116 -116
  86. package/out/src/Schema.sol/SchemaInstance.json +790 -790
  87. package/out/src/Schema.sol/SchemaLib.json +790 -790
  88. package/out/src/Slice.sol/SliceInstance.json +430 -430
  89. package/out/src/Slice.sol/SliceLib.json +430 -430
  90. package/out/src/StoreCore.sol/StoreCore.json +4473 -4473
  91. package/out/src/StoreCore.sol/StoreCoreInternal.json +4473 -4473
  92. package/out/src/StoreSwitch.sol/StoreSwitch.json +2496 -2496
  93. package/out/src/WorldContext.sol/WorldContextConsumer.json +376 -376
  94. package/out/src/WorldContext.sol/WorldContextProvider.json +376 -376
  95. package/out/src/WorldResourceId.sol/WorldResourceIdInstance.json +476 -476
  96. package/out/src/WorldResourceId.sol/WorldResourceIdLib.json +476 -476
  97. package/out/storeHookTypes.sol/storeHookTypes.json +115 -115
  98. package/out/storeResourceTypes.sol/storeResourceTypes.json +12 -12
  99. package/out/tables/ResourceIds.sol/ResourceIds.json +2889 -2883
  100. package/out/tables/Tables.sol/Tables.json +12187 -12187
  101. package/out/tightcoder/EncodeArray.sol/EncodeArray.json +3345 -3345
  102. package/out/types.sol/types.json +41 -41
  103. package/out/version.sol/version.json +7 -7
  104. package/out/world/src/IERC165.sol/IERC165.json +28 -28
  105. package/out/worldResourceTypes.sol/worldResourceTypes.json +53 -53
  106. package/package.json +8 -8
  107. package/src/interfaces/IBaseWorld.sol +4 -2
  108. package/src/modules/keysintable/tables/KeysInTable.sol +357 -163
  109. package/src/modules/keysintable/tables/UsedKeysIndex.sol +116 -36
  110. package/src/modules/keyswithvalue/tables/KeysWithValue.sol +163 -69
  111. package/src/modules/std-delegations/tables/CallboundDelegations.sol +87 -26
  112. package/src/modules/std-delegations/tables/TimeboundDelegations.sol +87 -26
  113. package/src/modules/uniqueentity/tables/UniqueEntity.sol +87 -26
@@ -25,19 +25,28 @@ FieldLayout constant _fieldLayout = FieldLayout.wrap(
25
25
  );
26
26
 
27
27
  library UniqueEntity {
28
- /** Get the table values' field layout */
28
+ /**
29
+ * @notice Get the table values' field layout.
30
+ * @return _fieldLayout The field layout for the table.
31
+ */
29
32
  function getFieldLayout() internal pure returns (FieldLayout) {
30
33
  return _fieldLayout;
31
34
  }
32
35
 
33
- /** Get the table's key schema */
36
+ /**
37
+ * @notice Get the table's key schema.
38
+ * @return _keySchema The key schema for the table.
39
+ */
34
40
  function getKeySchema() internal pure returns (Schema) {
35
41
  SchemaType[] memory _keySchema = new SchemaType[](0);
36
42
 
37
43
  return SchemaLib.encode(_keySchema);
38
44
  }
39
45
 
40
- /** Get the table's value schema */
46
+ /**
47
+ * @notice Get the table's value schema.
48
+ * @return _valueSchema The value schema for the table.
49
+ */
41
50
  function getValueSchema() internal pure returns (Schema) {
42
51
  SchemaType[] memory _valueSchema = new SchemaType[](1);
43
52
  _valueSchema[0] = SchemaType.UINT256;
@@ -45,33 +54,47 @@ library UniqueEntity {
45
54
  return SchemaLib.encode(_valueSchema);
46
55
  }
47
56
 
48
- /** Get the table's key names */
57
+ /**
58
+ * @notice Get the table's key field names.
59
+ * @return keyNames An array of strings with the names of key fields.
60
+ */
49
61
  function getKeyNames() internal pure returns (string[] memory keyNames) {
50
62
  keyNames = new string[](0);
51
63
  }
52
64
 
53
- /** Get the table's field names */
65
+ /**
66
+ * @notice Get the table's value field names.
67
+ * @return fieldNames An array of strings with the names of value fields.
68
+ */
54
69
  function getFieldNames() internal pure returns (string[] memory fieldNames) {
55
70
  fieldNames = new string[](1);
56
71
  fieldNames[0] = "value";
57
72
  }
58
73
 
59
- /** Register the table with its config */
74
+ /**
75
+ * @notice Register the table with its config.
76
+ */
60
77
  function register(ResourceId _tableId) internal {
61
78
  StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
62
79
  }
63
80
 
64
- /** Register the table with its config */
81
+ /**
82
+ * @notice Register the table with its config.
83
+ */
65
84
  function _register(ResourceId _tableId) internal {
66
85
  StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
67
86
  }
68
87
 
69
- /** Register the table with its config (using the specified store) */
88
+ /**
89
+ * @notice Register the table with its config (using the specified store).
90
+ */
70
91
  function register(IStore _store, ResourceId _tableId) internal {
71
92
  _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
72
93
  }
73
94
 
74
- /** Get value */
95
+ /**
96
+ * @notice Get value.
97
+ */
75
98
  function getValue(ResourceId _tableId) internal view returns (uint256 value) {
76
99
  bytes32[] memory _keyTuple = new bytes32[](0);
77
100
 
@@ -79,7 +102,9 @@ library UniqueEntity {
79
102
  return (uint256(bytes32(_blob)));
80
103
  }
81
104
 
82
- /** Get value */
105
+ /**
106
+ * @notice Get value.
107
+ */
83
108
  function _getValue(ResourceId _tableId) internal view returns (uint256 value) {
84
109
  bytes32[] memory _keyTuple = new bytes32[](0);
85
110
 
@@ -87,7 +112,9 @@ library UniqueEntity {
87
112
  return (uint256(bytes32(_blob)));
88
113
  }
89
114
 
90
- /** Get value (using the specified store) */
115
+ /**
116
+ * @notice Get value (using the specified store).
117
+ */
91
118
  function getValue(IStore _store, ResourceId _tableId) internal view returns (uint256 value) {
92
119
  bytes32[] memory _keyTuple = new bytes32[](0);
93
120
 
@@ -95,7 +122,9 @@ library UniqueEntity {
95
122
  return (uint256(bytes32(_blob)));
96
123
  }
97
124
 
98
- /** Get value */
125
+ /**
126
+ * @notice Get value.
127
+ */
99
128
  function get(ResourceId _tableId) internal view returns (uint256 value) {
100
129
  bytes32[] memory _keyTuple = new bytes32[](0);
101
130
 
@@ -103,7 +132,9 @@ library UniqueEntity {
103
132
  return (uint256(bytes32(_blob)));
104
133
  }
105
134
 
106
- /** Get value */
135
+ /**
136
+ * @notice Get value.
137
+ */
107
138
  function _get(ResourceId _tableId) internal view returns (uint256 value) {
108
139
  bytes32[] memory _keyTuple = new bytes32[](0);
109
140
 
@@ -111,7 +142,9 @@ library UniqueEntity {
111
142
  return (uint256(bytes32(_blob)));
112
143
  }
113
144
 
114
- /** Get value (using the specified store) */
145
+ /**
146
+ * @notice Get value (using the specified store).
147
+ */
115
148
  function get(IStore _store, ResourceId _tableId) internal view returns (uint256 value) {
116
149
  bytes32[] memory _keyTuple = new bytes32[](0);
117
150
 
@@ -119,75 +152,101 @@ library UniqueEntity {
119
152
  return (uint256(bytes32(_blob)));
120
153
  }
121
154
 
122
- /** Set value */
155
+ /**
156
+ * @notice Set value.
157
+ */
123
158
  function setValue(ResourceId _tableId, uint256 value) internal {
124
159
  bytes32[] memory _keyTuple = new bytes32[](0);
125
160
 
126
161
  StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout);
127
162
  }
128
163
 
129
- /** Set value */
164
+ /**
165
+ * @notice Set value.
166
+ */
130
167
  function _setValue(ResourceId _tableId, uint256 value) internal {
131
168
  bytes32[] memory _keyTuple = new bytes32[](0);
132
169
 
133
170
  StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout);
134
171
  }
135
172
 
136
- /** Set value (using the specified store) */
173
+ /**
174
+ * @notice Set value (using the specified store).
175
+ */
137
176
  function setValue(IStore _store, ResourceId _tableId, uint256 value) internal {
138
177
  bytes32[] memory _keyTuple = new bytes32[](0);
139
178
 
140
179
  _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout);
141
180
  }
142
181
 
143
- /** Set value */
182
+ /**
183
+ * @notice Set value.
184
+ */
144
185
  function set(ResourceId _tableId, uint256 value) internal {
145
186
  bytes32[] memory _keyTuple = new bytes32[](0);
146
187
 
147
188
  StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout);
148
189
  }
149
190
 
150
- /** Set value */
191
+ /**
192
+ * @notice Set value.
193
+ */
151
194
  function _set(ResourceId _tableId, uint256 value) internal {
152
195
  bytes32[] memory _keyTuple = new bytes32[](0);
153
196
 
154
197
  StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout);
155
198
  }
156
199
 
157
- /** Set value (using the specified store) */
200
+ /**
201
+ * @notice Set value (using the specified store).
202
+ */
158
203
  function set(IStore _store, ResourceId _tableId, uint256 value) internal {
159
204
  bytes32[] memory _keyTuple = new bytes32[](0);
160
205
 
161
206
  _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout);
162
207
  }
163
208
 
164
- /** Delete all data for given keys */
209
+ /**
210
+ * @notice Delete all data for given keys.
211
+ */
165
212
  function deleteRecord(ResourceId _tableId) internal {
166
213
  bytes32[] memory _keyTuple = new bytes32[](0);
167
214
 
168
215
  StoreSwitch.deleteRecord(_tableId, _keyTuple);
169
216
  }
170
217
 
171
- /** Delete all data for given keys */
218
+ /**
219
+ * @notice Delete all data for given keys.
220
+ */
172
221
  function _deleteRecord(ResourceId _tableId) internal {
173
222
  bytes32[] memory _keyTuple = new bytes32[](0);
174
223
 
175
224
  StoreCore.deleteRecord(_tableId, _keyTuple, _fieldLayout);
176
225
  }
177
226
 
178
- /** Delete all data for given keys (using the specified store) */
227
+ /**
228
+ * @notice Delete all data for given keys (using the specified store).
229
+ */
179
230
  function deleteRecord(IStore _store, ResourceId _tableId) internal {
180
231
  bytes32[] memory _keyTuple = new bytes32[](0);
181
232
 
182
233
  _store.deleteRecord(_tableId, _keyTuple);
183
234
  }
184
235
 
185
- /** Tightly pack static data using this table's schema */
236
+ /**
237
+ * @notice Tightly pack static (fixed length) data using this table's schema.
238
+ * @return The static data, encoded into a sequence of bytes.
239
+ */
186
240
  function encodeStatic(uint256 value) internal pure returns (bytes memory) {
187
241
  return abi.encodePacked(value);
188
242
  }
189
243
 
190
- /** Tightly pack full data using this table's field layout */
244
+ /**
245
+ * @notice Encode all of a record's fields.
246
+ * @return The static (fixed length) data, encoded into a sequence of bytes.
247
+ * @return The lengths of the dynamic fields (packed into a single bytes32 value).
248
+ * @return The dyanmic (variable length) data, encoded into a sequence of bytes.
249
+ */
191
250
  function encode(uint256 value) internal pure returns (bytes memory, PackedCounter, bytes memory) {
192
251
  bytes memory _staticData = encodeStatic(value);
193
252
 
@@ -197,7 +256,9 @@ library UniqueEntity {
197
256
  return (_staticData, _encodedLengths, _dynamicData);
198
257
  }
199
258
 
200
- /** Encode keys as a bytes32 array using this table's field layout */
259
+ /**
260
+ * @notice Encode keys as a bytes32 array using this table's field layout.
261
+ */
201
262
  function encodeKeyTuple() internal pure returns (bytes32[] memory) {
202
263
  bytes32[] memory _keyTuple = new bytes32[](0);
203
264