@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
 
@@ -29,30 +26,10 @@ library CallboundDelegations {
29
26
  FieldLayout constant _fieldLayout =
30
27
  FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);
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[](4);
38
- _keySchema[0] = SchemaType.ADDRESS;
39
- _keySchema[1] = SchemaType.ADDRESS;
40
- _keySchema[2] = SchemaType.BYTES32;
41
- _keySchema[3] = SchemaType.BYTES32;
42
-
43
- return SchemaLib.encode(_keySchema);
44
- }
45
-
46
- /**
47
- * @notice Get the table's value schema.
48
- * @return _valueSchema The value schema for the table.
49
- */
50
- function getValueSchema() internal pure returns (Schema) {
51
- SchemaType[] memory _valueSchema = new SchemaType[](1);
52
- _valueSchema[0] = SchemaType.UINT256;
53
-
54
- return SchemaLib.encode(_valueSchema);
55
- }
29
+ // Hex-encoded key schema of (address, address, bytes32, bytes32)
30
+ Schema constant _keySchema = Schema.wrap(0x0068040061615f5f000000000000000000000000000000000000000000000000);
31
+ // Hex-encoded value schema of (uint256)
32
+ Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
56
33
 
57
34
  /**
58
35
  * @notice Get the table's key field names.
@@ -79,14 +56,14 @@ library CallboundDelegations {
79
56
  * @notice Register the table with its config.
80
57
  */
81
58
  function register() internal {
82
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
59
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
83
60
  }
84
61
 
85
62
  /**
86
63
  * @notice Register the table with its config.
87
64
  */
88
65
  function _register() internal {
89
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
66
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
90
67
  }
91
68
 
92
69
  /**
@@ -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 SystemboundDelegations {
29
26
  FieldLayout constant _fieldLayout =
30
27
  FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);
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[](3);
38
- _keySchema[0] = SchemaType.ADDRESS;
39
- _keySchema[1] = SchemaType.ADDRESS;
40
- _keySchema[2] = SchemaType.BYTES32;
41
-
42
- return SchemaLib.encode(_keySchema);
43
- }
44
-
45
- /**
46
- * @notice Get the table's value schema.
47
- * @return _valueSchema The value schema for the table.
48
- */
49
- function getValueSchema() internal pure returns (Schema) {
50
- SchemaType[] memory _valueSchema = new SchemaType[](1);
51
- _valueSchema[0] = SchemaType.UINT256;
52
-
53
- return SchemaLib.encode(_valueSchema);
54
- }
29
+ // Hex-encoded key schema of (address, address, bytes32)
30
+ Schema constant _keySchema = Schema.wrap(0x0048030061615f00000000000000000000000000000000000000000000000000);
31
+ // Hex-encoded value schema of (uint256)
32
+ Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
55
33
 
56
34
  /**
57
35
  * @notice Get the table's key field names.
@@ -77,14 +55,14 @@ library SystemboundDelegations {
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
  /**
@@ -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,28 +23,10 @@ library TimeboundDelegations {
26
23
  FieldLayout constant _fieldLayout =
27
24
  FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);
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[](2);
35
- _keySchema[0] = SchemaType.ADDRESS;
36
- _keySchema[1] = SchemaType.ADDRESS;
37
-
38
- return SchemaLib.encode(_keySchema);
39
- }
40
-
41
- /**
42
- * @notice Get the table's value schema.
43
- * @return _valueSchema The value schema for the table.
44
- */
45
- function getValueSchema() internal pure returns (Schema) {
46
- SchemaType[] memory _valueSchema = new SchemaType[](1);
47
- _valueSchema[0] = SchemaType.UINT256;
48
-
49
- return SchemaLib.encode(_valueSchema);
50
- }
26
+ // Hex-encoded key schema of (address, address)
27
+ Schema constant _keySchema = Schema.wrap(0x0028020061610000000000000000000000000000000000000000000000000000);
28
+ // Hex-encoded value schema of (uint256)
29
+ Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
51
30
 
52
31
  /**
53
32
  * @notice Get the table's key field names.
@@ -72,14 +51,14 @@ library TimeboundDelegations {
72
51
  * @notice Register the table with its config.
73
52
  */
74
53
  function register() internal {
75
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
54
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
76
55
  }
77
56
 
78
57
  /**
79
58
  * @notice Register the table with its config.
80
59
  */
81
60
  function _register() internal {
82
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
61
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
83
62
  }
84
63
 
85
64
  /**
@@ -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 Balances {
23
20
  FieldLayout constant _fieldLayout =
24
21
  FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);
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.ADDRESS;
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.UINT256;
44
-
45
- return SchemaLib.encode(_valueSchema);
46
- }
23
+ // Hex-encoded key schema of (address)
24
+ Schema constant _keySchema = Schema.wrap(0x0014010061000000000000000000000000000000000000000000000000000000);
25
+ // Hex-encoded value schema of (uint256)
26
+ Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
47
27
 
48
28
  /**
49
29
  * @notice Get the table's key field names.
@@ -67,14 +47,14 @@ library Balances {
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,26 +20,10 @@ library UniqueEntity {
23
20
  FieldLayout constant _fieldLayout =
24
21
  FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);
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[](0);
32
-
33
- return SchemaLib.encode(_keySchema);
34
- }
35
-
36
- /**
37
- * @notice Get the table's value schema.
38
- * @return _valueSchema The value schema for the table.
39
- */
40
- function getValueSchema() internal pure returns (Schema) {
41
- SchemaType[] memory _valueSchema = new SchemaType[](1);
42
- _valueSchema[0] = SchemaType.UINT256;
43
-
44
- return SchemaLib.encode(_valueSchema);
45
- }
23
+ // Hex-encoded key schema of ()
24
+ Schema constant _keySchema = Schema.wrap(0x0000000000000000000000000000000000000000000000000000000000000000);
25
+ // Hex-encoded value schema of (uint256)
26
+ Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
46
27
 
47
28
  /**
48
29
  * @notice Get the table's key field names.
@@ -65,21 +46,21 @@ library UniqueEntity {
65
46
  * @notice Register the table with its config.
66
47
  */
67
48
  function register(ResourceId _tableId) internal {
68
- StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
49
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
69
50
  }
70
51
 
71
52
  /**
72
53
  * @notice Register the table with its config.
73
54
  */
74
55
  function _register(ResourceId _tableId) internal {
75
- StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
56
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
76
57
  }
77
58
 
78
59
  /**
79
60
  * @notice Register the table with its config (using the specified store).
80
61
  */
81
62
  function register(IStore _store, ResourceId _tableId) internal {
82
- _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames());
63
+ _store.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
83
64
  }
84
65
 
85
66
  /**