|
1 | 1 | # Cross-Chain Deposit Module
|
2 | 2 |
|
3 |
| -The Cross-Chain Deposit Module (CDM) is a sophisticated system designed to facilitate cross-chain deposit campaigns for chains that want users to commit liquidity from the source chain into their protocols on the destination chain. It consists of two main components: the ```DepositLocker``` on the source chain and the ```DepositExecutor``` on the destination chain. |
| 3 | +The Cross-Chain Deposit Module (CDM) is a sophisticated system designed to facilitate cross-chain deposit campaigns for protocols that want users (APs) to commit liquidity from a source chain into protocols on a destination chain. It consists of two main components: the ```DepositLocker``` on the source chain and the ```DepositExecutor``` on the destination chain. |
4 | 4 |
|
5 | 5 | ## Overview
|
6 | 6 |
|
7 |
| -This module allows users to deposit funds on one chain and have those funds bridged and utilized on another chain according to market specific recipes. It leverages LayerZero for cross-chain communication and token bridging. |
| 7 | +This module allows users to deposit funds on one chain (source) and have those funds bridged and utilized on another chain (destination) according to market specific recipes. It leverages [LayerZero](https://layerzero.network) for cross-chain communication and token bridging. The system supports all tokens that abide to the [OFT](https://docs.layerzero.network/v2/home/token-standards/oft-standard) standard. |
8 | 8 |
|
9 | 9 | ### Key Components
|
10 | 10 |
|
11 | 11 | 1. **[RecipeMarketHub](https://github.com/roycoprotocol/royco/blob/main/src/RecipeMarketHub.sol)**: A hub for all interactions between APs and IPs on Royco
|
12 | 12 | - Permissionless market creation, offer creation, and offer filling
|
13 |
| - - Handles creation of Weiroll Wallets and automatic execution of deposit recipes for APs upon filling an offer |
14 |
| - - Allows APs to execute withdraw recipes to reclaim their funds as per the market's parameters |
| 13 | + - Creation of Weiroll Wallets and automatic execution of deposit recipes for APs upon filling an offer |
| 14 | + - Allows APs to execute withdrawal recipes to reclaim their funds as per the market's parameters |
15 | 15 |
|
16 | 16 | 1. **[WeirollWallet](https://github.com/roycoprotocol/royco/blob/main/src/WeirollWallet.sol)**: Smart contract wallets used to execute recipes
|
17 |
| - - Used on the source chain to deposit funds to bridge and withdraw funds (rage quit) to/from the DepositLocker |
18 |
| - - Used on the destination chain to hold a depositor's position, execute deposits upon bridging, and withdrawals after an absolute locktime |
| 17 | + - Used on the source chain to deposit funds for bridging and withdraw funds (rage quit) to/from the DepositLocker |
| 18 | + - Used on the destination chain to hold a depositor's position, execute destination deposit recipes upon bridging, and withdrawals after an absolute locktime |
19 | 19 |
|
20 |
| -2. **[DepositLocker](https://github.com/roycoprotocol/chain-Deposit-module/blob/main/src/DepositLocker.sol)**: Deployed on the source chain |
| 20 | +2. **[DepositLocker](https://github.com/roycoprotocol/cross-chain-deposit-module/blob/main/src/DepositLocker.sol)**: Deployed on the source chain |
21 | 21 | - Integrates with Royco's RecipeMarketHub to facilitate deposits and withdrawals
|
22 | 22 | - Accepts deposits from users' Weiroll Wallets upon an AP filling an offer in any Deposit market
|
23 | 23 | - Allows for withdrawals until deposits are bridged
|
24 |
| - - Handles bridging funds to the destination chain in addition to composing destination execution logic via LayerZero |
| 24 | + - Handles bridging funds to the destination chain in addition to destination execution parameters via LayerZero |
25 | 25 |
|
26 |
| -3. **[DepositExecutor](https://github.com/roycoprotocol/chain-Deposit-module/blob/main/src/DepositExecutor.sol)**: Deployed on the destination chain |
27 |
| - - Receives the bridged funds and composed payload via LayerZero and atomically creates Weiroll Wallets for all bridged depositors |
28 |
| - - Executes deposit scripts ONCE after bridge (either by the depositor or the owner of the Deposit campaign) |
| 26 | +3. **[DepositExecutor](https://github.com/roycoprotocol/cross-chain-deposit-module/blob/main/src/DepositExecutor.sol)**: Deployed on the destination chain |
| 27 | + - Receives the bridged funds and parameters via LayerZero and atomically creates Weiroll Wallets for all bridged depositors |
| 28 | + - Executes deposit scripts ONCE after bridge (either by the depositor or the owner of the cross-chain deposit campaign) |
29 | 29 | - Allows the depositor to execute the withdrawal recipe after the absolute locktime has passed
|
30 | 30 |
|
31 | 31 | ## Key Features
|
32 | 32 |
|
33 | 33 | - Integration with RecipeMarketHub for market management, offer creation and fulfillment, and Weiroll Wallet executions on the source chain
|
34 | 34 | - Bridging funds and a payload containing depositor information using LayerZero
|
35 |
| -- Weiroll Wallets created for each depositor on the destination chain with the ability to deposit and withdraw assets as specified by the campaign's recipes |
| 35 | +- Weiroll Wallets created for each depositor on the destination chain with the ability to deposit and withdraw assets as specified by the campaign's destination recipes |
36 | 36 |
|
37 | 37 | ## CPM Flow
|
38 |
| -1. AP (depositor) fills an offer for a Deposit market in the RecipeMarketHub |
| 38 | +1. AP (depositor) fills an offer for a cross-chain deposit market in the RecipeMarketHub |
39 | 39 | 2. The RecipeMarketHub automatically creates a Weiroll Wallet for the user and deposits them into the DepositLocker
|
40 | 40 | 3. Depositors can withdraw deposits anytime through the RecipeMarketHub before their deposits are bridged
|
41 | 41 | 4. Once green light is given, anyone can bridge funds to the destination chain from the DepositLocker
|
42 |
| -5. DepositExecutor receives bridged funds and creates Weiroll Wallets for each depositor based on data in composed payload |
43 |
| -6. Deposit recipes are executed on the destination chain |
44 |
| -7. Users can withdraw funds after the absolute unlock timestamp |
| 42 | +5. DepositExecutor receives bridged funds and creates Weiroll Wallets for each depositor as per the bridged execution parameters |
| 43 | +6. Destination deposit recipes are executed on the destination chain |
| 44 | +7. Users can withdraw funds through the DepositExecutor after the absolute unlock timestamp |
0 commit comments