abstract_std/objects/
module_factory.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use cosmwasm_std::{Addr, Deps};

use crate::{native_addrs, AbstractResult};

/// Store the Module Factory contract.
#[cosmwasm_schema::cw_serde]
pub struct ModuleFactoryContract {
    /// Address of the module factory contract
    pub address: Addr,
}

impl ModuleFactoryContract {
    /// Retrieve address of the Registry
    pub fn new(deps: Deps, account_code_id: u64) -> AbstractResult<Self> {
        let address = deps
            .api
            .addr_humanize(&native_addrs::module_factory_address(
                deps,
                account_code_id,
            )?)?;
        Ok(Self { address })
    }
}