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
  • Deposits
  • Withdrawals
  • Bridging Deposits
  • Administrative Roles
  • Deposit Locker Owner
  • Green Lighter
  • Campaign Owners
  1. MORE
  2. Cross-Chain Deposit Module (CCDM)

Deposit Locker

An overview of the CCDM Deposit Locker

PreviousCCDM Recipe IAMsNextDeposit Executor

Last updated 3 months ago

The Deposit Locker is a singleton contract that holds deposits on the source chain and handles the bridging of deposits to the destination chain. It receives inflows of deposits from on the source chain and bridges outflows of deposits to the on the destination chain. Here is a rundown on how the Deposit Locker functions:

Deposits

  • Whenever an offer is filled in a , funds are automatically deposited by the AP's Weiroll Wallet into the Deposit Locker.

  • Deposits are held by the Deposit Locker until they are bridged or withdrawn.

Withdrawals

    • Withdrawals are not enabled by default

      • In the rare case that they are needed, the can eternally halt all deposits and bridges for the market and enable withdrawals.

      • Then executeWithdrawalScript() can be called after the Weioll Wallet's locktime has elapsed.

        • Sends the deposit amount back to the AP.

        • Does not forfeit any incentives.

    • Withdrawals are enabled by default

    • Depositors can withdraw their deposits on a Weiroll Wallet specific basis from the Deposit Locker in one of two scenarios:

      1. Calling forfeit() in the case of forfeitable IAMs through the .

        1. This will forfeit any incentives allocated to the depositor and automatically trigger the withdrawal recipe: sending the original deposit amount back to the AP.

      2. Calling executeWithdrawalScript() after the Weioll Wallet's locktime has elapsed.

        1. This will happen in the rare case that the deposit made by the Weiroll Wallet was not bridged to thebefore the Weiroll Wallet's unlock timestamp has passed.

        2. Sends the deposit amount back to the AP.

        3. Does not forfeit any incentives.

  • Note: Deposits cannot be withdrawn from the source chain once they are bridged. They must be withdrawn from the after the campaign's unlock timestamp has passed on the destination chain.

Bridging Deposits

    • The rage quit period

      • This duration gives ample time for depositors to withdraw from a market if they change their mind, or they deem the destination action logic to be malicious.

Administrative Roles

Deposit Locker Owner

  1. Sets the LayerZero V2 endpoint for the source chain.

  2. Sets the LayerZero EID (Endpoint ID) for the destination chain.

  3. Sets the wrapped native asset token (i.e. WETH) for the source chain.

  4. Sets the Uniswap V2 Router for the source chain.

  5. Sets the OFT entrypoint (Stargate Pools/Hydra, OFT adapters, etc.) for each supported token.

  6. Sets the base gas limit passed to lzReceive on the destination chain when bridging funds. This will be added to whatever gas the OFT passes by default if it has enforced options set for lzReceive.

  7. In the rare case that deposits and bridging need to be permanently disabled for a market, they can halt the market.

Green Lighter

  1. Maintains a holistic view of the entire system (Deposit Locker and Deposit Executor).

  2. Green light markets - rendering their deposits bridgeable after the Rage Quit duration has elapsed (if applicable).

    1. Green lighting should only be done once the destination campaign's deposit recipe and parameters have been thoroughly verified and tested/simulated.

Campaign Owners

  1. Responsible for bridging deposits for their respective markets.

    1. Note: Impermanent loss becomes permanent on bridge, so the thresholds must be set accordingly.

Bridging deposits from the Deposit Locker to the is facilitated by

All tokens are bridged using LZ V2's .

Deposits for a particular market are bridgeable by the once the rage quit period has elapsed after the gives their green light.

The exposes these functions to bridge deposits for Merkle Deposit Markets:

: merkleBridgeSingleTokens()

: merkleBridgeLpTokens()

The exposes these functions to bridge deposits for Individual Deposit Markets:

: bridgeSingleTokens()

: bridgeLpTokens()

Sets the address of the on the destination chain.

Sets the address for the source chain.

Sets the (IP / Party responsible for bridging deposits) for each market.

Delegates a to flag when deposits are bridgeable for each market.

This role is played by the same party as the in the .

For markets, the owner is also responsible for setting minimum amounts redeemed for each constituent in the liquidity pool when bridging deposits.

Deposit Executor
LayerZero V2
OFT standard
Deposit Locker
Deposit Locker
Deposit Executor
Market Owner
Green Lighter
Campaign Owner
Green Lighter
Royco Recipe IAMs
Deposit Executor
CCDM enabled market
Deposit Executor
Deposit Executor
Deposit Locker Owner
Deposit Executor
Campaign Owner
Bridging Single Tokens
Bridging UNI V2 LP Tokens
Bridging Single Tokens
Bridging UNI V2 LP Tokens
UNI V2 LP token
Royco Recipe Market Hub
Recipe Market Hub
Merkle Deposit Recipe IAMs
Individual Deposit Recipe IAMs
Merkle Deposit Recipe IAMs
Individual Deposit Recipe IAMs