1 unstable release
new 0.0.0-main.167+2025.05.05 | May 5, 2025 |
---|
#72 in Magic Beans
365KB
7K
SLoC
BVS Vault Factory
The BVS Vault Factory is a contract that enables operators to deploy new vault contracts on the SatLayer ecosystem. It serves as a centralized deployment mechanism, ensuring that only approved vault types can be created and that they are properly configured to work with the SatLayer infrastructure.
The Vault Factory maintains a registry of approved code IDs for different vault types, which can be updated by the contract owner. This ensures that only secure and compatible vault implementations can be deployed through the factory.
Contract Functions
Execute Functions
DeployCw20Vault
: Deploy a new CW20 vault for a specific CW20 tokenDeployBankVault
: Deploy a new bank vault for a specific native token denominationSetCodeId
: Set the code ID for a specific vault type (only owner can call)
Query Functions
CodeId
: Get the code ID for a specific vault type
Vault Deployment Process
The Vault Factory manages the deployment of new vaults through a controlled process:
- The contract owner sets approved code IDs for different vault types using
SetCodeId
- Operators can deploy new vaults using
DeployCw20Vault
orDeployBankVault
- The factory instantiates a new vault contract with the appropriate code ID
- The factory configures the vault with the correct router address and operator
- The new vault is ready to be whitelisted by the router for accepting deposits
Supported Vault Types
The Vault Factory supports two main types of vaults:
- CW20 Vaults: For managing CW20 token deposits and withdrawals
- Bank Vaults: For managing native token deposits and withdrawals
Each vault type has its own code ID that must be set by the contract owner before deployment.
Dependencies
~19MB
~334K SLoC