cw_admin_factory/
msg.rs

1use cosmwasm_schema::{cw_serde, QueryResponses};
2use cosmwasm_std::{Addr, Binary};
3
4#[cw_serde]
5pub struct InstantiateMsg {
6    /// The account allowed to execute this contract. If no admin, anyone can
7    /// execute it.
8    pub admin: Option<String>,
9}
10
11#[cw_serde]
12pub enum ExecuteMsg {
13    /// Instantiates the target contract with the provided instantiate message,
14    /// code ID, and label and updates the contract's admin to be itself.
15    InstantiateContractWithSelfAdmin {
16        instantiate_msg: Binary,
17        code_id: u64,
18        label: String,
19    },
20    /// Instantiates the target contract with the provided instantiate message,
21    /// code ID, label, and salt, via instantiate2 to give a predictable
22    /// address, and updates the contract's admin to be itself.
23    Instantiate2ContractWithSelfAdmin {
24        instantiate_msg: Binary,
25        code_id: u64,
26        label: String,
27        salt: Binary,
28        /// Optionally specify the expected address and fail if it doesn't match
29        /// the instantiated contract. This makes it easy for a consumer to
30        /// validate that they are using the correct address elsewhere.
31        expect: Option<String>,
32    },
33}
34
35#[cw_serde]
36#[derive(QueryResponses)]
37pub enum QueryMsg {
38    #[returns(AdminResponse)]
39    Admin {},
40}
41
42#[cw_serde]
43pub struct MigrateMsg {}
44
45#[cw_serde]
46pub struct AdminResponse {
47    pub admin: Option<Addr>,
48}