Deposit Locker
An overview of the CCDM Deposit Locker
Last updated
An overview of the CCDM Deposit Locker
Last updated
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:
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 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:
Calling forfeit()
in the case of forfeitable IAMs through the .
This will forfeit any incentives allocated to the depositor and automatically trigger the withdrawal recipe: sending the original deposit amount back to the AP.
Calling executeWithdrawalScript()
after the Weioll Wallet's locktime has elapsed.
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.
Sends the deposit amount back to the AP.
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.
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.
Sets the LayerZero V2 endpoint for the source chain.
Sets the LayerZero EID (Endpoint ID) for the destination chain.
Sets the wrapped native asset token (i.e. WETH) for the source chain.
Sets the Uniswap V2 Router for the source chain.
Sets the OFT entrypoint (Stargate Pools/Hydra, OFT adapters, etc.) for each supported token.
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.
In the rare case that deposits and bridging need to be permanently disabled for a market, they can halt the market.
Maintains a holistic view of the entire system (Deposit Locker and Deposit Executor).
Green light markets - rendering their deposits bridgeable after the Rage Quit duration has elapsed (if applicable).
Green lighting should only be done once the destination campaign's deposit recipe and parameters have been thoroughly verified and tested/simulated.
Responsible for bridging deposits for their respective markets.
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.