@latticexyz/world-modules 2.0.12-main-ecc8f658 → 2.0.12-type-resolutions-effc7ab1
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/cache/solidity-files-cache.json +1 -0
- package/dist/mud.config.d.ts +0 -2
- package/package.json +9 -9
- package/src/index.sol +0 -25
- package/src/interfaces/IBaseWorld.sol +0 -16
- package/src/interfaces/IERC20System.sol +0 -33
- package/src/interfaces/IERC721System.sol +0 -43
- package/src/interfaces/IPuppetFactorySystem.sol +0 -15
- package/src/interfaces/IUniqueEntitySystem.sol +0 -13
- package/src/interfaces/IUnstable_CallWithSignatureSystem.sol +0 -20
- package/src/modules/callwithsignature/ECDSA.sol +0 -174
- package/src/modules/callwithsignature/IERC1271.sol +0 -17
- package/src/modules/callwithsignature/IUnstable_CallWithSignatureErrors.sol +0 -9
- package/src/modules/callwithsignature/SignatureChecker.sol +0 -50
- package/src/modules/callwithsignature/Unstable_CallWithSignatureModule.sol +0 -48
- package/src/modules/callwithsignature/Unstable_CallWithSignatureSystem.sol +0 -36
- package/src/modules/callwithsignature/constants.sol +0 -10
- package/src/modules/callwithsignature/getSignedMessageHash.sol +0 -54
- package/src/modules/callwithsignature/tables/CallWithSignatureNonces.sol +0 -199
- package/src/modules/callwithsignature/validateCallWithSignature.sol +0 -31
- package/src/modules/erc20-puppet/ERC20Module.sol +0 -88
- package/src/modules/erc20-puppet/ERC20System.sol +0 -286
- package/src/modules/erc20-puppet/IERC20.sol +0 -94
- package/src/modules/erc20-puppet/IERC20Errors.sol +0 -49
- package/src/modules/erc20-puppet/IERC20Events.sol +0 -18
- package/src/modules/erc20-puppet/IERC20Mintable.sol +0 -25
- package/src/modules/erc20-puppet/constants.sol +0 -20
- package/src/modules/erc20-puppet/registerERC20.sol +0 -35
- package/src/modules/erc20-puppet/tables/Allowances.sol +0 -208
- package/src/modules/erc20-puppet/tables/ERC20Metadata.sol +0 -604
- package/src/modules/erc20-puppet/tables/ERC20Registry.sol +0 -199
- package/src/modules/erc20-puppet/tables/TotalSupply.sol +0 -184
- package/src/modules/erc20-puppet/utils.sol +0 -30
- package/src/modules/erc721-puppet/ERC721Module.sol +0 -95
- package/src/modules/erc721-puppet/ERC721System.sol +0 -531
- package/src/modules/erc721-puppet/IERC721.sol +0 -120
- package/src/modules/erc721-puppet/IERC721Errors.sol +0 -61
- package/src/modules/erc721-puppet/IERC721Events.sol +0 -23
- package/src/modules/erc721-puppet/IERC721Metadata.sol +0 -27
- package/src/modules/erc721-puppet/IERC721Mintable.sol +0 -53
- package/src/modules/erc721-puppet/IERC721Receiver.sol +0 -28
- package/src/modules/erc721-puppet/constants.sol +0 -23
- package/src/modules/erc721-puppet/libraries/LibString.sol +0 -77
- package/src/modules/erc721-puppet/registerERC721.sol +0 -37
- package/src/modules/erc721-puppet/tables/ERC721Metadata.sol +0 -703
- package/src/modules/erc721-puppet/tables/ERC721Registry.sol +0 -199
- package/src/modules/erc721-puppet/tables/OperatorApproval.sol +0 -220
- package/src/modules/erc721-puppet/tables/Owners.sol +0 -196
- package/src/modules/erc721-puppet/tables/TokenApproval.sol +0 -196
- package/src/modules/erc721-puppet/tables/TokenURI.sol +0 -450
- package/src/modules/erc721-puppet/utils.sol +0 -38
- package/src/modules/keysintable/KeysInTableHook.sol +0 -141
- package/src/modules/keysintable/KeysInTableModule.sol +0 -110
- package/src/modules/keysintable/constants.sol +0 -7
- package/src/modules/keysintable/getKeysInTable.sol +0 -81
- package/src/modules/keysintable/hasKey.sol +0 -28
- package/src/modules/keysintable/query.sol +0 -200
- package/src/modules/keysintable/tables/KeysInTable.sol +0 -1638
- package/src/modules/keysintable/tables/UsedKeysIndex.sol +0 -414
- package/src/modules/keyswithvalue/KeysWithValueHook.sol +0 -158
- package/src/modules/keyswithvalue/KeysWithValueModule.sol +0 -103
- package/src/modules/keyswithvalue/constants.sol +0 -7
- package/src/modules/keyswithvalue/getKeysWithValue.sol +0 -58
- package/src/modules/keyswithvalue/getTargetTableId.sol +0 -32
- package/src/modules/keyswithvalue/tables/KeysWithValue.sol +0 -668
- package/src/modules/puppet/Puppet.sol +0 -80
- package/src/modules/puppet/PuppetDelegationControl.sol +0 -17
- package/src/modules/puppet/PuppetFactorySystem.sol +0 -25
- package/src/modules/puppet/PuppetMaster.sol +0 -19
- package/src/modules/puppet/PuppetModule.sol +0 -64
- package/src/modules/puppet/constants.sol +0 -23
- package/src/modules/puppet/createPuppet.sol +0 -24
- package/src/modules/puppet/tables/PuppetRegistry.sol +0 -199
- package/src/modules/puppet/utils.sol +0 -10
- package/src/modules/std-delegations/CallboundDelegationControl.sol +0 -64
- package/src/modules/std-delegations/StandardDelegationsModule.sol +0 -55
- package/src/modules/std-delegations/SystemboundDelegationControl.sol +0 -54
- package/src/modules/std-delegations/TimeboundDelegationControl.sol +0 -27
- package/src/modules/std-delegations/constants.sol +0 -21
- package/src/modules/std-delegations/tables/CallboundDelegations.sol +0 -287
- package/src/modules/std-delegations/tables/SystemboundDelegations.sol +0 -256
- package/src/modules/std-delegations/tables/TimeboundDelegations.sol +0 -211
- package/src/modules/tokens/tables/Balances.sol +0 -196
- package/src/modules/uniqueentity/UniqueEntityModule.sol +0 -73
- package/src/modules/uniqueentity/UniqueEntitySystem.sol +0 -18
- package/src/modules/uniqueentity/constants.sol +0 -13
- package/src/modules/uniqueentity/getUniqueEntity.sol +0 -26
- package/src/modules/uniqueentity/tables/UniqueEntity.sol +0 -238
- package/src/modules/utils/ArrayLib.sol +0 -55
- package/src/utils/AccessControlLib.sol +0 -55
- package/src/utils/SystemSwitch.sol +0 -80
@@ -1,58 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
2
|
-
pragma solidity >=0.8.24;
|
3
|
-
|
4
|
-
import { IStore } from "@latticexyz/store/src/IStore.sol";
|
5
|
-
import { EncodedLengths } from "@latticexyz/store/src/EncodedLengths.sol";
|
6
|
-
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
|
7
|
-
|
8
|
-
import { MODULE_NAMESPACE } from "./constants.sol";
|
9
|
-
import { KeysWithValue } from "./tables/KeysWithValue.sol";
|
10
|
-
import { getTargetTableId } from "./getTargetTableId.sol";
|
11
|
-
|
12
|
-
/**
|
13
|
-
* Get a list of keys with the given value.
|
14
|
-
*
|
15
|
-
* Note: this util can only be called within the context of a Store (e.g. from a System or Module).
|
16
|
-
* For usage outside of a Store, use the overload that takes an explicit store argument.
|
17
|
-
*/
|
18
|
-
function getKeysWithValue(
|
19
|
-
ResourceId tableId,
|
20
|
-
bytes memory staticData,
|
21
|
-
EncodedLengths encodedLengths,
|
22
|
-
bytes memory dynamicData
|
23
|
-
) view returns (bytes32[] memory keysWithValue) {
|
24
|
-
// Get the corresponding reverse mapping table
|
25
|
-
ResourceId keysWithValueTableId = getTargetTableId(MODULE_NAMESPACE, tableId);
|
26
|
-
|
27
|
-
// Get the keys with the given value
|
28
|
-
bytes memory value;
|
29
|
-
if (dynamicData.length > 0) {
|
30
|
-
value = abi.encodePacked(staticData, encodedLengths, dynamicData);
|
31
|
-
} else {
|
32
|
-
value = staticData;
|
33
|
-
}
|
34
|
-
keysWithValue = KeysWithValue.get(keysWithValueTableId, keccak256(value));
|
35
|
-
}
|
36
|
-
|
37
|
-
/**
|
38
|
-
* Get a list of keys with the given value for the given store.
|
39
|
-
*/
|
40
|
-
function getKeysWithValue(
|
41
|
-
IStore store,
|
42
|
-
ResourceId tableId,
|
43
|
-
bytes memory staticData,
|
44
|
-
EncodedLengths encodedLengths,
|
45
|
-
bytes memory dynamicData
|
46
|
-
) view returns (bytes32[] memory keysWithValue) {
|
47
|
-
// Get the corresponding reverse mapping table
|
48
|
-
ResourceId keysWithValueTableId = getTargetTableId(MODULE_NAMESPACE, tableId);
|
49
|
-
|
50
|
-
// Get the keys with the given value
|
51
|
-
bytes memory value;
|
52
|
-
if (dynamicData.length > 0) {
|
53
|
-
value = abi.encodePacked(staticData, encodedLengths, dynamicData);
|
54
|
-
} else {
|
55
|
-
value = staticData;
|
56
|
-
}
|
57
|
-
keysWithValue = KeysWithValue.get(store, keysWithValueTableId, keccak256(value));
|
58
|
-
}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
2
|
-
pragma solidity >=0.8.24;
|
3
|
-
|
4
|
-
import { TYPE_BITS } from "@latticexyz/store/src/ResourceId.sol";
|
5
|
-
import { ResourceId, WorldResourceIdInstance, NAME_BITS } from "@latticexyz/world/src/WorldResourceId.sol";
|
6
|
-
import { RESOURCE_TABLE } from "@latticexyz/world/src/worldResourceTypes.sol";
|
7
|
-
|
8
|
-
uint256 constant MODULE_NAMESPACE_BITS = 7 * 8;
|
9
|
-
uint256 constant TABLE_NAMESPACE_BITS = 7 * 8;
|
10
|
-
uint256 constant TABLE_NAME_BITS = 16 * 8;
|
11
|
-
|
12
|
-
/**
|
13
|
-
* Get a deterministic selector for the reverse mapping table for the given source table.
|
14
|
-
* The selector is constructed as follows:
|
15
|
-
* - The first 2 bytes are the resource type
|
16
|
-
* - The next 7 bytes are the module namespace
|
17
|
-
* - The next 7 bytes are the first 7 bytes of the source table namespace
|
18
|
-
* -- This is to avoid collisions between tables with the same name in different namespaces
|
19
|
-
* (Note that collisions are still possible if the first 7 bytes of the namespace are the same, in which case installing the module fails)
|
20
|
-
* - The last 16 bytes are the source table name
|
21
|
-
*/
|
22
|
-
function getTargetTableId(bytes7 moduleNamespace, ResourceId sourceTableId) pure returns (ResourceId) {
|
23
|
-
bytes16 tableName = WorldResourceIdInstance.getName(sourceTableId);
|
24
|
-
bytes7 sourceTableNamespace = bytes7(WorldResourceIdInstance.getNamespace(sourceTableId));
|
25
|
-
return
|
26
|
-
ResourceId.wrap(
|
27
|
-
bytes32(RESOURCE_TABLE) |
|
28
|
-
(bytes32(moduleNamespace) >> TYPE_BITS) |
|
29
|
-
(bytes32(sourceTableNamespace) >> (TYPE_BITS + MODULE_NAMESPACE_BITS)) |
|
30
|
-
(bytes32(tableName) >> (TYPE_BITS + MODULE_NAMESPACE_BITS + TABLE_NAMESPACE_BITS))
|
31
|
-
);
|
32
|
-
}
|