Royco
  • Overview
    • Introduction to Royco
    • Key Concepts
    • Applications
  • FOR USERS
    • FAQs
    • How to Use Royco
  • FOR INCENTIVE PROVIDERS
    • Developer Overview
      • Fees on Royco
    • Recipes vs. Vaults IAMs
    • Create an IAM
    • Incentivize IAMs
      • Types of Incentives
      • Place an Incentive Offer
      • Place an Incentive Offer: For Developers
      • Setup a Points Campaign
      • Native Yield
    • Verify a Market
    • Audits
    • Contract Addresses
  • MORE
    • Bug Bounty Program
    • Cross-Chain Deposit Module (CCDM)
      • CCDM Recipe IAMs
      • Deposit Locker
      • Deposit Executor
      • Token Support
      • Audits
      • IP Guide
    • Royco V2
      • Incentive Locker
      • Action Verifiers
      • Multiplier Market Hub
      • Audit
    • Royco SDK
    • Contributing to the Protocol
    • Brand Kit
  • Royco Vaults
    • Royco Vaults: Overview
  • Royco Vaults: Risks
Powered by GitBook
On this page
  1. MORE
  2. Cross-Chain Deposit Module (CCDM)

IP Guide

A guide for IPs incentivizing CCDM enabled IAMs

PreviousAuditsNextRoyco V2

Last updated 4 months ago

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

  1. CCDM Requirements -

    1. A deposit asset which meets the criteria required in the 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 .

  3. - 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 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 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 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 will need verify it before it can be executed.

        function setCampaignDepositRecipe(bytes32 _sourceMarketHash, Recipe calldata _depositRecipe)
  4. - once the has turned on for your market.

    1. If your Royco market intakes , you will need to set minimum amounts for each constituent redeemed. Set these with caution, as impermanent loss will become permanent.

  5. - Once your bridged deposits have been received by the deposit executor, 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.

CCDM Overview
Token Support
CCDM enabled Royco market
Deposit Executor
Deposit Executor
Weiroll Script/Recipe
Deposit Locker
Deposit Executor
UNI V2 LP tokens
Campaign Verifier
Campaign Verifier
execute the deposit recipe
Bridge deposits from the Deposit Locker
green light