@latticexyz/world-modules 2.0.0-main-59acc3cd → 2.0.0-main-3042f86e

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 (140) hide show
  1. package/out/AccessControl.sol/AccessControl.json +1 -1
  2. package/out/AccessControlLib.sol/AccessControlLib.json +1 -1
  3. package/out/AccessManagementSystem.sol/AccessManagementSystem.json +1 -1
  4. package/out/AddressArray.sol/AddressArray.json +1 -1
  5. package/out/Allowances.sol/Allowances.json +1 -1
  6. package/out/BalanceTransferSystem.sol/BalanceTransferSystem.json +1 -1
  7. package/out/Balances.sol/Balances.json +1 -1
  8. package/out/BatchCallSystem.sol/BatchCallSystem.json +1 -1
  9. package/out/Bool.sol/Bool.json +1 -1
  10. package/out/CallboundDelegationControl.sol/CallboundDelegationControl.json +1 -1
  11. package/out/CallboundDelegations.sol/CallboundDelegations.json +1 -1
  12. package/out/Delegation.sol/Delegation.json +1 -1
  13. package/out/DelegationControl.sol/DelegationControl.json +1 -1
  14. package/out/DelegationControlMock.sol/DelegationControlMock.json +1 -1
  15. package/out/ERC20.t.sol/ERC20Test.json +1 -1
  16. package/out/ERC20Metadata.sol/ERC20Metadata.json +1 -1
  17. package/out/ERC20Module.sol/ERC20Module.json +1 -1
  18. package/out/ERC20Module.sol/ERC20ModuleRegistrationLibrary.json +1 -1
  19. package/out/ERC20Registry.sol/ERC20Registry.json +1 -1
  20. package/out/ERC20System.sol/ERC20System.json +1 -1
  21. package/out/ERC721.t.sol/ERC721Recipient.json +1 -1
  22. package/out/ERC721.t.sol/ERC721Test.json +1 -1
  23. package/out/ERC721.t.sol/ERC721TokenReceiver.json +1 -1
  24. package/out/ERC721.t.sol/NonERC721Recipient.json +1 -1
  25. package/out/ERC721.t.sol/RevertingERC721Recipient.json +1 -1
  26. package/out/ERC721.t.sol/WrongReturnDataERC721Recipient.json +1 -1
  27. package/out/ERC721Metadata.sol/ERC721Metadata.json +1 -1
  28. package/out/ERC721Module.sol/ERC721Module.json +1 -1
  29. package/out/ERC721Module.sol/ERC721ModuleRegistrationLibrary.json +1 -1
  30. package/out/ERC721Registry.sol/ERC721Registry.json +1 -1
  31. package/out/ERC721System.sol/ERC721System.json +1 -1
  32. package/out/FunctionSelectors.sol/FunctionSelectors.json +1 -1
  33. package/out/FunctionSignatures.sol/FunctionSignatures.json +1 -1
  34. package/out/Hook.sol/HookInstance.json +1 -1
  35. package/out/Hook.sol/HookLib.json +1 -1
  36. package/out/Hooks.sol/Hooks.json +1 -1
  37. package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.json +1 -1
  38. package/out/InitModule.sol/InitModule.json +1 -1
  39. package/out/InitModuleAddress.sol/InitModuleAddress.json +1 -1
  40. package/out/InstalledModules.sol/InstalledModules.json +1 -1
  41. package/out/KeysInTable.sol/KeysInTable.json +1 -1
  42. package/out/KeysInTableHook.sol/KeysInTableHook.json +1 -1
  43. package/out/KeysInTableModule.sol/KeysInTableModule.abi.json +0 -16
  44. package/out/KeysInTableModule.sol/KeysInTableModule.abi.json.d.ts +0 -16
  45. package/out/KeysInTableModule.sol/KeysInTableModule.json +1 -1
  46. package/out/KeysInTableModule.t.sol/KeysInTableModuleTest.json +1 -1
  47. package/out/KeysWithValue.sol/KeysWithValue.json +1 -1
  48. package/out/KeysWithValueHook.sol/KeysWithValueHook.json +1 -1
  49. package/out/KeysWithValueModule.sol/KeysWithValueModule.abi.json +0 -16
  50. package/out/KeysWithValueModule.sol/KeysWithValueModule.abi.json.d.ts +0 -16
  51. package/out/KeysWithValueModule.sol/KeysWithValueModule.json +1 -1
  52. package/out/KeysWithValueModule.t.sol/KeysWithValueModuleTest.json +1 -1
  53. package/out/Module.sol/Module.json +1 -1
  54. package/out/ModuleInstallationSystem.sol/ModuleInstallationSystem.json +1 -1
  55. package/out/NamespaceDelegationControl.sol/NamespaceDelegationControl.json +1 -1
  56. package/out/NamespaceOwner.sol/NamespaceOwner.json +1 -1
  57. package/out/OperatorApproval.sol/OperatorApproval.json +1 -1
  58. package/out/Owners.sol/Owners.json +1 -1
  59. package/out/Puppet.sol/Puppet.json +1 -1
  60. package/out/PuppetDelegationControl.sol/PuppetDelegationControl.json +1 -1
  61. package/out/PuppetFactorySystem.sol/PuppetFactorySystem.json +1 -1
  62. package/out/PuppetMaster.sol/PuppetMaster.json +1 -1
  63. package/out/PuppetModule.sol/PuppetModule.json +1 -1
  64. package/out/PuppetModule.t.sol/PuppetModuleTest.json +1 -1
  65. package/out/PuppetModule.t.sol/PuppetTestSystem.json +1 -1
  66. package/out/PuppetRegistry.sol/PuppetRegistry.json +1 -1
  67. package/out/RegistrationSystem.sol/RegistrationSystem.json +1 -1
  68. package/out/ResourceAccess.sol/ResourceAccess.json +1 -1
  69. package/out/ResourceIds.sol/ResourceIds.json +1 -1
  70. package/out/StandardDelegationsModule.sol/StandardDelegationsModule.json +1 -1
  71. package/out/StandardDelegationsModule.t.sol/StandardDelegationsModuleTest.json +1 -1
  72. package/out/StoreCore.sol/StoreCore.json +1 -1
  73. package/out/StoreCore.sol/StoreCoreInternal.json +1 -1
  74. package/out/StoreData.sol/StoreData.json +1 -1
  75. package/out/StoreHooks.sol/StoreHooks.json +1 -1
  76. package/out/StoreRead.sol/StoreRead.json +1 -1
  77. package/out/StoreRegistrationSystem.sol/StoreRegistrationSystem.json +1 -1
  78. package/out/StoreSwitch.sol/StoreSwitch.json +1 -1
  79. package/out/System.sol/System.json +1 -1
  80. package/out/SystemCall.sol/SystemCall.json +1 -1
  81. package/out/SystemHooks.sol/SystemHooks.json +1 -1
  82. package/out/SystemRegistry.sol/SystemRegistry.json +1 -1
  83. package/out/SystemSwitch.sol/SystemSwitch.json +1 -1
  84. package/out/SystemSwitch.t.sol/EchoSystem.json +1 -1
  85. package/out/SystemSwitch.t.sol/SystemSwitchTest.abi.json +0 -16
  86. package/out/SystemSwitch.t.sol/SystemSwitchTest.abi.json.d.ts +0 -16
  87. package/out/SystemSwitch.t.sol/SystemSwitchTest.json +1 -1
  88. package/out/SystemboundDelegationControl.sol/SystemboundDelegationControl.json +1 -1
  89. package/out/SystemboundDelegations.sol/SystemboundDelegations.json +1 -1
  90. package/out/Systems.sol/Systems.json +1 -1
  91. package/out/Tables.sol/Tables.json +1 -1
  92. package/out/TimeboundDelegationControl.sol/TimeboundDelegationControl.json +1 -1
  93. package/out/TimeboundDelegations.sol/TimeboundDelegations.json +1 -1
  94. package/out/TokenApproval.sol/TokenApproval.json +1 -1
  95. package/out/TokenURI.sol/TokenURI.json +1 -1
  96. package/out/TotalSupply.sol/TotalSupply.json +1 -1
  97. package/out/TwoFields.sol/TwoFields.json +1 -1
  98. package/out/UniqueEntity.sol/UniqueEntity.json +1 -1
  99. package/out/UniqueEntityModule.sol/UniqueEntityModule.json +1 -1
  100. package/out/UniqueEntityModule.t.sol/UniqueEntityModuleTest.json +1 -1
  101. package/out/UniqueEntityModule.t.sol/UniqueEntityTestSystem.json +1 -1
  102. package/out/UniqueEntitySystem.sol/UniqueEntitySystem.json +1 -1
  103. package/out/UsedKeysIndex.sol/UsedKeysIndex.json +1 -1
  104. package/out/UserDelegationControl.sol/UserDelegationControl.json +1 -1
  105. package/out/World.sol/World.json +1 -1
  106. package/out/World.t.sol/EchoSystemHook.json +1 -1
  107. package/out/World.t.sol/IWorldTestSystem.json +1 -1
  108. package/out/World.t.sol/PayableFallbackSystem.json +1 -1
  109. package/out/World.t.sol/RevertSystemHook.json +1 -1
  110. package/out/World.t.sol/WorldTest.json +1 -1
  111. package/out/World.t.sol/WorldTestSystem.json +1 -1
  112. package/out/WorldContext.sol/WorldContextConsumer.json +1 -1
  113. package/out/WorldContext.sol/WorldContextConsumerLib.json +1 -1
  114. package/out/WorldContext.sol/WorldContextProviderLib.json +1 -1
  115. package/out/WorldRegistrationSystem.sol/WorldRegistrationSystem.json +1 -1
  116. package/out/interfaces/IBaseWorld.sol/IBaseWorld.json +1 -1
  117. package/out/query.t.sol/QueryTest.json +1 -1
  118. package/out/tables/Balances.sol/Balances.json +1 -1
  119. package/package.json +8 -8
  120. package/src/modules/erc20-puppet/tables/Allowances.sol +8 -29
  121. package/src/modules/erc20-puppet/tables/ERC20Metadata.sol +8 -29
  122. package/src/modules/erc20-puppet/tables/ERC20Registry.sol +8 -28
  123. package/src/modules/erc20-puppet/tables/TotalSupply.sol +8 -27
  124. package/src/modules/erc721-puppet/tables/ERC721Metadata.sol +8 -29
  125. package/src/modules/erc721-puppet/tables/ERC721Registry.sol +8 -28
  126. package/src/modules/erc721-puppet/tables/OperatorApproval.sol +8 -29
  127. package/src/modules/erc721-puppet/tables/Owners.sol +8 -28
  128. package/src/modules/erc721-puppet/tables/TokenApproval.sol +8 -28
  129. package/src/modules/erc721-puppet/tables/TokenURI.sol +8 -28
  130. package/src/modules/keysintable/KeysInTableModule.sol +4 -4
  131. package/src/modules/keysintable/tables/KeysInTable.sol +9 -33
  132. package/src/modules/keysintable/tables/UsedKeysIndex.sol +9 -31
  133. package/src/modules/keyswithvalue/KeysWithValueModule.sol +2 -2
  134. package/src/modules/keyswithvalue/tables/KeysWithValue.sol +9 -29
  135. package/src/modules/puppet/tables/PuppetRegistry.sol +8 -28
  136. package/src/modules/std-delegations/tables/CallboundDelegations.sol +8 -31
  137. package/src/modules/std-delegations/tables/SystemboundDelegations.sol +8 -30
  138. package/src/modules/std-delegations/tables/TimeboundDelegations.sol +8 -29
  139. package/src/modules/tokens/tables/Balances.sol +8 -28
  140. package/src/modules/uniqueentity/tables/UniqueEntity.sol +9 -28
