@latticexyz/world-modules 2.0.6-main-66c64ee1 → 2.0.6-main-fb2bd881

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 (26) hide show
  1. package/dist/mud.config.js +1 -1
  2. package/dist/mud.config.js.map +1 -1
  3. package/out/CallWithSignatureModule.t.sol/Unstable_CallWithSignatureModuleTest.json +1 -1
  4. package/out/CallWithSignatureNonces.sol/CallWithSignatureNonces.json +1 -1
  5. package/out/ECDSA.sol/ECDSA.json +1 -1
  6. package/out/ERC20Module.sol/ERC20Module.json +1 -1
  7. package/out/ERC721Module.sol/ERC721Module.json +1 -1
  8. package/out/IUnstable_CallWithSignatureErrors.sol/IUnstable_CallWithSignatureErrors.json +1 -1
  9. package/out/KeysInTableModule.sol/KeysInTableModule.json +1 -1
  10. package/out/KeysWithValueModule.sol/KeysWithValueModule.json +1 -1
  11. package/out/Puppet.sol/Puppet.json +1 -1
  12. package/out/PuppetModule.sol/PuppetModule.json +1 -1
  13. package/out/StandardDelegationsModule.sol/StandardDelegationsModule.json +1 -1
  14. package/out/UniqueEntityModule.sol/UniqueEntityModule.json +1 -1
  15. package/out/Unstable_CallWithSignatureModule.sol/Unstable_CallWithSignatureModule.json +1 -1
  16. package/out/Unstable_CallWithSignatureSystem.sol/Unstable_CallWithSignatureSystem.json +1 -1
  17. package/package.json +8 -8
  18. package/src/index.sol +1 -1
  19. package/src/modules/{delegation → callwithsignature}/getSignedMessageHash.sol +5 -3
  20. /package/src/modules/{delegation → callwithsignature}/ECDSA.sol +0 -0
  21. /package/src/modules/{delegation → callwithsignature}/IUnstable_CallWithSignatureErrors.sol +0 -0
  22. /package/src/modules/{delegation → callwithsignature}/Unstable_CallWithSignatureModule.sol +0 -0
  23. /package/src/modules/{delegation → callwithsignature}/Unstable_CallWithSignatureSystem.sol +0 -0
  24. /package/src/modules/{delegation → callwithsignature}/constants.sol +0 -0
  25. /package/src/modules/{delegation → callwithsignature}/tables/CallWithSignatureNonces.sol +0 -0
  26. /package/src/modules/{delegation → callwithsignature}/validateCallWithSignature.sol +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latticexyz/world-modules",
3
- "version": "2.0.6-main-66c64ee1",
3
+ "version": "2.0.6-main-fb2bd881",
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.6-main-66c64ee1",
26
- "@latticexyz/config": "2.0.6-main-66c64ee1",
27
- "@latticexyz/schema-type": "2.0.6-main-66c64ee1",
28
- "@latticexyz/store": "2.0.6-main-66c64ee1",
29
- "@latticexyz/world": "2.0.6-main-66c64ee1"
25
+ "@latticexyz/common": "2.0.6-main-fb2bd881",
26
+ "@latticexyz/config": "2.0.6-main-fb2bd881",
27
+ "@latticexyz/schema-type": "2.0.6-main-fb2bd881",
28
+ "@latticexyz/store": "2.0.6-main-fb2bd881",
29
+ "@latticexyz/world": "2.0.6-main-fb2bd881"
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.6-main-66c64ee1",
45
- "@latticexyz/gas-report": "2.0.6-main-66c64ee1"
44
+ "@latticexyz/abi-ts": "2.0.6-main-fb2bd881",
45
+ "@latticexyz/gas-report": "2.0.6-main-fb2bd881"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
package/src/index.sol CHANGED
@@ -22,4 +22,4 @@ import { Owners } from "./modules/erc721-puppet/tables/Owners.sol";
22
22
  import { TokenApproval } from "./modules/erc721-puppet/tables/TokenApproval.sol";
23
23
  import { OperatorApproval } from "./modules/erc721-puppet/tables/OperatorApproval.sol";
24
24
  import { ERC721Registry } from "./modules/erc721-puppet/tables/ERC721Registry.sol";
25
- import { CallWithSignatureNonces } from "./modules/delegation/tables/CallWithSignatureNonces.sol";
25
+ import { CallWithSignatureNonces } from "./modules/callwithsignature/tables/CallWithSignatureNonces.sol";
@@ -3,6 +3,10 @@ pragma solidity >=0.8.24;
3
3
 
4
4
  import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
5
5
 
6
+ // Note the intended value of the `salt` field is the chain ID.
7
+ // It is not included in `chainId`, to allow cross-chain signing without requiring wallets to switch networks.
8
+ // The value of this field should be the chain on which the world lives, rather than the chain the wallet is connected to.
9
+ bytes32 constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(address verifyingContract,bytes32 salt)");
6
10
  bytes32 constant CALL_TYPEHASH = keccak256("Call(address signer,bytes32 systemId,bytes callData,uint256 nonce)");
7
11
 
8
12
  /**
@@ -23,9 +27,7 @@ function getSignedMessageHash(
23
27
  uint256 nonce,
24
28
  address worldAddress
25
29
  ) view returns (bytes32) {
26
- bytes32 domainSeperator = keccak256(
27
- abi.encode(keccak256("EIP712Domain(uint256 chainId,address verifyingContract)"), block.chainid, worldAddress)
28
- );
30
+ bytes32 domainSeperator = keccak256(abi.encode(DOMAIN_TYPEHASH, worldAddress, bytes32(block.chainid)));
29
31
 
30
32
  return
31
33
  keccak256(