abstract_std/objects/module_factory.rs
1use cosmwasm_std::{Addr, Deps};
2
3use crate::{native_addrs, AbstractResult};
4
5/// Store the Module Factory contract.
6#[cosmwasm_schema::cw_serde]
7pub struct ModuleFactoryContract {
8 /// Address of the module factory contract
9 pub address: Addr,
10}
11
12impl ModuleFactoryContract {
13 /// Retrieve address of the Registry
14 pub fn new(deps: Deps, account_code_id: u64) -> AbstractResult<Self> {
15 let address = deps
16 .api
17 .addr_humanize(&native_addrs::module_factory_address(
18 deps,
19 account_code_id,
20 )?)?;
21 Ok(Self { address })
22 }
23}