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.

  1. CCDM Requirements -

    1. A deposit asset which meets the criteria required in the Token Support page.

    2. 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.

  2. Recipe Market Hub - Create a CCDM enabled Royco market.

  3. Deposit Executor - Set the parameters of your deposit campaign

    1. Your deposit campaign on the destination chain will be identified by the market hash of the market you created in step 1.

      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.

    2. Initialize your Campaign by calling this function:

          function initializeCampaign(
              bytes32 _sourceMarketHash,
              uint256 _unlockTimestamp,
              ERC20 _receiptToken,
              Recipe calldata _depositRecipe
          )
      1. _sourceMarketHash

        1. The market hash of the market you created in step 1.

      2. _unlockTimestamp

        1. The ABSOLUTE timestamp that all deposits in your campaign will be locked until.

        2. At this timestamp, all deposits for your campaign will be withdrawable.

        3. Note: This value can only be set ONCE.

      3. _receiptToken

        1. This is the ERC20 token that your protocol/DApp will return (as a receipt of the depositor's position) upon executing the deposit recipe.

      4. _depositRecipe

        1. 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.

        2. 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.

    3. If you need to modify the receipt token or deposit recipe for some reason, you can call these functions respectively:

      1. 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.

        function setCampaignReceiptToken(bytes32 _sourceMarketHash, ERC20 _receiptToken)
      2. 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.

        function setCampaignDepositRecipe(bytes32 _sourceMarketHash, Recipe calldata _depositRecipe)
  4. Deposit Locker - Bridge deposits from the Deposit Locker once the green light has turned on for your market.

    1. 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.

  5. 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:

    function executeDepositRecipes(bytes32 _sourceMarketHash, address[] calldata _weirollWallets)
  6. Repeat steps 4 and 5 until all deposits have been bridged and deposited into your protocol/DApp.

Last updated