@@ -3,9 +3,6 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- // Import schema type
7
- import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol";
8
-
9
6
  // Import store internals
10
7
  import { IStore } from "@latticexyz/store/src/IStore.sol";
11
8
  import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
@@ -14,8 +11,8 @@ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
14
11
  import { Memory } from "@latticexyz/store/src/Memory.sol";
15
12
  import { SliceLib } from "@latticexyz/store/src/Slice.sol";
16
13
  import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
17
- import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol";
18
- import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
19
16
  import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
20
17
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
21
18
 
@@ -23,28 +20,10 @@ library OperatorApproval {
23
20
  FieldLayout constant _fieldLayout =
24
21
  FieldLayout.wrap(0x0001010001000000000000000000000000000000000000000000000000000000);
25
22
 
26
- /**
27
- * @notice Get the table's key schema.
28
- * @return _keySchema The key schema for the table.
29
- */
30
- function getKeySchema() internal pure returns (Schema) {
31
- SchemaType[] memory _keySchema = new SchemaType[](2);
32
- _keySchema[0] = SchemaType.ADDRESS;
33
- _keySchema[1] = SchemaType.ADDRESS;
34
-
35
- return SchemaLib.encode(_keySchema);
36
- }
37
-
38
- /**
39
- * @notice Get the table's value schema.
40
- * @return _valueSchema The value schema for the table.
41
- */
42
- function getValueSchema() internal pure returns (Schema) {
43
- SchemaType[] memory _valueSchema = new SchemaType[](1);
44
- _valueSchema[0] = SchemaType.BOOL;
45
-
46
- return SchemaLib.encode(_valueSchema);
47
- }
23
+ // Hex-encoded key schema of (address, address)
24
+ Schema constant _keySchema = Schema.wrap(0x0028020061610000000000000000000000000000000000000000000000000000);
25
+ // Hex-encoded value schema of (bool)
26
+ Schema constant _valueSchema = Schema.wrap(0x0001010060000000000000000000000000000000000000000000000000000000);
48
27
 
49
28
  /**
50
29
  * @notice Get the table's key field names.
@@ -69,14 +48,14 @@ library OperatorApproval {
69
48
  * @notice Register the table with its config.
70
49
  */
71
50
  function register(ResourceId _tableId) internal {
72
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
51
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
73
52
  }
74
53
 
75
54
  /**
76
55
  * @notice Register the table with its config.
77
56
  */
78
57
  function _register(ResourceId _tableId) internal {
79
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
58
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
80
59
  }
81
60
 
82
61
  /**
@@ -3,9 +3,6 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- // Import schema type
7
- import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol";
8
-
9
6
  // Import store internals
10
7
  import { IStore } from "@latticexyz/store/src/IStore.sol";
11
8
  import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
@@ -14,8 +11,8 @@ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
14
11
  import { Memory } from "@latticexyz/store/src/Memory.sol";
15
12
  import { SliceLib } from "@latticexyz/store/src/Slice.sol";
16
13
  import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
17
- import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol";
18
- import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
19
16
  import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
20
17
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
21
18
 
@@ -23,27 +20,10 @@ library Owners {
23
20
  FieldLayout constant _fieldLayout =
24
21
  FieldLayout.wrap(0x0014010014000000000000000000000000000000000000000000000000000000);
25
22
 
26
- /**
27
- * @notice Get the table's key schema.
28
- * @return _keySchema The key schema for the table.
29
- */
30
- function getKeySchema() internal pure returns (Schema) {
31
- SchemaType[] memory _keySchema = new SchemaType[](1);
32
- _keySchema[0] = SchemaType.UINT256;
33
-
34
- return SchemaLib.encode(_keySchema);
35
- }
36
-
37
- /**
38
- * @notice Get the table's value schema.
39
- * @return _valueSchema The value schema for the table.
40
- */
41
- function getValueSchema() internal pure returns (Schema) {
42
- SchemaType[] memory _valueSchema = new SchemaType[](1);
43
- _valueSchema[0] = SchemaType.ADDRESS;
44
-
45
- return SchemaLib.encode(_valueSchema);
46
- }
23
+ // Hex-encoded key schema of (uint256)
24
+ Schema constant _keySchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
25
+ // Hex-encoded value schema of (address)
26
+ Schema constant _valueSchema = Schema.wrap(0x0014010061000000000000000000000000000000000000000000000000000000);
47
27
 
48
28
  /**
49
29
  * @notice Get the table's key field names.
@@ -67,14 +47,14 @@ library Owners {
67
47
  * @notice Register the table with its config.
68
48
  */
69
49
  function register(ResourceId _tableId) internal {
70
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
50
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
71
51
  }
72
52
 
73
53
  /**
74
54
  * @notice Register the table with its config.
75
55
  */
76
56
  function _register(ResourceId _tableId) internal {
77
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
57
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
78
58
  }
79
59
 
80
60
  /**
@@ -3,9 +3,6 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- // Import schema type
7
- import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol";
8
-
9
6
  // Import store internals
10
7
  import { IStore } from "@latticexyz/store/src/IStore.sol";
11
8
  import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
@@ -14,8 +11,8 @@ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
14
11
  import { Memory } from "@latticexyz/store/src/Memory.sol";
15
12
  import { SliceLib } from "@latticexyz/store/src/Slice.sol";
16
13
  import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
17
- import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol";
18
- import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
19
16
  import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
20
17
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
21
18
 
@@ -23,27 +20,10 @@ library TokenApproval {
23
20
  FieldLayout constant _fieldLayout =
24
21
  FieldLayout.wrap(0x0014010014000000000000000000000000000000000000000000000000000000);
25
22
 
26
- /**
27
- * @notice Get the table's key schema.
28
- * @return _keySchema The key schema for the table.
29
- */
30
- function getKeySchema() internal pure returns (Schema) {
31
- SchemaType[] memory _keySchema = new SchemaType[](1);
32
- _keySchema[0] = SchemaType.UINT256;
33
-
34
- return SchemaLib.encode(_keySchema);
35
- }
36
-
37
- /**
38
- * @notice Get the table's value schema.
39
- * @return _valueSchema The value schema for the table.
40
- */
41
- function getValueSchema() internal pure returns (Schema) {
42
- SchemaType[] memory _valueSchema = new SchemaType[](1);
43
- _valueSchema[0] = SchemaType.ADDRESS;
44
-
45
- return SchemaLib.encode(_valueSchema);
46
- }
23
+ // Hex-encoded key schema of (uint256)
24
+ Schema constant _keySchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
25
+ // Hex-encoded value schema of (address)
26
+ Schema constant _valueSchema = Schema.wrap(0x0014010061000000000000000000000000000000000000000000000000000000);
47
27
 
48
28
  /**
49
29
  * @notice Get the table's key field names.
@@ -67,14 +47,14 @@ library TokenApproval {
67
47
  * @notice Register the table with its config.
68
48
  */
69
49
  function register(ResourceId _tableId) internal {
70
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
50
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
71
51
  }
72
52
 
73
53
  /**
74
54
  * @notice Register the table with its config.
75
55
  */
76
56
  function _register(ResourceId _tableId) internal {
77
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
57
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
78
58
  }
79
59
 
80
60
  /**
@@ -3,9 +3,6 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- // Import schema type
7
- import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol";
8
-
9
6
  // Import store internals
10
7
  import { IStore } from "@latticexyz/store/src/IStore.sol";
11
8
  import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
@@ -14,8 +11,8 @@ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
14
11
  import { Memory } from "@latticexyz/store/src/Memory.sol";
15
12
  import { SliceLib } from "@latticexyz/store/src/Slice.sol";
16
13
  import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
17
- import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol";
18
- import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
19
16
  import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
20
17
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
21
18
 
@@ -23,27 +20,10 @@ library TokenURI {
23
20
  FieldLayout constant _fieldLayout =
24
21
  FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);
25
22
 
26
- /**
27
- * @notice Get the table's key schema.
28
- * @return _keySchema The key schema for the table.
29
- */
30
- function getKeySchema() internal pure returns (Schema) {
31
- SchemaType[] memory _keySchema = new SchemaType[](1);
32
- _keySchema[0] = SchemaType.UINT256;
33
-
34
- return SchemaLib.encode(_keySchema);
35
- }
36
-
37
- /**
38
- * @notice Get the table's value schema.
39
- * @return _valueSchema The value schema for the table.
40
- */
41
- function getValueSchema() internal pure returns (Schema) {
42
- SchemaType[] memory _valueSchema = new SchemaType[](1);
43
- _valueSchema[0] = SchemaType.STRING;
44
-
45
- return SchemaLib.encode(_valueSchema);
46
- }
23
+ // Hex-encoded key schema of (uint256)
24
+ Schema constant _keySchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
25
+ // Hex-encoded value schema of (string)
26
+ Schema constant _valueSchema = Schema.wrap(0x00000001c5000000000000000000000000000000000000000000000000000000);
47
27
 
48
28
  /**
49
29
  * @notice Get the table's key field names.
@@ -67,14 +47,14 @@ library TokenURI {
67
47
  * @notice Register the table with its config.
68
48
  */
69
49
  function register(ResourceId _tableId) internal {
70
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
50
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
71
51
  }
72
52
 
73
53
  /**
74
54
  * @notice Register the table with its config.
75
55
  */
76
56
  function _register(ResourceId _tableId) internal {
77
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
57
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
78
58
  }
79
59
 
80
60
  /**
@@ -55,8 +55,8 @@ contract KeysInTableModule is Module {
55
55
  (
56
56
  KeysInTable._tableId,
57
57
  KeysInTable._fieldLayout,
58
- KeysInTable.getKeySchema(),
59
- KeysInTable.getValueSchema(),
58
+ KeysInTable._keySchema,
59
+ KeysInTable._valueSchema,
60
60
  KeysInTable.getKeyNames(),
61
61
  KeysInTable.getFieldNames()
62
62
  )
@@ -70,8 +70,8 @@ contract KeysInTableModule is Module {
70
70
  (
71
71
  UsedKeysIndex._tableId,
72
72
  UsedKeysIndex._fieldLayout,
73
- UsedKeysIndex.getKeySchema(),
74
- UsedKeysIndex.getValueSchema(),
73
+ UsedKeysIndex._keySchema,
74
+ UsedKeysIndex._valueSchema,
75
75
  UsedKeysIndex.getKeyNames(),
76
76
  UsedKeysIndex.getFieldNames()
77
77
  )
@@ -3,9 +3,6 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- // Import schema type
7
- import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol";
8
-
9
6
  // Import store internals
10
7
  import { IStore } from "@latticexyz/store/src/IStore.sol";
11
8
  import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
@@ -14,8 +11,8 @@ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
14
11
  import { Memory } from "@latticexyz/store/src/Memory.sol";
15
12
  import { SliceLib } from "@latticexyz/store/src/Slice.sol";
16
13
  import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
17
- import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol";
18
- import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
19
16
  import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
20
17
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
21
18
 
@@ -37,31 +34,10 @@ library KeysInTable {
37
34
  FieldLayout constant _fieldLayout =
38
35
  FieldLayout.wrap(0x0000000500000000000000000000000000000000000000000000000000000000);
39
36
 
40
- /**
41
- * @notice Get the table's key schema.
42
- * @return _keySchema The key schema for the table.
43
- */
44
- function getKeySchema() internal pure returns (Schema) {
45
- SchemaType[] memory _keySchema = new SchemaType[](1);
46
- _keySchema[0] = SchemaType.BYTES32;
47
-
48
- return SchemaLib.encode(_keySchema);
49
- }
50
-
51
- /**
52
- * @notice Get the table's value schema.
53
- * @return _valueSchema The value schema for the table.
54
- */
55
- function getValueSchema() internal pure returns (Schema) {
56
- SchemaType[] memory _valueSchema = new SchemaType[](5);
57
- _valueSchema[0] = SchemaType.BYTES32_ARRAY;
58
- _valueSchema[1] = SchemaType.BYTES32_ARRAY;
59
- _valueSchema[2] = SchemaType.BYTES32_ARRAY;
60
- _valueSchema[3] = SchemaType.BYTES32_ARRAY;
61
- _valueSchema[4] = SchemaType.BYTES32_ARRAY;
62
-
63
- return SchemaLib.encode(_valueSchema);
64
- }
37
+ // Hex-encoded key schema of (bytes32)
38
+ Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);
39
+ // Hex-encoded value schema of (bytes32[], bytes32[], bytes32[], bytes32[], bytes32[])
40
+ Schema constant _valueSchema = Schema.wrap(0x00000005c1c1c1c1c10000000000000000000000000000000000000000000000);
65
41
 
