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

fix: bump hdwallet package versions to fix walletconnect txs for evm chains #5425

Merged
merged 6 commits into from
Oct 9, 2023

Conversation

woodenfurniture
Copy link
Member

Description

Resolves app attempting to broadcast non-eth-mainnet evm transactions on eth-mainnet, resulting in failed transaction broadcast in the case of trades, and incorrect approvals being sent on the wrong chain.

NOTE: This requires hdwallet changes to work (link to come when i have access)

See here for details:
#5421 (comment)

Pull Request Type

  • 🐛 Bug fix (Non-breaking Change: Fixes an issue)
  • 🛠️ Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
  • 💅 New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

closes #5421

Risk

Risk of lost funds and broken trading + approvals when using a wallet connected to app via walletconnect.

Testing

Note that 1inch wallet transactions dont seem to work on iOS app via walletconnect.

Using a wallet connected via walletconnect:

  • ERC20 allowance approvals on eth mainnet

  • ERC20 -> ERC20 trade on eth mainnet

  • ETH -> ERC20 trade on eth mainnet

  • ERC20 -> ETH trade on eth mainnet

  • ERC20 allowance approvals on avalanche/polygon/gnosis/bnbsmartchain

  • ERC20 -> ERC20 trade on avalanche/polygon/gnosis/bnbsmartchain

  • ETH -> ERC20 trade on avalanche/polygon/gnosis/bnbsmartchain

  • ERC20 -> ETH trade on avalanche/polygon/gnosis/bnbsmartchain

Engineering

This requires hdwallet changes to work

Operations

☝️

Screenshots (if applicable)

DAI on avalanche approval before and after the fix:
image

@woodenfurniture
Copy link
Member Author

woodenfurniture commented Oct 6, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

Conceptual stamps before hdwallet packages are published.

Tested locally with locally published packages and confirmed this does what it says on the box.

  • ethSwitchChain() works with Trust, tested by switching chains in the chain switch menu. Note, this is transparent to the user here, so it may look like nothing is happening, but definitely is.
  • Approvals are using the right EVM chain, e.g when making a trade on BSC while being connected to mainnet, the approval is happening on BSC
  • Same as above for trade execution

Note, the hdwallet PR (and consequently, this consumption) effectively break 1inch wc when a chain switch is needed, which is not an us concern. Gut feel is the endpoint isn't properly handled on 1inch side, which ends up returning an internal error.

@gomesalexandre gomesalexandre marked this pull request as ready for review October 9, 2023 18:30
@gomesalexandre gomesalexandre requested a review from a team as a code owner October 9, 2023 18:30
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

Retested with Trust, in wood:

  • Chain switch menu
image
  • Self-send while connected to another EVM chain
image
  • Trade approval while being connected to another EVM chain
image
  • Trade execution while being connected to another EVM chain
image

@gomesalexandre gomesalexandre merged commit 2dda47f into develop Oct 9, 2023
@gomesalexandre gomesalexandre deleted the fix-walletconnect-evm-txs branch October 9, 2023 19:59
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.

Cannot transact with 1Inch wallet connected via Wallet Connect
2 participants