@latticexyz/world-modules 2.0.0-main-a38a9f25 → 2.0.0-main-5fdbb127
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.
- package/out/ArrayLib.sol/ArrayLib.json +255 -255
- package/out/CallboundDelegationControl.sol/CallboundDelegationControl.json +220 -220
- package/out/CallboundDelegations.sol/CallboundDelegations.json +4203 -4203
- package/out/DelegationControl.sol/DelegationControl.json +98 -98
- package/out/Hook.sol/HookInstance.json +13 -13
- package/out/Hook.sol/HookLib.json +13 -13
- package/out/Hooks.sol/Hooks.json +2917 -2917
- package/out/IAccessManagementSystem.sol/IAccessManagementSystem.json +14 -14
- package/out/IBalanceTransferSystem.sol/IBalanceTransferSystem.json +15 -15
- package/out/IBaseWorld.sol/IBaseWorld.json +75 -75
- package/out/IBatchCallSystem.sol/IBatchCallSystem.json +19 -19
- package/out/IDelegationControl.sol/IDelegationControl.json +7 -7
- package/out/ISystemHook.sol/ISystemHook.json +12 -12
- package/out/IUniqueEntitySystem.sol/IUniqueEntitySystem.json +13 -13
- package/out/IWorldErrors.sol/IWorldErrors.json +19 -19
- package/out/IWorldKernel.sol/IWorldCall.json +10 -10
- package/out/IWorldKernel.sol/IWorldKernel.json +10 -10
- package/out/IWorldKernel.sol/IWorldModuleInstallation.json +10 -10
- package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.json +52 -52
- package/out/KeysInTable.sol/KeysInTable.json +17953 -17953
- package/out/KeysInTableHook.sol/KeysInTableHook.json +882 -882
- package/out/KeysInTableModule.sol/KeysInTableModule.json +549 -549
- package/out/KeysWithValue.sol/KeysWithValue.json +6427 -6427
- package/out/KeysWithValueHook.sol/KeysWithValueHook.json +1008 -1008
- package/out/KeysWithValueModule.sol/KeysWithValueModule.json +434 -434
- package/out/Module.sol/Module.json +88 -88
- package/out/ResourceIds.sol/ResourceIds.json +964 -964
- package/out/Schema.sol/SchemaInstance.json +30 -30
- package/out/Schema.sol/SchemaLib.json +30 -30
- package/out/SchemaType.sol/SchemaType.json +276 -276
- package/out/StandardDelegationsModule.sol/StandardDelegationsModule.json +315 -315
- package/out/StoreCore.sol/StoreCore.json +13 -13
- package/out/StoreCore.sol/StoreCoreInternal.json +13 -13
- package/out/StoreHook.sol/StoreHook.json +368 -368
- package/out/StoreHooks.sol/StoreHooks.json +2692 -2692
- package/out/StoreSwitch.sol/StoreSwitch.json +13 -13
- package/out/System.sol/System.json +32 -32
- package/out/Tables.sol/Tables.json +4684 -4684
- package/out/TimeboundDelegationControl.sol/TimeboundDelegationControl.json +124 -124
- package/out/TimeboundDelegations.sol/TimeboundDelegations.json +3210 -3210
- package/out/UniqueEntity.sol/UniqueEntity.json +2125 -2125
- package/out/UniqueEntityModule.sol/UniqueEntityModule.json +336 -336
- package/out/UniqueEntitySystem.sol/UniqueEntitySystem.json +98 -98
- package/out/UsedKeysIndex.sol/UsedKeysIndex.json +4308 -4308
- package/out/WorldContext.sol/WorldContextConsumer.json +24 -24
- package/out/WorldContext.sol/WorldContextProvider.json +24 -24
- package/out/WorldResourceId.sol/WorldResourceIdInstance.json +96 -96
- package/out/WorldResourceId.sol/WorldResourceIdLib.json +96 -96
- package/out/constants.sol/constants.json +35 -35
- package/out/getKeysInTable.sol/getKeysInTable.json +564 -564
- package/out/getKeysWithValue.sol/getKeysWithValue.json +264 -264
- package/out/getTargetTableId.sol/getTargetTableId.json +163 -163
- package/out/getUniqueEntity.sol/getUniqueEntity.json +88 -88
- package/out/hasKey.sol/hasKey.json +130 -130
- package/out/index.sol/index.json +53 -53
- package/out/interfaces/IBaseWorld.sol/IBaseWorld.json +168 -168
- package/out/query.sol/query.json +1154 -1154
- package/out/revertWithBytes.sol/revertWithBytes.json +15 -15
- package/out/src/Bytes.sol/Bytes.json +1332 -1332
- package/out/src/FieldLayout.sol/FieldLayoutInstance.json +697 -697
- package/out/src/FieldLayout.sol/FieldLayoutLib.json +697 -697
- package/out/src/IStore.sol/IStore.json +52 -52
- package/out/src/IWorldKernel.sol/IWorldCall.json +150 -150
- package/out/src/IWorldKernel.sol/IWorldKernel.json +150 -150
- package/out/src/IWorldKernel.sol/IWorldModuleInstallation.json +150 -150
- package/out/src/Memory.sol/Memory.json +91 -91
- package/out/src/PackedCounter.sol/PackedCounterInstance.json +929 -929
- package/out/src/PackedCounter.sol/PackedCounterLib.json +929 -929
- package/out/src/ResourceId.sol/ResourceIdInstance.json +116 -116
- package/out/src/ResourceId.sol/ResourceIdLib.json +116 -116
- package/out/src/Schema.sol/SchemaInstance.json +790 -790
- package/out/src/Schema.sol/SchemaLib.json +790 -790
- package/out/src/Slice.sol/SliceInstance.json +430 -430
- package/out/src/Slice.sol/SliceLib.json +430 -430
- package/out/src/StoreCore.sol/StoreCore.json +4468 -4468
- package/out/src/StoreCore.sol/StoreCoreInternal.json +4468 -4468
- package/out/src/StoreSwitch.sol/StoreSwitch.json +2496 -2496
- package/out/src/WorldContext.sol/WorldContextConsumer.json +376 -376
- package/out/src/WorldContext.sol/WorldContextProvider.json +376 -376
- package/out/src/WorldResourceId.sol/WorldResourceIdInstance.json +476 -476
- package/out/src/WorldResourceId.sol/WorldResourceIdLib.json +476 -476
- package/out/storeHookTypes.sol/storeHookTypes.json +115 -115
- package/out/storeResourceTypes.sol/storeResourceTypes.json +12 -12
- package/out/tables/ResourceIds.sol/ResourceIds.json +2665 -2665
- package/out/tables/Tables.sol/Tables.json +11899 -11899
- package/out/tightcoder/EncodeArray.sol/EncodeArray.json +3345 -3345
- package/out/types.sol/types.json +72 -60
- package/out/worldResourceTypes.sol/worldResourceTypes.json +53 -53
- package/package.json +8 -8
- package/src/interfaces/IBaseWorld.sol +3 -2
- package/src/modules/keysintable/tables/KeysInTable.sol +285 -135
- package/src/modules/keysintable/tables/UsedKeysIndex.sol +36 -12
- package/src/modules/keyswithvalue/tables/KeysWithValue.sol +114 -54
- package/src/modules/std-delegations/tables/CallboundDelegations.sol +36 -12
- package/src/modules/std-delegations/tables/TimeboundDelegations.sol +36 -12
- package/src/modules/uniqueentity/tables/UniqueEntity.sol +36 -12
@@ -85,7 +85,9 @@ library UsedKeysIndex {
|
|
85
85
|
_store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
|
86
86
|
}
|
87
87
|
|
88
|
-
/**
|
88
|
+
/**
|
89
|
+
* @notice Get has
|
90
|
+
*/
|
89
91
|
function getHas(ResourceId sourceTableId, bytes32 keysHash) internal view returns (bool has) {
|
90
92
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
91
93
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -95,7 +97,9 @@ library UsedKeysIndex {
|
|
95
97
|
return (_toBool(uint8(bytes1(_blob))));
|
96
98
|
}
|
97
99
|
|
98
|
-
/**
|
100
|
+
/**
|
101
|
+
* @notice Get has
|
102
|
+
*/
|
99
103
|
function _getHas(ResourceId sourceTableId, bytes32 keysHash) internal view returns (bool has) {
|
100
104
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
101
105
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -105,7 +109,9 @@ library UsedKeysIndex {
|
|
105
109
|
return (_toBool(uint8(bytes1(_blob))));
|
106
110
|
}
|
107
111
|
|
108
|
-
/**
|
112
|
+
/**
|
113
|
+
* @notice Get has (using the specified store)
|
114
|
+
*/
|
109
115
|
function getHas(IStore _store, ResourceId sourceTableId, bytes32 keysHash) internal view returns (bool has) {
|
110
116
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
111
117
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -115,7 +121,9 @@ library UsedKeysIndex {
|
|
115
121
|
return (_toBool(uint8(bytes1(_blob))));
|
116
122
|
}
|
117
123
|
|
118
|
-
/**
|
124
|
+
/**
|
125
|
+
* @notice Set has
|
126
|
+
*/
|
119
127
|
function setHas(ResourceId sourceTableId, bytes32 keysHash, bool has) internal {
|
120
128
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
121
129
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -124,7 +132,9 @@ library UsedKeysIndex {
|
|
124
132
|
StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((has)), _fieldLayout);
|
125
133
|
}
|
126
134
|
|
127
|
-
/**
|
135
|
+
/**
|
136
|
+
* @notice Set has
|
137
|
+
*/
|
128
138
|
function _setHas(ResourceId sourceTableId, bytes32 keysHash, bool has) internal {
|
129
139
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
130
140
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -133,7 +143,9 @@ library UsedKeysIndex {
|
|
133
143
|
StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((has)), _fieldLayout);
|
134
144
|
}
|
135
145
|
|
136
|
-
/**
|
146
|
+
/**
|
147
|
+
* @notice Set has (using the specified store)
|
148
|
+
*/
|
137
149
|
function setHas(IStore _store, ResourceId sourceTableId, bytes32 keysHash, bool has) internal {
|
138
150
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
139
151
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -142,7 +154,9 @@ library UsedKeysIndex {
|
|
142
154
|
_store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((has)), _fieldLayout);
|
143
155
|
}
|
144
156
|
|
145
|
-
/**
|
157
|
+
/**
|
158
|
+
* @notice Get index
|
159
|
+
*/
|
146
160
|
function getIndex(ResourceId sourceTableId, bytes32 keysHash) internal view returns (uint40 index) {
|
147
161
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
148
162
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -152,7 +166,9 @@ library UsedKeysIndex {
|
|
152
166
|
return (uint40(bytes5(_blob)));
|
153
167
|
}
|
154
168
|
|
155
|
-
/**
|
169
|
+
/**
|
170
|
+
* @notice Get index
|
171
|
+
*/
|
156
172
|
function _getIndex(ResourceId sourceTableId, bytes32 keysHash) internal view returns (uint40 index) {
|
157
173
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
158
174
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -162,7 +178,9 @@ library UsedKeysIndex {
|
|
162
178
|
return (uint40(bytes5(_blob)));
|
163
179
|
}
|
164
180
|
|
165
|
-
/**
|
181
|
+
/**
|
182
|
+
* @notice Get index (using the specified store)
|
183
|
+
*/
|
166
184
|
function getIndex(IStore _store, ResourceId sourceTableId, bytes32 keysHash) internal view returns (uint40 index) {
|
167
185
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
168
186
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -172,7 +190,9 @@ library UsedKeysIndex {
|
|
172
190
|
return (uint40(bytes5(_blob)));
|
173
191
|
}
|
174
192
|
|
175
|
-
/**
|
193
|
+
/**
|
194
|
+
* @notice Set index
|
195
|
+
*/
|
176
196
|
function setIndex(ResourceId sourceTableId, bytes32 keysHash, uint40 index) internal {
|
177
197
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
178
198
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -181,7 +201,9 @@ library UsedKeysIndex {
|
|
181
201
|
StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((index)), _fieldLayout);
|
182
202
|
}
|
183
203
|
|
184
|
-
/**
|
204
|
+
/**
|
205
|
+
* @notice Set index
|
206
|
+
*/
|
185
207
|
function _setIndex(ResourceId sourceTableId, bytes32 keysHash, uint40 index) internal {
|
186
208
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
187
209
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -190,7 +212,9 @@ library UsedKeysIndex {
|
|
190
212
|
StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((index)), _fieldLayout);
|
191
213
|
}
|
192
214
|
|
193
|
-
/**
|
215
|
+
/**
|
216
|
+
* @notice Set index (using the specified store)
|
217
|
+
*/
|
194
218
|
function setIndex(IStore _store, ResourceId sourceTableId, bytes32 keysHash, uint40 index) internal {
|
195
219
|
bytes32[] memory _keyTuple = new bytes32[](2);
|
196
220
|
_keyTuple[0] = ResourceId.unwrap(sourceTableId);
|
@@ -73,7 +73,9 @@ library KeysWithValue {
|
|
73
73
|
_store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
|
74
74
|
}
|
75
75
|
|
76
|
-
/**
|
76
|
+
/**
|
77
|
+
* @notice Get keysWithValue
|
78
|
+
*/
|
77
79
|
function getKeysWithValue(
|
78
80
|
ResourceId _tableId,
|
79
81
|
bytes32 valueHash
|
@@ -85,7 +87,9 @@ library KeysWithValue {
|
|
85
87
|
return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32());
|
86
88
|
}
|
87
89
|
|
88
|
-
/**
|
90
|
+
/**
|
91
|
+
* @notice Get keysWithValue
|
92
|
+
*/
|
89
93
|
function _getKeysWithValue(
|
90
94
|
ResourceId _tableId,
|
91
95
|
bytes32 valueHash
|
@@ -97,7 +101,9 @@ library KeysWithValue {
|
|
97
101
|
return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32());
|
98
102
|
}
|
99
103
|
|
100
|
-
/**
|
104
|
+
/**
|
105
|
+
* @notice Get keysWithValue (using the specified store)
|
106
|
+
*/
|
101
107
|
function getKeysWithValue(
|
102
108
|
IStore _store,
|
103
109
|
ResourceId _tableId,
|
@@ -110,7 +116,9 @@ library KeysWithValue {
|
|
110
116
|
return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32());
|
111
117
|
}
|
112
118
|
|
113
|
-
/**
|
119
|
+
/**
|
120
|
+
* @notice Get keysWithValue
|
121
|
+
*/
|
114
122
|
function get(ResourceId _tableId, bytes32 valueHash) internal view returns (bytes32[] memory keysWithValue) {
|
115
123
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
116
124
|
_keyTuple[0] = valueHash;
|
@@ -119,7 +127,9 @@ library KeysWithValue {
|
|
119
127
|
return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32());
|
120
128
|
}
|
121
129
|
|
122
|
-
/**
|
130
|
+
/**
|
131
|
+
* @notice Get keysWithValue
|
132
|
+
*/
|
123
133
|
function _get(ResourceId _tableId, bytes32 valueHash) internal view returns (bytes32[] memory keysWithValue) {
|
124
134
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
125
135
|
_keyTuple[0] = valueHash;
|
@@ -128,7 +138,9 @@ library KeysWithValue {
|
|
128
138
|
return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32());
|
129
139
|
}
|
130
140
|
|
131
|
-
/**
|
141
|
+
/**
|
142
|
+
* @notice Get keysWithValue (using the specified store)
|
143
|
+
*/
|
132
144
|
function get(
|
133
145
|
IStore _store,
|
134
146
|
ResourceId _tableId,
|
@@ -141,7 +153,9 @@ library KeysWithValue {
|
|
141
153
|
return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32());
|
142
154
|
}
|
143
155
|
|
144
|
-
/**
|
156
|
+
/**
|
157
|
+
* @notice Set keysWithValue
|
158
|
+
*/
|
145
159
|
function setKeysWithValue(ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal {
|
146
160
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
147
161
|
_keyTuple[0] = valueHash;
|
@@ -149,7 +163,9 @@ library KeysWithValue {
|
|
149
163
|
StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue)));
|
150
164
|
}
|
151
165
|
|
152
|
-
/**
|
166
|
+
/**
|
167
|
+
* @notice Set keysWithValue
|
168
|
+
*/
|
153
169
|
function _setKeysWithValue(ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal {
|
154
170
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
155
171
|
_keyTuple[0] = valueHash;
|
@@ -157,7 +173,9 @@ library KeysWithValue {
|
|
157
173
|
StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue)));
|
158
174
|
}
|
159
175
|
|
160
|
-
/**
|
176
|
+
/**
|
177
|
+
* @notice Set keysWithValue (using the specified store)
|
178
|
+
*/
|
161
179
|
function setKeysWithValue(
|
162
180
|
IStore _store,
|
163
181
|
ResourceId _tableId,
|
@@ -170,7 +188,9 @@ library KeysWithValue {
|
|
170
188
|
_store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue)));
|
171
189
|
}
|
172
190
|
|
173
|
-
/**
|
191
|
+
/**
|
192
|
+
* @notice Set keysWithValue
|
193
|
+
*/
|
174
194
|
function set(ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal {
|
175
195
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
176
196
|
_keyTuple[0] = valueHash;
|
@@ -178,7 +198,9 @@ library KeysWithValue {
|
|
178
198
|
StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue)));
|
179
199
|
}
|
180
200
|
|
181
|
-
/**
|
201
|
+
/**
|
202
|
+
* @notice Set keysWithValue
|
203
|
+
*/
|
182
204
|
function _set(ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal {
|
183
205
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
184
206
|
_keyTuple[0] = valueHash;
|
@@ -186,7 +208,9 @@ library KeysWithValue {
|
|
186
208
|
StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue)));
|
187
209
|
}
|
188
210
|
|
189
|
-
/**
|
211
|
+
/**
|
212
|
+
* @notice Set keysWithValue (using the specified store)
|
213
|
+
*/
|
190
214
|
function set(IStore _store, ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal {
|
191
215
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
192
216
|
_keyTuple[0] = valueHash;
|
@@ -194,7 +218,9 @@ library KeysWithValue {
|
|
194
218
|
_store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue)));
|
195
219
|
}
|
196
220
|
|
197
|
-
/**
|
221
|
+
/**
|
222
|
+
* @notice Get length of keysWithValue
|
223
|
+
*/
|
198
224
|
function lengthKeysWithValue(ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) {
|
199
225
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
200
226
|
_keyTuple[0] = valueHash;
|
@@ -205,7 +231,9 @@ library KeysWithValue {
|
|
205
231
|
}
|
206
232
|
}
|
207
233
|
|
208
|
-
/**
|
234
|
+
/**
|
235
|
+
* @notice Get length of keysWithValue
|
236
|
+
*/
|
209
237
|
function _lengthKeysWithValue(ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) {
|
210
238
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
211
239
|
_keyTuple[0] = valueHash;
|
@@ -216,7 +244,9 @@ library KeysWithValue {
|
|
216
244
|
}
|
217
245
|
}
|
218
246
|
|
219
|
-
/**
|
247
|
+
/**
|
248
|
+
* @notice Get length of keysWithValue (using the specified store)
|
249
|
+
*/
|
220
250
|
function lengthKeysWithValue(IStore _store, ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) {
|
221
251
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
222
252
|
_keyTuple[0] = valueHash;
|
@@ -227,7 +257,9 @@ library KeysWithValue {
|
|
227
257
|
}
|
228
258
|
}
|
229
259
|
|
230
|
-
/**
|
260
|
+
/**
|
261
|
+
* @notice Get length of keysWithValue
|
262
|
+
*/
|
231
263
|
function length(ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) {
|
232
264
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
233
265
|
_keyTuple[0] = valueHash;
|
@@ -238,7 +270,9 @@ library KeysWithValue {
|
|
238
270
|
}
|
239
271
|
}
|
240
272
|
|
241
|
-
/**
|
273
|
+
/**
|
274
|
+
* @notice Get length of keysWithValue
|
275
|
+
*/
|
242
276
|
function _length(ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) {
|
243
277
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
244
278
|
_keyTuple[0] = valueHash;
|
@@ -249,7 +283,9 @@ library KeysWithValue {
|
|
249
283
|
}
|
250
284
|
}
|
251
285
|
|
252
|
-
/**
|
286
|
+
/**
|
287
|
+
* @notice Get length of keysWithValue (using the specified store)
|
288
|
+
*/
|
253
289
|
function length(IStore _store, ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) {
|
254
290
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
255
291
|
_keyTuple[0] = valueHash;
|
@@ -261,8 +297,8 @@ library KeysWithValue {
|
|
261
297
|
}
|
262
298
|
|
263
299
|
/**
|
264
|
-
* Get an item of keysWithValue
|
265
|
-
* (unchecked, returns invalid data if index overflows)
|
300
|
+
* @notice Get an item of keysWithValue
|
301
|
+
* @dev (unchecked, returns invalid data if index overflows)
|
266
302
|
*/
|
267
303
|
function getItemKeysWithValue(
|
268
304
|
ResourceId _tableId,
|
@@ -279,8 +315,8 @@ library KeysWithValue {
|
|
279
315
|
}
|
280
316
|
|
281
317
|
/**
|
282
|
-
* Get an item of keysWithValue
|
283
|
-
* (unchecked, returns invalid data if index overflows)
|
318
|
+
* @notice Get an item of keysWithValue
|
319
|
+
* @dev (unchecked, returns invalid data if index overflows)
|
284
320
|
*/
|
285
321
|
function _getItemKeysWithValue(
|
286
322
|
ResourceId _tableId,
|
@@ -297,8 +333,8 @@ library KeysWithValue {
|
|
297
333
|
}
|
298
334
|
|
299
335
|
/**
|
300
|
-
* Get an item of keysWithValue (using the specified store)
|
301
|
-
* (unchecked, returns invalid data if index overflows)
|
336
|
+
* @notice Get an item of keysWithValue (using the specified store)
|
337
|
+
* @dev (unchecked, returns invalid data if index overflows)
|
302
338
|
*/
|
303
339
|
function getItemKeysWithValue(
|
304
340
|
IStore _store,
|
@@ -316,8 +352,8 @@ library KeysWithValue {
|
|
316
352
|
}
|
317
353
|
|
318
354
|
/**
|
319
|
-
* Get an item of keysWithValue
|
320
|
-
* (unchecked, returns invalid data if index overflows)
|
355
|
+
* @notice Get an item of keysWithValue
|
356
|
+
* @dev (unchecked, returns invalid data if index overflows)
|
321
357
|
*/
|
322
358
|
function getItem(ResourceId _tableId, bytes32 valueHash, uint256 _index) internal view returns (bytes32) {
|
323
359
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
@@ -330,8 +366,8 @@ library KeysWithValue {
|
|
330
366
|
}
|
331
367
|
|
332
368
|
/**
|
333
|
-
* Get an item of keysWithValue
|
334
|
-
* (unchecked, returns invalid data if index overflows)
|
369
|
+
* @notice Get an item of keysWithValue
|
370
|
+
* @dev (unchecked, returns invalid data if index overflows)
|
335
371
|
*/
|
336
372
|
function _getItem(ResourceId _tableId, bytes32 valueHash, uint256 _index) internal view returns (bytes32) {
|
337
373
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
@@ -344,8 +380,8 @@ library KeysWithValue {
|
|
344
380
|
}
|
345
381
|
|
346
382
|
/**
|
347
|
-
* Get an item of keysWithValue (using the specified store)
|
348
|
-
* (unchecked, returns invalid data if index overflows)
|
383
|
+
* @notice Get an item of keysWithValue (using the specified store)
|
384
|
+
* @dev (unchecked, returns invalid data if index overflows)
|
349
385
|
*/
|
350
386
|
function getItem(
|
351
387
|
IStore _store,
|
@@ -362,7 +398,9 @@ library KeysWithValue {
|
|
362
398
|
}
|
363
399
|
}
|
364
400
|
|
365
|
-
/**
|
401
|
+
/**
|
402
|
+
* @notice Push an element to keysWithValue
|
403
|
+
*/
|
366
404
|
function pushKeysWithValue(ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal {
|
367
405
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
368
406
|
_keyTuple[0] = valueHash;
|
@@ -370,7 +408,9 @@ library KeysWithValue {
|
|
370
408
|
StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element)));
|
371
409
|
}
|
372
410
|
|
373
|
-
/**
|
411
|
+
/**
|
412
|
+
* @notice Push an element to keysWithValue
|
413
|
+
*/
|
374
414
|
function _pushKeysWithValue(ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal {
|
375
415
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
376
416
|
_keyTuple[0] = valueHash;
|
@@ -378,7 +418,9 @@ library KeysWithValue {
|
|
378
418
|
StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element)));
|
379
419
|
}
|
380
420
|
|
381
|
-
/**
|
421
|
+
/**
|
422
|
+
* @notice Push an element to keysWithValue (using the specified store)
|
423
|
+
*/
|
382
424
|
function pushKeysWithValue(IStore _store, ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal {
|
383
425
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
384
426
|
_keyTuple[0] = valueHash;
|
@@ -386,7 +428,9 @@ library KeysWithValue {
|
|
386
428
|
_store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element)));
|
387
429
|
}
|
388
430
|
|
389
|
-
/**
|
431
|
+
/**
|
432
|
+
* @notice Push an element to keysWithValue
|
433
|
+
*/
|
390
434
|
function push(ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal {
|
391
435
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
392
436
|
_keyTuple[0] = valueHash;
|
@@ -394,7 +438,9 @@ library KeysWithValue {
|
|
394
438
|
StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element)));
|
395
439
|
}
|
396
440
|
|
397
|
-
/**
|
441
|
+
/**
|
442
|
+
* @notice Push an element to keysWithValue
|
443
|
+
*/
|
398
444
|
function _push(ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal {
|
399
445
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
400
446
|
_keyTuple[0] = valueHash;
|
@@ -402,7 +448,9 @@ library KeysWithValue {
|
|
402
448
|
StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element)));
|
403
449
|
}
|
404
450
|
|
405
|
-
/**
|
451
|
+
/**
|
452
|
+
* @notice Push an element to keysWithValue (using the specified store)
|
453
|
+
*/
|
406
454
|
function push(IStore _store, ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal {
|
407
455
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
408
456
|
_keyTuple[0] = valueHash;
|
@@ -410,7 +458,9 @@ library KeysWithValue {
|
|
410
458
|
_store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element)));
|
411
459
|
}
|
412
460
|
|
413
|
-
/**
|
461
|
+
/**
|
462
|
+
* @notice Pop an element from keysWithValue
|
463
|
+
*/
|
414
464
|
function popKeysWithValue(ResourceId _tableId, bytes32 valueHash) internal {
|
415
465
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
416
466
|
_keyTuple[0] = valueHash;
|
@@ -418,7 +468,9 @@ library KeysWithValue {
|
|
418
468
|
StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 32);
|
419
469
|
}
|
420
470
|
|
421
|
-
/**
|
471
|
+
/**
|
472
|
+
* @notice Pop an element from keysWithValue
|
473
|
+
*/
|
422
474
|
function _popKeysWithValue(ResourceId _tableId, bytes32 valueHash) internal {
|
423
475
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
424
476
|
_keyTuple[0] = valueHash;
|
@@ -426,7 +478,9 @@ library KeysWithValue {
|
|
426
478
|
StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 32);
|
427
479
|
}
|
428
480
|
|
429
|
-
/**
|
481
|
+
/**
|
482
|
+
* @notice Pop an element from keysWithValue (using the specified store)
|
483
|
+
*/
|
430
484
|
function popKeysWithValue(IStore _store, ResourceId _tableId, bytes32 valueHash) internal {
|
431
485
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
432
486
|
_keyTuple[0] = valueHash;
|
@@ -434,7 +488,9 @@ library KeysWithValue {
|
|
434
488
|
_store.popFromDynamicField(_tableId, _keyTuple, 0, 32);
|
435
489
|
}
|
436
490
|
|
437
|
-
/**
|
491
|
+
/**
|
492
|
+
* @notice Pop an element from keysWithValue
|
493
|
+
*/
|
438
494
|
function pop(ResourceId _tableId, bytes32 valueHash) internal {
|
439
495
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
440
496
|
_keyTuple[0] = valueHash;
|
@@ -442,7 +498,9 @@ library KeysWithValue {
|
|
442
498
|
StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 32);
|
443
499
|
}
|
444
500
|
|
445
|
-
/**
|
501
|
+
/**
|
502
|
+
* @notice Pop an element from keysWithValue
|
503
|
+
*/
|
446
504
|
function _pop(ResourceId _tableId, bytes32 valueHash) internal {
|
447
505
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
448
506
|
_keyTuple[0] = valueHash;
|
@@ -450,7 +508,9 @@ library KeysWithValue {
|
|
450
508
|
StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 32);
|
451
509
|
}
|
452
510
|
|
453
|
-
/**
|
511
|
+
/**
|
512
|
+
* @notice Pop an element from keysWithValue (using the specified store)
|
513
|
+
*/
|
454
514
|
function pop(IStore _store, ResourceId _tableId, bytes32 valueHash) internal {
|
455
515
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
456
516
|
_keyTuple[0] = valueHash;
|
@@ -459,8 +519,8 @@ library KeysWithValue {
|
|
459
519
|
}
|
460
520
|
|
461
521
|
/**
|
462
|
-
* Update an element of keysWithValue at `_index`
|
463
|
-
* (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
522
|
+
* @notice Update an element of keysWithValue at `_index`
|
523
|
+
* @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
464
524
|
*/
|
465
525
|
function updateKeysWithValue(ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal {
|
466
526
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
@@ -473,8 +533,8 @@ library KeysWithValue {
|
|
473
533
|
}
|
474
534
|
|
475
535
|
/**
|
476
|
-
* Update an element of keysWithValue at `_index`
|
477
|
-
* (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
536
|
+
* @notice Update an element of keysWithValue at `_index`
|
537
|
+
* @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
478
538
|
*/
|
479
539
|
function _updateKeysWithValue(ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal {
|
480
540
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
@@ -487,8 +547,8 @@ library KeysWithValue {
|
|
487
547
|
}
|
488
548
|
|
489
549
|
/**
|
490
|
-
* Update an element of keysWithValue (using the specified store) at `_index`
|
491
|
-
* (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
550
|
+
* @notice Update an element of keysWithValue (using the specified store) at `_index`
|
551
|
+
* @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
492
552
|
*/
|
493
553
|
function updateKeysWithValue(
|
494
554
|
IStore _store,
|
@@ -507,8 +567,8 @@ library KeysWithValue {
|
|
507
567
|
}
|
508
568
|
|
509
569
|
/**
|
510
|
-
* Update an element of keysWithValue at `_index`
|
511
|
-
* (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
570
|
+
* @notice Update an element of keysWithValue at `_index`
|
571
|
+
* @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
512
572
|
*/
|
513
573
|
function update(ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal {
|
514
574
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
@@ -521,8 +581,8 @@ library KeysWithValue {
|
|
521
581
|
}
|
522
582
|
|
523
583
|
/**
|
524
|
-
* Update an element of keysWithValue at `_index`
|
525
|
-
* (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
584
|
+
* @notice Update an element of keysWithValue at `_index`
|
585
|
+
* @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
526
586
|
*/
|
527
587
|
function _update(ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal {
|
528
588
|
bytes32[] memory _keyTuple = new bytes32[](1);
|
@@ -535,8 +595,8 @@ library KeysWithValue {
|
|
535
595
|
}
|
536
596
|
|
537
597
|
/**
|
538
|
-
* Update an element of keysWithValue (using the specified store) at `_index`
|
539
|
-
* (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
598
|
+
* @notice Update an element of keysWithValue (using the specified store) at `_index`
|
599
|
+
* @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows)
|
540
600
|
*/
|
541
601
|
function update(IStore _store, ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal {
|
542
602
|
bytes32[] memory _keyTuple = new bytes32[](1);
|