osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

lendex-market: Mint/burn l-tokens #28

Closed uint closed 2 years ago

uint commented 2 years ago

Closes #6

uint commented 2 years ago

Do we want to introduce some helper for this boilerplate? And would it be per contract?

    let wrapped_msg = SubMsg::new(WasmMsg::Execute {
        contract_addr: cfg.ltoken_contract.to_string(),
        msg: mint_msg,
        funds: vec![],
    });
ethanfrey commented 2 years ago

Do we want to introduce some helper for this boilerplate? And would it be per contract?

    let wrapped_msg = SubMsg::new(WasmMsg::Execute {
        contract_addr: cfg.ltoken_contract.to_string(),
        msg: mint_msg,
        funds: vec![],
    });

Yes. I find it nice to export a helpers.ts function on each contract. That said, you have to test them. And we kind of need multitest to test them... So, maybe it is extra work.

If it makes your life easier, please export the helpers from the contract that defined the messages. Remember, if you import one contract from another, always use the library feature (and ensure that is wrapped around the entry point macros)