IP Guide
A guide for IPs incentivizing CCDM enabled IAMs
IPs using CCDM for their cross-chain deposit campaigns should follow this guide: delineating the setup process and IP's responsibilities for each CCDM component. Before reading this guide, make sure that you have thoroughly read the CCDM Overview section.
CCDM Requirements -
A deposit asset which meets the criteria required in the Token Support page.
After completing a deposit into your protocol/DApp your smart contract must return a receipt token which represents the position. These receipt tokens are distributed among the CCDM depositors on the origin chain to return ownership of the positions to the users. Certain protocols which do not feature a receipt token may opt to deploy a helper wrapper contract which deposits into their protocol and returns a receipt token. These receipt tokens do not need to be fully featured, but must allow passing ownership of the position by transferring the token.
Recipe Market Hub - Create a CCDM enabled Royco market.
Deposit Executor - Set the parameters of your deposit campaign
Your deposit campaign on the destination chain will be identified by the market hash of the market you created in step 1.
The owner of the Deposit Executor must set you as the owner of the Deposit campaign before you can set and modify the campaign parameters.
Initialize your Campaign by calling this function:
_sourceMarketHash
The market hash of the market you created in step 1.
_unlockTimestamp
The ABSOLUTE timestamp that all deposits in your campaign will be locked until.
At this timestamp, all deposits for your campaign will be withdrawable.
Note: This value can only be set ONCE.
_receiptToken
This is the ERC20 token that your protocol/DApp will return (as a receipt of the depositor's position) upon executing the deposit recipe.
_depositRecipe
This is the Weiroll Script/Recipe that will deposit the tokens into your protocol/DApp and return the receipt tokens to the Weiroll Wallet executing the deposit recipe.
The deposit script must also enforce that the Weiroll Wallet executing the recipe gives maximum allowance to the Deposit Executor to spend the receipt tokens.
If you need to modify the receipt token or deposit recipe for some reason, you can call these functions respectively:
Receipt Tokens can only be modified until the first deposit recipe is executed for a campaign. Every time the receipt token is set, the Campaign Verifier will need verify it before the deposit recipe can be executed.
Deposit Recipes can be set as many times as necessary but should be done so with caution. Every time the recipe is set, the Campaign Verifier will need verify it before it can be executed.
Deposit Locker - Bridge deposits from the Deposit Locker once the green light has turned on for your market.
If your Royco market intakes UNI V2 LP tokens, you will need to set minimum amounts for each constituent redeemed. Set these with caution, as impermanent loss will become permanent.
Deposit Executor - Once your bridged deposits have been received by the deposit executor, execute the deposit recipe for the Weiroll Wallet that they belong to:
Repeat steps 4 and 5 until all deposits have been bridged and deposited into your protocol/DApp.
Last updated