@latticexyz/world-modules 2.0.0-main-2699630c → 2.0.0-main-747d8d1b

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latticexyz/world-modules",
3
- "version": "2.0.0-main-2699630c",
3
+ "version": "2.0.0-main-747d8d1b",
4
4
  "description": "World modules",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,11 +15,11 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "zod": "^3.21.4",
18
- "@latticexyz/common": "2.0.0-main-2699630c",
19
- "@latticexyz/config": "2.0.0-main-2699630c",
20
- "@latticexyz/schema-type": "2.0.0-main-2699630c",
21
- "@latticexyz/store": "2.0.0-main-2699630c",
22
- "@latticexyz/world": "2.0.0-main-2699630c"
18
+ "@latticexyz/common": "2.0.0-main-747d8d1b",
19
+ "@latticexyz/config": "2.0.0-main-747d8d1b",
20
+ "@latticexyz/schema-type": "2.0.0-main-747d8d1b",
21
+ "@latticexyz/store": "2.0.0-main-747d8d1b",
22
+ "@latticexyz/world": "2.0.0-main-747d8d1b"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/ejs": "^3.1.1",
@@ -34,8 +34,8 @@
34
34
  "tsup": "^6.7.0",
35
35
  "tsx": "^3.12.6",
36
36
  "vitest": "0.31.4",
