Uniswap / Uniswap/interface

[WalletConnect] Cross-Chain swap to an incorrect address

Open
#7,864 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

It seems that the issue related not switching addresses when changing chains runs much deeper, and the logic for handling different chains does not account for the possibility that different chains might have different addresses.

Steps to Reproduce:

  1. Connect a wallet via WalletConnect that uses different addresses for different chains, such as https://coin.space/wallet/

WalletConnect approved session namespace:

{
    "eip155": {
        "chains": [
            "eip155:1",
            "eip155:42161",
            "eip155:10"
        ],
       // ...
        "accounts": [
            "eip155:1:0xB6bB59b3aC844e8e4A98A281D57E3E0628bcb471",
            "eip155:42161:0xAd8eDE8697aF92AF31Fe66EDAD9A52A74F74464E",
            "eip155:10:0x0CFfE8EF251B2C8Ee2481F0142b531715877D417"
        ]
    }
}
  1. Initiate a swap (in my case, OP ETH to ARB ETH).

Image

  1. Confirm the swap.
Expected Behavior

ARB ETH should be sent to the correct address.

Actual Behavior

ARB ETH was sent to the same address as OP ETH, but on the ARB chain.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WalletConnect approved session namespace and the swap confirmation flow described in the reproduction steps, then compare the chain-specific accounts for Optimism and Arbitrum. Use the linked Optimistic Etherscan and Arbiscan transactions to verify the recipient selection. Done means the destination chain receives the swap at that chain's correct address.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.