dao_interface/
migrate_msg.rs

1//! types used for migrating modules of the DAO with migrating core
2//! copyo of the types from dao-migrator contract.
3
4use cosmwasm_schema::cw_serde;
5
6use crate::query::SubDao;
7use crate::state::ModuleInstantiateInfo;
8
9#[cw_serde]
10pub struct MigrateParams {
11    pub migrator_code_id: u64,
12    pub params: MigrateV1ToV2,
13}
14
15#[cw_serde]
16pub struct MigrateV1ToV2 {
17    pub sub_daos: Vec<SubDao>,
18    pub migration_params: MigrationModuleParams,
19    pub v1_code_ids: V1CodeIds,
20    pub v2_code_ids: V2CodeIds,
21}
22
23// code ids for the v1 contracts
24#[cw_serde]
25pub struct V1CodeIds {
26    pub proposal_single: u64,
27    pub cw4_voting: u64,
28    pub cw20_stake: u64,
29    pub cw20_staked_balances_voting: u64,
30}
31
32// code ids for the new contracts
33#[cw_serde]
34pub struct V2CodeIds {
35    pub proposal_single: u64,
36    pub cw4_voting: u64,
37    pub cw20_stake: u64,
38    pub cw20_staked_balances_voting: u64,
39}
40
41/// The params we need to provide for migration msgs
42#[cw_serde]
43pub struct ProposalParams {
44    pub close_proposal_on_execution_failure: bool,
45    pub pre_propose_info: PreProposeInfo,
46}
47
48#[cw_serde]
49pub struct MigrationModuleParams {
50    // General
51    /// Rather or not to migrate the stake_cw20 contract and its
52    /// manager. If this is not set to true and a stake_cw20
53    /// contract is detected in the DAO's configuration the
54    /// migration will be aborted.
55    pub migrate_stake_cw20_manager: Option<bool>,
56    // dao_proposal_single
57    pub proposal_params: Vec<(String, ProposalParams)>,
58}
59
60#[cw_serde]
61pub enum PreProposeInfo {
62    /// Anyone may create a proposal free of charge.
63    AnyoneMayPropose {},
64    /// The module specified in INFO has exclusive rights to proposal
65    /// creation.
66    ModuleMayPropose { info: ModuleInstantiateInfo },
67}