hyperlane-xyz / hyperlane-warp-ui-template

A web app template for building Hyperlane Warp Route UIs
https://hyperlane-warp-template.vercel.app
Other
90 stars 79 forks source link

Message signed on the wrong chain #148

Open avious00 opened 3 months ago

avious00 commented 3 months ago

Context

A user ended up signing a warp route transfer intended from inEVM on zkSync ⁠[discord]

Investigation

As per zksync and etherscan this happened a few times on other chains as well.

@jmrossy suspects imperfect wallet switching behavior within https://github.com/wevm/wagmi for this.

Potential Solutions

Some workarounds are:

  1. adding more explicit wallet chain checks after switching (possibly hacky)
  2. upgrading to wagmi 2
  3. Possibly more user prompts to make sure that they are signing on the right chain (unfortunately wallets don't indicate the presence of calldata for a call to a non-existing contract)
avious00 commented 3 months ago

Opened issues with underlying library + wallet here: Wagmi https://github.com/wevm/wagmi/issues/3720 Metamask https://github.com/MetaMask/metamask-extension/issues/23568