66
42
  /**
67
43
  * @notice Get the table's key field names.
@@ -89,21 +65,21 @@ library KeysInTable {
89
65
  * @notice Register the table with its config.
90
66
  */
91
67
  function register() internal {
92
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
68
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
93
69
  }
94
70
 
95
71
  /**
96
72
  * @notice Register the table with its config.
97
73
  */
98
74
  function _register() internal {
99
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
75
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
100
76
  }
101
77
 
102
78
  /**
103
79
  * @notice Register the table with its config (using the specified store).
104
80
  */
105
81
  function register(IStore _store) internal {
106
- _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
82
+ _store.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
107
83
  }
108
84
 
109
85
  /**
@@ -3,9 +3,6 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- // Import schema type
7
- import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol";
8
-
9
6
  // Import store internals
10
7
  import { IStore } from "@latticexyz/store/src/IStore.sol";
11
8
  import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
@@ -14,8 +11,8 @@ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
14
11
  import { Memory } from "@latticexyz/store/src/Memory.sol";
15
12
  import { SliceLib } from "@latticexyz/store/src/Slice.sol";
16
13
  import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
17
- import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol";
18
- import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
19
16
  import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
20
17
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
21
18
 
@@ -29,29 +26,10 @@ library UsedKeysIndex {
29
26
  FieldLayout constant _fieldLayout =
30
27
  FieldLayout.wrap(0x0006020001050000000000000000000000000000000000000000000000000000);
31
28
 
32
- /**
33
- * @notice Get the table's key schema.
34
- * @return _keySchema The key schema for the table.
35
- */
36
- function getKeySchema() internal pure returns (Schema) {
37
- SchemaType[] memory _keySchema = new SchemaType[](2);
38
- _keySchema[0] = SchemaType.BYTES32;
39
- _keySchema[1] = SchemaType.BYTES32;
40
-
41
- return SchemaLib.encode(_keySchema);
42
- }
43
-
44
- /**
45
- * @notice Get the table's value schema.
46
- * @return _valueSchema The value schema for the table.
47
- */
48
- function getValueSchema() internal pure returns (Schema) {
49
- SchemaType[] memory _valueSchema = new SchemaType[](2);
50
- _valueSchema[0] = SchemaType.BOOL;
51
- _valueSchema[1] = SchemaType.UINT40;
52
-
53
- return SchemaLib.encode(_valueSchema);
54
- }
29
+ // Hex-encoded key schema of (bytes32, bytes32)
30
+ Schema constant _keySchema = Schema.wrap(0x004002005f5f0000000000000000000000000000000000000000000000000000);
31
+ // Hex-encoded value schema of (bool, uint40)
32
+ Schema constant _valueSchema = Schema.wrap(0x0006020060040000000000000000000000000000000000000000000000000000);
55
33
 
56
34
  /**
57
35
  * @notice Get the table's key field names.
@@ -77,21 +55,21 @@ library UsedKeysIndex {
77
55
  * @notice Register the table with its config.
78
56
  */
79
57
  function register() internal {
80
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
58
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
81
59
  }
82
60
 
83
61
  /**
84
62
  * @notice Register the table with its config.
85
63
  */
86
64
  function _register() internal {
87
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
65
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
88
66
  }
89
67
 
90
68
  /**
91
69
  * @notice Register the table with its config (using the specified store).
92
70
  */
93
71
  function register(IStore _store) internal {
94
- _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
72
+ _store.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
95
73
  }
96
74
 
97
75
  /**
@@ -61,8 +61,8 @@ contract KeysWithValueModule is Module {
61
61
  (
62
62
  targetTableId,
63
63
  KeysWithValue._fieldLayout,
64
- KeysWithValue.getKeySchema(),
65
- KeysWithValue.getValueSchema(),
64
+ KeysWithValue._keySchema,
65
+ KeysWithValue._valueSchema,
66
66
  KeysWithValue.getKeyNames(),
67
67
  KeysWithValue.getFieldNames()
68
68
  )
@@ -3,9 +3,6 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- // Import schema type
7
- import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol";
8
-
9
6
  // Import store internals
10
7
  import { IStore } from "@latticexyz/store/src/IStore.sol";
11
8
  import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
@@ -14,8 +11,8 @@ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
14
11
  import { Memory } from "@latticexyz/store/src/Memory.sol";
15
12
  import { SliceLib } from "@latticexyz/store/src/Slice.sol";
16
13
  import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
17
- import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol";
18
- import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
19
16
  import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
20
17
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
21
18
 
@@ -23,27 +20,10 @@ library KeysWithValue {
23
20
  FieldLayout constant _fieldLayout =
24
21
  FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);
25
22
 
26
- /**
27
- * @notice Get the table's key schema.
28
- * @return _keySchema The key schema for the table.
29
- */
30
- function getKeySchema() internal pure returns (Schema) {
31
- SchemaType[] memory _keySchema = new SchemaType[](1);
32
- _keySchema[0] = SchemaType.BYTES32;
33
-
34
- return SchemaLib.encode(_keySchema);
35
- }
36
-
37
- /**
38
- * @notice Get the table's value schema.
39
- * @return _valueSchema The value schema for the table.
40
- */
41
- function getValueSchema() internal pure returns (Schema) {
42
- SchemaType[] memory _valueSchema = new SchemaType[](1);
43
- _valueSchema[0] = SchemaType.BYTES32_ARRAY;
44
-
45
- return SchemaLib.encode(_valueSchema);
46
- }
23
+ // Hex-encoded key schema of (bytes32)
24
+ Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);
25
+ // Hex-encoded value schema of (bytes32[])
26
+ Schema constant _valueSchema = Schema.wrap(0x00000001c1000000000000000000000000000000000000000000000000000000);
47
27
 
48
28
  /**
49
29
  * @notice Get the table's key field names.
@@ -67,21 +47,21 @@ library KeysWithValue {
67
47
  * @notice Register the table with its config.
68
48
  */
69
49
  function register(ResourceId _tableId) internal {
70
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
50
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
71
51
  }
72
52
 
73
53
  /**
74
54
  * @notice Register the table with its config.
75
55
  */
76
56
  function _register(ResourceId _tableId) internal {
77
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
57
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
78
58
  }
79
59
 
80
60
  /**
81
61
  * @notice Register the table with its config (using the specified store).
82
62
  */
83
63
  function register(IStore _store, ResourceId _tableId) internal {
84
- _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
64
+ _store.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
85
65
  }
86
66
 
87
67
  /**
@@ -3,9 +3,6 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- // Import schema type
7
- import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol";
8
-
9
6
  // Import store internals
10
7
  import { IStore } from "@latticexyz/store/src/IStore.sol";
11
8
  import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
@@ -14,8 +11,8 @@ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
14
11
  import { Memory } from "@latticexyz/store/src/Memory.sol";
15
12
  import { SliceLib } from "@latticexyz/store/src/Slice.sol";
16
13
  import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
17
- import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol";
18
- import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
19
16
  import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
20
17
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
21
18
 
@@ -26,27 +23,10 @@ library PuppetRegistry {
26
23
  FieldLayout constant _fieldLayout =
27
24
  FieldLayout.wrap(0x0014010014000000000000000000000000000000000000000000000000000000);
28
25
 
29
- /**
30
- * @notice Get the table's key schema.
31
- * @return _keySchema The key schema for the table.
32
- */
33
- function getKeySchema() internal pure returns (Schema) {
34
- SchemaType[] memory _keySchema = new SchemaType[](1);
35
- _keySchema[0] = SchemaType.BYTES32;
36
-
37
- return SchemaLib.encode(_keySchema);
38
- }
39
-
40
- /**
41
- * @notice Get the table's value schema.
42
- * @return _valueSchema The value schema for the table.
43
- */
44
- function getValueSchema() internal pure returns (Schema) {
45
- SchemaType[] memory _valueSchema = new SchemaType[](1);
46
- _valueSchema[0] = SchemaType.ADDRESS;
47
-
48
- return SchemaLib.encode(_valueSchema);
49
- }
26
+ // Hex-encoded key schema of (bytes32)
27
+ Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);
28
+ // Hex-encoded value schema of (address)
29
+ Schema constant _valueSchema = Schema.wrap(0x0014010061000000000000000000000000000000000000000000000000000000);
50
30
 
51
31
  /**
52
32
  * @notice Get the table's key field names.
@@ -70,14 +50,14 @@ library PuppetRegistry {
70
50
  * @notice Register the table with its config.
71
51
  */
72
52
  function register(ResourceId _tableId) internal {
73
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
53
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
74
54
  }
75
55
 
76
56
  /**
77
57
  * @notice Register the table with its config.
78
58
  */
79
59
  function _register(ResourceId _tableId) internal {
80
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
60
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
81
61
  }
82
62
 
83
63
  /**