fn send_commissions(deps: Deps, _info: MessageInfo, profit: Uint128) -> VaultResult {
    let fees = FEE.load(deps.storage)?;

    let commission_amount = fees.commission_fee.compute(profit);

    // Construct commission msg
    let refund_asset = Asset {
        info: AssetInfo::NativeToken {
            denom: "uusd".to_string(),
        },
        amount: commission_amount,
    };
    let commission_msg = refund_asset.into_msg(&deps.querier, fees.treasury_addr)?;

    Ok(Response::new()
        .add_attribute("treasury commission:", commission_amount.to_string())
        .add_message(commission_msg))
}
/// Sends the commission fee which is a function of the profit made by the contract, forwarded by the profit-check contract
Sends the commission fee which is a function of the profit made by the contract, forwarded by the profit-check contract
Sends the commission fee which is a function of the profit made by the contract forwarded by the profit - check contract
fn send_commissions(deps: Deps, _info: MessageInfo, profit: Uint128) -> VaultResult {
    let fees = FEE.load(deps.storage)?;
    let commission_amount = fees.commission_fee.compute(profit);
    // Construct commission msg
    let refund_asset = Asset {
        info: AssetInfo::NativeToken {
            denom: "uusd".to_string(),
        },
        amount: commission_amount,
    };
    let commission_msg = refund_asset.into_msg(&deps.querier, fees.treasury_addr)?;
    Ok(Response::new()
        .add_attribute("treasury commission:", commission_amount.to_string())
        .add_message(commission_msg))
}
fn send_commissions ( deps : Deps , _info : MessageInfo , profit : Uint128 ) -> VaultResult { let fees = FEE . load ( deps . storage ) ? ; let commission_amount = fees . commission_fee . compute ( profit ) ; // Construct commission msg let refund_asset = Asset { info : AssetInfo :: NativeToken { denom : " " . to_string ( ) , } , amount : commission_amount , } ; let commission_msg = refund_asset . into_msg ( & deps . querier , fees . treasury_addr ) ? ; Ok ( Response :: new ( ) . add_attribute ( " " , commission_amount . to_string ( ) ) . add_message ( commission_msg ) ) }
Sends the commission fee which is a function of the profit made by the contract, forwarded by the profit-check contract
Sends the commission fee which is a function of the profit made by the contract forwarded by the profit - check contract
deps
Deps
_info
MessageInfo
profit
Uint128
deps
Deps
_info
MessageInfo
profit
Uint128