Lockbox
Lockbox in Lucid: A Comprehensive Overview
The Lockbox module in Lucid is a wrapper contract, similar to Wrapped ETH, designed to simplify token integration and multi-chain operations. It ensures compatibility with Lucid’s platform, enabling seamless cross-chain functionality and liquidity management.
How Lockbox Works
There are three ways to utilize the Lockbox, depending on your token setup:
1. Wrapping Existing Tokens:
If you wrap your existing ERC-20 token using Lucid’s Lockbox:
The Lockbox contract acts as a wrapper, making the token compatible with Lucid’s ecosystem.
Lucid handles all configurations, including: Granting mint and burn rights to the Asset Controller, allowing Lucid to manage token issuance and redemption only during module configuration.
Benefits:
Simplifies integration by automating configurations.
Reduces manual effort, particularly in multi-chain setups.
2. Deploying a New xERC-20 Token via Lucid
If you create a new xERC-20 token through Lucid:
Lucid automatically:
Grants mint and burn rights to the Asset Controller.
Pre-configures all necessary settings for multi-chain compatibility.
Advantages:
Fully automated deployment process.
Optimized for Lucid’s multi-bridge and cross-chain messaging features.
3. Using an Existing xERC-20 Token Without Wrapping
If you choose not to wrap your existing xERC-20 token:
Manual configurations are required on all chains where the token is deployed:
Grant Mint/Burn Rights to the Asset Controller. For example, if the mint functionality of your token is controlled by OpenZeppelin's AccessControl library, then you would need to call
grantRole()
and give the appropriate mint rights to the Asset Controller contract. This would have to be repeat in all the chains the AssetController was deployed to. For reference, see: https://docs.openzeppelin.com/contracts/4.x/api/access#AccessControl-grantRole-bytes32-address-Set Mint/Burn Limits: Specify how many tokens can be minted or burned from the asset controller within a given time period (24 hours by default). Ensure these limits cover the combined capacity of all bridges (e.g., the total of each bridge’s limits must not exceed the token contract’s allowance).
Mint/Burn Limits: Why They Are Critical
The Asset Controller interacts with bridges to manage token transfers. Each bridge has its own mint/burn limits, which must align with the token contract’s limits:
If bridge limits are exhausted in a day, the token contract’s mint/burn limit must still accommodate user transactions.
Setting appropriately high limits helps avoid transaction failures due to insufficient allowances.
Managing Tokens Across Chains
For Multi-Chain ERC-20 Tokens
If your token exists across multiple chains each chain will require its own Lockbox, leading to potential liquidity management challenges. Example:
If you move $1,000,000 worth of tokens from Arbitrum to Optimism, but the Optimism Lockbox has only $800,000 in liquidity:
You can redeem only $800,000 in liquidity.
The remaining $200,000 remains in xERC-20 form, limiting its usability in certain DeFi applications.
For Single-Chain ERC-20 Tokens
If your token exists on only one chain, then converting it to an xERC-20 token is simpler.
All xERC-20 tokens minted are backed by the locked ERC-20 supply on that single chain.
Redemptions always route back to the originating chain.
Use Case of Lockbox: Governance Tokens
Lockbox is particularly advantageous for governance tokens:
Enables seamless multi-chain operations while maintaining a secure and traceable supply.
Ensures tokens are interoperable across chains without compromising security or liquidity.
Key Benefits of Lockbox
Automated Configurations: Simplifies integration with Lucid’s platform by automating token settings.
Seamless Multi-Chain Compatibility: Optimised for asset transfers cross-chain.
Efficient Liquidity Management: Reduces fragmentation and ensures optimal functionality across chains.
Last updated