@latticexyz/world-modules 2.0.0-main-6bae338a → 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/dist/mud.config.js +1 -1
- package/dist/mud.config.js.map +1 -1
- package/out/ERC20.t.sol/ERC20Test.json +1 -1
- package/out/ERC20Module.sol/ERC20Module.json +1 -1
- package/out/ERC20Module.sol/ERC20ModuleRegistrationLibrary.json +1 -1
- package/out/ERC20Registry.sol/ERC20Registry.json +1 -1
- package/out/ERC721.t.sol/ERC721Recipient.json +1 -1
- package/out/ERC721.t.sol/ERC721Test.json +1 -1
- package/out/ERC721.t.sol/ERC721TokenReceiver.json +1 -1
- package/out/ERC721.t.sol/NonERC721Recipient.json +1 -1
- package/out/ERC721.t.sol/RevertingERC721Recipient.json +1 -1
- package/out/ERC721.t.sol/WrongReturnDataERC721Recipient.json +1 -1
- package/out/ERC721Module.sol/ERC721Module.json +1 -1
- package/out/ERC721Module.sol/ERC721ModuleRegistrationLibrary.json +1 -1
- package/out/ERC721Registry.sol/ERC721Registry.json +1 -1
- package/package.json +8 -8
- package/src/modules/erc20-puppet/tables/ERC20Registry.sol +25 -25
- package/src/modules/erc721-puppet/tables/ERC721Registry.sol +25 -25
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@latticexyz/world-modules",
|
3
|
-
"version": "2.0.0-main-
|
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-
|
19
|
-
"@latticexyz/config": "2.0.0-main-
|
20
|
-
"@latticexyz/schema-type": "2.0.0-main-
|
21
|
-
"@latticexyz/store": "2.0.0-main-
|
22
|
-
"@latticexyz/world": "2.0.0-main-
|
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-
|
38
|
-
"@latticexyz/gas-report": "2.0.0-main-
|
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] = "
|
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
|
94
|
+
* @notice Get tokenAddress.
|
95
95
|
*/
|
96
|
-
function
|
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
|
105
|
+
* @notice Get tokenAddress.
|
106
106
|
*/
|
107
|
-
function
|
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
|
116
|
+
* @notice Get tokenAddress.
|
117
117
|
*/
|
118
|
-
function get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address
|
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
|
127
|
+
* @notice Get tokenAddress.
|
128
128
|
*/
|
129
|
-
function _get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address
|
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
|
138
|
+
* @notice Set tokenAddress.
|
139
139
|
*/
|
140
|
-
function
|
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((
|
144
|
+
StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
|
145
145
|
}
|
146
146
|
|
147
147
|
/**
|
148
|
-
* @notice Set
|
148
|
+
* @notice Set tokenAddress.
|
149
149
|
*/
|
150
|
-
function
|
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((
|
154
|
+
StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
|
155
155
|
}
|
156
156
|
|
157
157
|
/**
|
158
|
-
* @notice Set
|
158
|
+
* @notice Set tokenAddress.
|
159
159
|
*/
|
160
|
-
function set(ResourceId _tableId, ResourceId namespaceId, address
|
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((
|
164
|
+
StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
|
165
165
|
}
|
166
166
|
|
167
167
|
/**
|
168
|
-
* @notice Set
|
168
|
+
* @notice Set tokenAddress.
|
169
169
|
*/
|
170
|
-
function _set(ResourceId _tableId, ResourceId namespaceId, address
|
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((
|
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
|
202
|
-
return abi.encodePacked(
|
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
|
212
|
-
bytes memory _staticData = encodeStatic(
|
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] = "
|
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
|
94
|
+
* @notice Get tokenAddress.
|
95
95
|
*/
|
96
|
-
function
|
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
|
105
|
+
* @notice Get tokenAddress.
|
106
106
|
*/
|
107
|
-
function
|
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
|
116
|
+
* @notice Get tokenAddress.
|
117
117
|
*/
|
118
|
-
function get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address
|
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
|
127
|
+
* @notice Get tokenAddress.
|
128
128
|
*/
|
129
|
-
function _get(ResourceId _tableId, ResourceId namespaceId) internal view returns (address
|
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
|
138
|
+
* @notice Set tokenAddress.
|
139
139
|
*/
|
140
|
-
function
|
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((
|
144
|
+
StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
|
145
145
|
}
|
146
146
|
|
147
147
|
/**
|
148
|
-
* @notice Set
|
148
|
+
* @notice Set tokenAddress.
|
149
149
|
*/
|
150
|
-
function
|
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((
|
154
|
+
StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
|
155
155
|
}
|
156
156
|
|
157
157
|
/**
|
158
|
-
* @notice Set
|
158
|
+
* @notice Set tokenAddress.
|
159
159
|
*/
|
160
|
-
function set(ResourceId _tableId, ResourceId namespaceId, address
|
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((
|
164
|
+
StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((tokenAddress)), _fieldLayout);
|
165
165
|
}
|
166
166
|
|
167
167
|
/**
|
168
|
-
* @notice Set
|
168
|
+
* @notice Set tokenAddress.
|
169
169
|
*/
|
170
|
-
function _set(ResourceId _tableId, ResourceId namespaceId, address
|
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((
|
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
|
202
|
-
return abi.encodePacked(
|
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
|
212
|
-
bytes memory _staticData = encodeStatic(
|
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;
|