37
- "@latticexyz/abi-ts": "2.0.0-main-2699630c",
38
- "@latticexyz/gas-report": "2.0.0-main-2699630c"
37
+ "@latticexyz/abi-ts": "2.0.0-main-747d8d1b",
38
+ "@latticexyz/gas-report": "2.0.0-main-747d8d1b"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -73,7 +73,7 @@ library ERC20Registry {
73
73
  */
74
74
  function getFieldNames() internal pure returns (string[] memory fieldNames) {
75
75
  fieldNames = new string[](1);
76
- fieldNames[0] = "erc20Address";
76
+ fieldNames[0] = "tokenAddress";
77
77
  }
78
78
 
79
79
  /**
@@ -91,9 +91,9 @@ library ERC20Registry {
91
91
  }
92
92
 
93
93
  /**
94
- * @notice Get erc20Address.
94
+ * @notice Get tokenAddress.
95
95
  */
96
- function getErc20Address(ResourceId _tableId, ResourceId namespaceId) internal view returns (address erc20Address) {
96
+ function getTokenAddress(ResourceId _tableId, ResourceId namespaceId) internal view returns (address tokenAddress) {
97
97
  bytes32[] memory _keyTuple = new bytes32[](1);
98
98
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
99
99
 
@@ -102,9 +102,9 @@ library ERC20Registry {
102
102
  }
103
103
 
104
104
  /**
105
- * @notice Get erc20Address.
105
+ * @notice Get tokenAddress.
106
106
  */
107
- function _getErc20Address(ResourceId _tableId, ResourceId namespaceId) internal view returns (address erc20Address) {
107
+ function _getTokenAddress(ResourceId _tableId, ResourceId namespaceId) internal view returns (address tokenAddress) {
108
108
  bytes32[] memory _keyTuple = new bytes32[](1);
109
109
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
110
110
 
@@ -113,9 +113,9 @@ library ERC20Registry {
113
113
  }
114
114
 
115
115
  /**
116
- * @notice Get erc20Address.
116
+ * @notice Get tokenAddress.
117
117
  */
118
- function get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address erc20Address) {
118
+ function get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address tokenAddress) {
119
119
  bytes32[] memory _keyTuple = new bytes32[](1);
120
120
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
121
121
 
@@ -124,9 +124,9 @@ library ERC20Registry {
124
124
  }
125
125
 
126
126
  /**
127
- * @notice Get erc20Address.
127
+ * @notice Get tokenAddress.
128
128
  */
129
- function _get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address erc20Address) {
129
+ function _get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address tokenAddress) {
130
130
  bytes32[] memory _keyTuple = new bytes32[](1);
131
131
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
132
132
 
@@ -135,43 +135,43 @@ library ERC20Registry {
135
135
  }
136
136
 
137
137
  /**
138
- * @notice Set erc20Address.
138
+ * @notice Set tokenAddress.
139
139
  */
140
- function setErc20Address(ResourceId _tableId, ResourceId namespaceId, address erc20Address) internal {
140
+ function setTokenAddress(ResourceId _tableId, ResourceId namespaceId, address tokenAddress) internal {
141
141
  bytes32[] memory _keyTuple = new bytes32[](1);
142
142
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
143
143
 
144
- StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((erc20Address)), _fieldLayout);
144
+ StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
145
145
  }
146
146
 
147
147
  /**
148
- * @notice Set erc20Address.
148
+ * @notice Set tokenAddress.
149
149
  */
150
- function _setErc20Address(ResourceId _tableId, ResourceId namespaceId, address erc20Address) internal {
150
+ function _setTokenAddress(ResourceId _tableId, ResourceId namespaceId, address tokenAddress) internal {
151
151
  bytes32[] memory _keyTuple = new bytes32[](1);
152
152
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
153
153
 
154
- StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((erc20Address)), _fieldLayout);
154
+ StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
155
155
  }
156
156
 
157
157
  /**
158
- * @notice Set erc20Address.
158
+ * @notice Set tokenAddress.
159
159
  */
160
- function set(ResourceId _tableId, ResourceId namespaceId, address erc20Address) internal {
160
+ function set(ResourceId _tableId, ResourceId namespaceId, address tokenAddress) internal {
161
161
  bytes32[] memory _keyTuple = new bytes32[](1);
162
162
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
163
163
 
164
- StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((erc20Address)), _fieldLayout);
164
+ StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
165
165
  }
166
166
 
167
167
  /**
168
- * @notice Set erc20Address.
168
+ * @notice Set tokenAddress.
169
169
  */
170
- function _set(ResourceId _tableId, ResourceId namespaceId, address erc20Address) internal {
170
+ function _set(ResourceId _tableId, ResourceId namespaceId, address tokenAddress) internal {
171
171
  bytes32[] memory _keyTuple = new bytes32[](1);
172
172
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
173
173
 
174
- StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((erc20Address)), _fieldLayout);
174
+ StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
175
175
  }
176
176
 
177
177
  /**
@@ -198,8 +198,8 @@ library ERC20Registry {
198
198
  * @notice Tightly pack static (fixed length) data using this table's schema.
199
199
  * @return The static data, encoded into a sequence of bytes.
200
200
  */
201
- function encodeStatic(address erc20Address) internal pure returns (bytes memory) {
202
- return abi.encodePacked(erc20Address);
201
+ function encodeStatic(address tokenAddress) internal pure returns (bytes memory) {
202
+ return abi.encodePacked(tokenAddress);
203
203
  }
204
204
 
205
205
  /**
@@ -208,8 +208,8 @@ library ERC20Registry {
208
208
  * @return The lengths of the dynamic fields (packed into a single bytes32 value).
209
209
  * @return The dyanmic (variable length) data, encoded into a sequence of bytes.
210
210
  */
211
- function encode(address erc20Address) internal pure returns (bytes memory, PackedCounter, bytes memory) {
212
- bytes memory _staticData = encodeStatic(erc20Address);
211
+ function encode(address tokenAddress) internal pure returns (bytes memory, PackedCounter, bytes memory) {
212
+ bytes memory _staticData = encodeStatic(tokenAddress);
213
213
 
214
214
  PackedCounter _encodedLengths;
215
215
  bytes memory _dynamicData;
@@ -73,7 +73,7 @@ library ERC721Registry {
73
73
  */
74
74
  function getFieldNames() internal pure returns (string[] memory fieldNames) {
75
75
  fieldNames = new string[](1);
76
- fieldNames[0] = "erc20Address";
76
+ fieldNames[0] = "tokenAddress";
77
77
  }
78
78
 
79
79
  /**
@@ -91,9 +91,9 @@ library ERC721Registry {
91
91
  }
92
92
 
93
93
  /**
94
- * @notice Get erc20Address.
94
+ * @notice Get tokenAddress.
95
95
  */
96
- function getErc20Address(ResourceId _tableId, ResourceId namespaceId) internal view returns (address erc20Address) {
96
+ function getTokenAddress(ResourceId _tableId, ResourceId namespaceId) internal view returns (address tokenAddress) {
97
97
  bytes32[] memory _keyTuple = new bytes32[](1);
98
98
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
99
99
 
@@ -102,9 +102,9 @@ library ERC721Registry {
102
102
  }
103
103
 
104
104
  /**
105
- * @notice Get erc20Address.
105
+ * @notice Get tokenAddress.
106
106
  */
107
- function _getErc20Address(ResourceId _tableId, ResourceId namespaceId) internal view returns (address erc20Address) {
107
+ function _getTokenAddress(ResourceId _tableId, ResourceId namespaceId) internal view returns (address tokenAddress) {
108
108
  bytes32[] memory _keyTuple = new bytes32[](1);
109
109
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
110
110
 
@@ -113,9 +113,9 @@ library ERC721Registry {
113
113
  }
114
114
 
115
115
  /**
116
- * @notice Get erc20Address.
116
+ * @notice Get tokenAddress.
117
117
  */
118
- function get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address erc20Address) {
118
+ function get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address tokenAddress) {
119
119
  bytes32[] memory _keyTuple = new bytes32[](1);
120
120
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
121
121
 
@@ -124,9 +124,9 @@ library ERC721Registry {
124
124
  }
125
125
 
126
126
  /**
127
- * @notice Get erc20Address.
127
+ * @notice Get tokenAddress.
128
128
  */
129
- function _get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address erc20Address) {
129
+ function _get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address tokenAddress) {
130
130
  bytes32[] memory _keyTuple = new bytes32[](1);
131
131
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
132
132
 
@@ -135,43 +135,43 @@ library ERC721Registry {
135
135
  }
136
136
 
137
137
  /**
138
- * @notice Set erc20Address.
138
+ * @notice Set tokenAddress.
139
139
  */
140
- function setErc20Address(ResourceId _tableId, ResourceId namespaceId, address erc20Address) internal {
140
+ function setTokenAddress(ResourceId _tableId, ResourceId namespaceId, address tokenAddress) internal {
141
141
  bytes32[] memory _keyTuple = new bytes32[](1);
142
142
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
143
143
 
144
- StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((erc20Address)), _fieldLayout);
144
+ StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
145
145
  }
146
146
 
147
147
  /**
148
- * @notice Set erc20Address.
148
+ * @notice Set tokenAddress.
149
149
  */
150
- function _setErc20Address(ResourceId _tableId, ResourceId namespaceId, address erc20Address) internal {
150
+ function _setTokenAddress(ResourceId _tableId, ResourceId namespaceId, address tokenAddress) internal {
151
151
  bytes32[] memory _keyTuple = new bytes32[](1);
152
152
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
153
153
 
154
- StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((erc20Address)), _fieldLayout);
154
+ StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
155
155
  }
156
156
 
157
157
  /**
158
- * @notice Set erc20Address.
158
+ * @notice Set tokenAddress.
159
159
  */
160
- function set(ResourceId _tableId, ResourceId namespaceId, address erc20Address) internal {
160
+ function set(ResourceId _tableId, ResourceId namespaceId, address tokenAddress) internal {
161
161
  bytes32[] memory _keyTuple = new bytes32[](1);
162
162
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
163
163
 
164
- StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((erc20Address)), _fieldLayout);
164
+ StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
165
165
  }
166
166
 
167
167
  /**
168
- * @notice Set erc20Address.
168
+ * @notice Set tokenAddress.
169
169
  */
170
- function _set(ResourceId _tableId, ResourceId namespaceId, address erc20Address) internal {
170
+ function _set(ResourceId _tableId, ResourceId namespaceId, address tokenAddress) internal {
171
171
  bytes32[] memory _keyTuple = new bytes32[](1);
172
172
  _keyTuple[0] = ResourceId.unwrap(namespaceId);
173
173
 
174
- StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((erc20Address)), _fieldLayout);
174
+ StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
175
175
  }
176
176
 
177
177
  /**
@@ -198,8 +198,8 @@ library ERC721Registry {
198
198
  * @notice Tightly pack static (fixed length) data using this table's schema.
199
199
  * @return The static data, encoded into a sequence of bytes.
200
200
  */
201
- function encodeStatic(address erc20Address) internal pure returns (bytes memory) {
202
- return abi.encodePacked(erc20Address);
201
+ function encodeStatic(address tokenAddress) internal pure returns (bytes memory) {
202
+ return abi.encodePacked(tokenAddress);
203
203
  }
204
204
 
205
205
  /**
@@ -208,8 +208,8 @@ library ERC721Registry {
208
208
  * @return The lengths of the dynamic fields (packed into a single bytes32 value).
209
209
  * @return The dyanmic (variable length) data, encoded into a sequence of bytes.
210
210
  */
211
- function encode(address erc20Address) internal pure returns (bytes memory, PackedCounter, bytes memory) {
212
- bytes memory _staticData = encodeStatic(erc20Address);
211
+ function encode(address tokenAddress) internal pure returns (bytes memory, PackedCounter, bytes memory) {
212
+ bytes memory _staticData = encodeStatic(tokenAddress);
213
213
 
214
214
  PackedCounter _encodedLengths;
215
215
  bytes memory _dynamicData;