Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wormhole-foundation/example-cross-chain-deposits
https://github.com/wormhole-foundation/example-cross-chain-deposits
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wormhole-foundation/example-cross-chain-deposits
- Owner: wormhole-foundation
- License: other
- Created: 2023-05-12T21:35:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-26T00:49:00.000Z (9 months ago)
- Last Synced: 2024-04-01T16:10:16.844Z (9 months ago)
- Language: JavaScript
- Size: 312 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cross Chain Deposits
A very important cross chain flow is to easily go from any `(source chain, source token)` to `(destination chain, destination token)`. This is useful in many different situations - from simple cross chain swaps to payments. Generally, we call this flow a "cross-chain deposit".
This repository demonstrates how to perform a very simple cross-chain swap using [wormhole](https://github.com/wormhole-foundation/wormhole). The flow is:
1. Bridge asset from the source chain to the destination chain using the wormhole token bridge.
2. Use uniswap to swap the wrapped asset on the destination chain to USDC.Of course, there are lots of edge cases that this code doesn't handle. For example, it assumes that there is always a uniswap liquidity pool (with minimal slippage!) for the wrapped asset and USDC. Therefore, this code should be used as a reference for how to integrate with the wormhole token bridge and perform simple cross chain deposits. Ideally, projects looking to use arbitrary cross chain deposits should compose on top of high quality cross chain swaps such as [Hashflow](https://www.hashflow.com/), [Magpie](https://www.magpiefi.xyz/), or [Atlas](https://atlasdex.finance/).
Beyond deposits, payments is also a core cross chain use case. We implemented a proof-of-concept cross chain payments application, integrated with Shopify for the 2022 EthSF hackathon. See the demo video and technical description [here](https://ethglobal.com/showcase/xpay-cross-chain-payments-for-shopify-jeeqr).