Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(world-modules): callWithSignature chain id is salt #2648

Merged
merged 8 commits into from
Apr 12, 2024

Conversation

yonadaa
Copy link
Contributor

@yonadaa yonadaa commented Apr 12, 2024

As per the EIP712 spec, wallets attempt to switch networks based on the chainId field in the domain: https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator

We work around this by including the chain ID in the salt field instead. As the salt is still present in the message we still avoid replay attacks.

@yonadaa yonadaa requested review from alvrs and holic as code owners April 12, 2024 12:45
Copy link

changeset-bot bot commented Apr 12, 2024

🦋 Changeset detected

Latest commit: b1b9153

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@latticexyz/world-modules Patch
@latticexyz/cli Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/dev-tools Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/protocol-parser Patch
@latticexyz/query Patch
@latticexyz/react Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
@latticexyz/services Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/store-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/store Patch
@latticexyz/utils Patch
@latticexyz/world Patch
mock-game-contracts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Co-authored-by: Kevin Ingersoll <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a comment in Discord but this directory name doesn't make much sense anymore and also kinda confusing alongside modules/std-delegations

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can still see the old file, I think it needs to be manually deleted because we're not yet putting these files under a codegen dir
https://github.com/latticexyz/mud/blob/2720170c211fd1eec2502ff851cd68556afaa1bd/packages/world-modules/src/modules/delegation/tables/CallWithSignatureNonces.sol

@holic holic merged commit 96e82b7 into main Apr 12, 2024
12 checks passed
@holic holic deleted the yonadaaa/call-with-sig-salt branch April 12, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants