@latticexyz/world-modules 2.0.7-main-7183364f → 2.0.7-main-013cae09

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.7-main-7183364f",
3
+ "version": "2.0.7-main-013cae09",
4
4
  "description": "World modules",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "zod": "^3.21.4",
25
- "@latticexyz/common": "2.0.7-main-7183364f",
26
- "@latticexyz/config": "2.0.7-main-7183364f",
27
- "@latticexyz/schema-type": "2.0.7-main-7183364f",
28
- "@latticexyz/store": "2.0.7-main-7183364f",
29
- "@latticexyz/world": "2.0.7-main-7183364f"
25
+ "@latticexyz/common": "2.0.7-main-013cae09",
26
+ "@latticexyz/schema-type": "2.0.7-main-013cae09",
27
+ "@latticexyz/config": "2.0.7-main-013cae09",
28
+ "@latticexyz/store": "2.0.7-main-013cae09",
29
+ "@latticexyz/world": "2.0.7-main-013cae09"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/ejs": "^3.1.1",
@@ -41,8 +41,8 @@
41
41
  "tsup": "^6.7.0",
42
42
  "tsx": "^3.12.6",
43
43
  "vitest": "0.34.6",
44
- "@latticexyz/abi-ts": "2.0.7-main-7183364f",
45
- "@latticexyz/gas-report": "2.0.7-main-7183364f"
44
+ "@latticexyz/abi-ts": "2.0.7-main-013cae09",
45
+ "@latticexyz/gas-report": "2.0.7-main-013cae09"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
@@ -2,12 +2,17 @@
2
2
  pragma solidity >=0.8.24;
3
3
 
4
4
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
5
+ import { WorldResourceIdLib, WorldResourceIdInstance } from "@latticexyz/world/src/WorldResourceId.sol";
6
+
7
+ using WorldResourceIdInstance for ResourceId;
5
8
 
6
9
  // Note the intended value of the `salt` field is the chain ID.
7
10
  // It is not included in `chainId`, to allow cross-chain signing without requiring wallets to switch networks.
8
11
  // The value of this field should be the chain on which the world lives, rather than the chain the wallet is connected to.
9
12
  bytes32 constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(address verifyingContract,bytes32 salt)");
10
- bytes32 constant CALL_TYPEHASH = keccak256("Call(address signer,bytes32 systemId,bytes callData,uint256 nonce)");
13
+ bytes32 constant CALL_TYPEHASH = keccak256(
14
+ "Call(address signer,string systemNamespace,string systemName,bytes callData,uint256 nonce)"
15
+ );
11
16
 
12
17
  /**
13
18
  * @notice Generate the message hash for a given delegation signature.
@@ -34,7 +39,16 @@ function getSignedMessageHash(
34
39
  abi.encodePacked(
35
40
  "\x19\x01",
36
41
  domainSeperator,
37
- keccak256(abi.encode(CALL_TYPEHASH, signer, systemId, keccak256(callData), nonce))
42
+ keccak256(
43
+ abi.encode(
44
+ CALL_TYPEHASH,
45
+ signer,
46
+ keccak256(abi.encodePacked(WorldResourceIdLib.toTrimmedString(systemId.getNamespace()))),
47
+ keccak256(abi.encodePacked(WorldResourceIdLib.toTrimmedString(systemId.getName()))),
48
+ keccak256(callData),
49
+ nonce
50
+ )
51
+ )
38
52
  )
39
53
  );
40
54
  }