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

Failing to sign typed data if it contains the wrong chainId in the domain #20757

Closed
clauxx opened this issue Jul 15, 2024 · 0 comments · Fixed by #20821
Closed

Failing to sign typed data if it contains the wrong chainId in the domain #20757

clauxx opened this issue Jul 15, 2024 · 0 comments · Fixed by #20821

Comments

@clauxx
Copy link
Member

clauxx commented Jul 15, 2024

No error is shown when signing the event when user's network differs from event network.

For typed data, we check if the chainId inside the data is the same as the session-request chainId (for security reasons) and if they're different, the signing will fail. We should show an error telling the user that it failed and the reason.

If there is no chainId in the typeddata, we assume it's not chain specific and it should pass successfully (fixed here).

cc: @xAlisher we will need an extra toast during typeddata signing requests

Steps:

  1. Connect to https://react-app.walletconnect.com/ using testnetwork (Sepolia)
  2. Trigger eth_signTypedData_v4 request
  3. Sign the request
  4. See if error about wrong network is shown

Actual result: no error after signing the request. In fact the request is not signed as it is triggered on Mainnet while user is on testnet.

Also, the same actual result happens when I am trying to sign eth_signTypedData_v4 request while being connected on Mainnet (Ethereum + Optimism networks) and triggering request on Optimism

Expected result: we should show an error toast informing user that request has not been signed because user's network differs from request network.

Originally posted by @pavloburykh in #20693 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant