pub fn init_contracts(app: &mut App) -> BaseContracts {
    let owner = Addr::unchecked(TEST_CREATOR);

    // Instantiate WHALE Token Contract
    let cw20_token_contract = Box::new(ContractWrapper::new(
        cw20_base::contract::execute,
        cw20_base::contract::instantiate,
        cw20_base::contract::query,
    ));

    let cw20_token_code_id = app.store_code(cw20_token_contract);

    let msg = cw20_base::msg::InstantiateMsg {
        name: String::from("Whale token"),
        symbol: String::from("WHALE"),
        decimals: 6,
        initial_balances: vec![],
        mint: Some(cw20::MinterResponse {
            minter: owner.to_string(),
            cap: None,
        }),
        marketing: None,
    };

    let whale_token_instance = app
        .instantiate_contract(
            cw20_token_code_id,
            owner.clone(),
            &msg,
            &[],
            String::from("WHALE"),
            None,
        )
        .unwrap();

    // Upload Treasury Contract
    let treasury_contract = Box::new(ContractWrapper::new(
        treasury::contract::execute,
        treasury::contract::instantiate,
        treasury::contract::query,
    ));

    let treasury_code_id = app.store_code(treasury_contract);

    let treasury_instantiate_msg = TreasuryMsg::InstantiateMsg {};

    // Instantiate Treasury Contract
    let treasury_instance = app
        .instantiate_contract(
            treasury_code_id,
            owner.clone(),
            &treasury_instantiate_msg,
            &[],
            "Treasury",
            None,
        )
        .unwrap();

    // Upload Memory Contract
    let memory_contract = Box::new(ContractWrapper::new(
        memory::contract::execute,
        memory::contract::instantiate,
        memory::contract::query,
    ));

    let memory_code_id = app.store_code(memory_contract);

    let memory_instantiate_msg = MemoryMsg::InstantiateMsg {};

    // Init contract
    let memory_instance = app
        .instantiate_contract(
            memory_code_id,
            owner.clone(),
            &memory_instantiate_msg,
            &[],
            "Memory",
            None,
        )
        .unwrap();

    // Instantiate the terraswap pair
    let (pair, lp) = instantiate_pair(app, &owner.clone(), &whale_token_instance);

    app.update_block(|b| {
        b.height += 17;
        b.time = Timestamp::from_seconds(1571797419);
    });

    BaseContracts {
        treasury: treasury_instance,
        memory: memory_instance,
        whale: whale_token_instance,
        whale_ust_pair: pair,
        whale_ust: lp,
    }
}
/// Creates the basic contract instances needed to test the dapp.
/// Whale token, Memory, Treasury, Whale/UST pair, Whale/UST LP
Creates the basic contract instances needed to test the dapp.
Whale token, Memory, Treasury, Whale/UST pair, Whale/UST LP
Creates the basic contract instances needed to test the dapp . Whale token Memory Treasury Whale / UST pair Whale / UST LP
pub fn init_contracts(app: &mut App) -> BaseContracts {
    let owner = Addr::unchecked(TEST_CREATOR);
    // Instantiate WHALE Token Contract
    let cw20_token_contract = Box::new(ContractWrapper::new(
        cw20_base::contract::execute,
        cw20_base::contract::instantiate,
        cw20_base::contract::query,
    ));
    let cw20_token_code_id = app.store_code(cw20_token_contract);
    let msg = cw20_base::msg::InstantiateMsg {
        name: String::from("Whale token"),
        symbol: String::from("WHALE"),
        decimals: 6,
        initial_balances: vec![],
        mint: Some(cw20::MinterResponse {
            minter: owner.to_string(),
            cap: None,
        }),
        marketing: None,
    };
    let whale_token_instance = app
        .instantiate_contract(
            cw20_token_code_id,
            owner.clone(),
            &msg,
            &[],
            String::from("WHALE"),
            None,
        )
        .unwrap();
    // Upload Treasury Contract
    let treasury_contract = Box::new(ContractWrapper::new(
        treasury::contract::execute,
        treasury::contract::instantiate,
        treasury::contract::query,
    ));
    let treasury_code_id = app.store_code(treasury_contract);
    let treasury_instantiate_msg = TreasuryMsg::InstantiateMsg {};
    // Instantiate Treasury Contract
    let treasury_instance = app
        .instantiate_contract(
            treasury_code_id,
            owner.clone(),
            &treasury_instantiate_msg,
            &[],
            "Treasury",
            None,
        )
        .unwrap();
    // Upload Memory Contract
    let memory_contract = Box::new(ContractWrapper::new(
        memory::contract::execute,
        memory::contract::instantiate,
        memory::contract::query,
    ));
    let memory_code_id = app.store_code(memory_contract);
    let memory_instantiate_msg = MemoryMsg::InstantiateMsg {};
    // Init contract
    let memory_instance = app
        .instantiate_contract(
            memory_code_id,
            owner.clone(),
            &memory_instantiate_msg,
            &[],
            "Memory",
            None,
        )
        .unwrap();
    // Instantiate the terraswap pair
    let (pair, lp) = instantiate_pair(app, &owner.clone(), &whale_token_instance);
    app.update_block(|b| {
        b.height += 17;
        b.time = Timestamp::from_seconds(1571797419);
    });
    BaseContracts {
        treasury: treasury_instance,
        memory: memory_instance,
        whale: whale_token_instance,
        whale_ust_pair: pair,
        whale_ust: lp,
    }
}
pub fn init_contracts ( app : & mut App ) -> BaseContracts { let owner = Addr :: unchecked ( TEST_CREATOR ) ; // Instantiate WHALE Token Contract let cw20_token_contract = Box :: new ( ContractWrapper :: new ( cw20_base :: contract :: execute , cw20_base :: contract :: instantiate , cw20_base :: contract :: query , ) ) ; let cw20_token_code_id = app . store_code ( cw20_token_contract ) ; let msg = cw20_base :: msg :: InstantiateMsg { name : String :: from ( " " ) , symbol : String :: from ( " " ) , decimals : 6 , initial_balances : vec ! [ ] , mint : Some ( cw20 :: MinterResponse { minter : owner . to_string ( ) , cap : None , } ) , marketing : None , } ; let whale_token_instance = app . instantiate_contract ( cw20_token_code_id , owner . clone ( ) , & msg , & [ ] , String :: from ( " " ) , None , ) . unwrap ( ) ; // Upload Treasury Contract let treasury_contract = Box :: new ( ContractWrapper :: new ( treasury :: contract :: execute , treasury :: contract :: instantiate , treasury :: contract :: query , ) ) ; let treasury_code_id = app . store_code ( treasury_contract ) ; let treasury_instantiate_msg = TreasuryMsg :: InstantiateMsg { } ; // Instantiate Treasury Contract let treasury_instance = app . instantiate_contract ( treasury_code_id , owner . clone ( ) , & treasury_instantiate_msg , & [ ] , " " , None , ) . unwrap ( ) ; // Upload Memory Contract let memory_contract = Box :: new ( ContractWrapper :: new ( memory :: contract :: execute , memory :: contract :: instantiate , memory :: contract :: query , ) ) ; let memory_code_id = app . store_code ( memory_contract ) ; let memory_instantiate_msg = MemoryMsg :: InstantiateMsg { } ; // Init contract let memory_instance = app . instantiate_contract ( memory_code_id , owner . clone ( ) , & memory_instantiate_msg , & [ ] , " " , None , ) . unwrap ( ) ; // Instantiate the terraswap pair let ( pair , lp ) = instantiate_pair ( app , & owner . clone ( ) , & whale_token_instance ) ; app . update_block ( | b | { b . height += 17 ; b . time = Timestamp :: from_seconds ( 1571797419 ) ; } ) ; BaseContracts { treasury : treasury_instance , memory : memory_instance , whale : whale_token_instance , whale_ust_pair : pair , whale_ust : lp , } }
Creates the basic contract instances needed to test the dapp.
Creates the basic contract instances needed to test the dapp .
app
&mut App
app
&mut App