Skip to main content

bvs_vault_factory/
msg.rs

1use bvs_pauser::api::Display;
2use cosmwasm_schema::{cw_serde, QueryResponses};
3
4#[cw_serde]
5pub struct InstantiateMsg {
6    pub owner: String,
7    pub pauser: String,
8    pub registry: String,
9    pub router: String,
10}
11
12#[cw_serde]
13#[derive(Display)]
14pub enum ExecuteMsg {
15    /// ExecuteMsg DeployCw20
16    /// Deploy a CW20 vault contract, the operator will be the sender of this message.
17    /// The `cw20` is the address of the CW20 contract.
18    DeployCw20 { cw20: String },
19
20    /// ExecuteMsg DeployBank
21    /// Deploy a Bank vault contract, the operator will be the sender of this message.
22    /// The `denom` is the denomination of the native token, e.g. "ubbn" for Babylon native token.
23    DeployBank { denom: String },
24
25    /// ExecuteMsg TransferOwnership
26    /// See [`bvs_library::ownership::transfer_ownership`] for more information on this field
27    /// Only the `owner` can call this message.
28    TransferOwnership { new_owner: String },
29
30    /// ExecuteMsg SetCodeId
31    /// Set the code id for a vault type, allowing the factory to deploy vaults of that type.
32    /// Only the `owner` can call this message.
33    SetCodeId { code_id: u64, vault_type: VaultType },
34}
35
36#[cw_serde]
37#[derive(Display)]
38pub enum VaultType {
39    Bank,
40    Cw20,
41}
42
43#[cw_serde]
44#[derive(QueryResponses)]
45pub enum QueryMsg {
46    #[returns(CodeIdResponse)]
47    CodeId { vault_type: VaultType },
48}
49
50/// The response to the `CodeId` query.
51/// Not exported.
52/// This is just a wrapper around `u64`, so that the schema can be generated.
53#[cw_serde]
54struct CodeIdResponse(u64);