pub fn increase_short_token(
    deps: DepsMut,
    info: MessageInfo,
    staker_addr: Addr,
    asset_token: Addr,
    amount: Uint128,
) -> StdResult<Response> {
    let config: Config = read_config(deps.storage)?;
    if deps.api.addr_canonicalize(info.sender.as_str())? != config.mint_contract {
        return Err(StdError::generic_err("unauthorized"));
    }

    let staker_addr_raw: CanonicalAddr = deps.api.addr_canonicalize(staker_addr.as_str())?;
    let asset_token_raw: CanonicalAddr = deps.api.addr_canonicalize(asset_token.as_str())?;

    _increase_bond_amount(
        deps.storage,
        &staker_addr_raw,
        &asset_token_raw,
        amount,
        true,
    )?;

    Ok(Response::new().add_attributes(vec![
        attr("action", "increase_short_token"),
        attr("staker_addr", staker_addr.as_str()),
        attr("asset_token", asset_token.as_str()),
        attr("amount", amount.to_string()),
    ]))
}
// only mint contract can execute the operation
only mint contract can execute the operation
only mint contract can execute the operation
pub fn increase_short_token(
    deps: DepsMut,
    info: MessageInfo,
    staker_addr: Addr,
    asset_token: Addr,
    amount: Uint128,
) -> StdResult<Response> {
    let config: Config = read_config(deps.storage)?;
    if deps.api.addr_canonicalize(info.sender.as_str())? != config.mint_contract {
        return Err(StdError::generic_err("unauthorized"));
    }
    let staker_addr_raw: CanonicalAddr = deps.api.addr_canonicalize(staker_addr.as_str())?;
    let asset_token_raw: CanonicalAddr = deps.api.addr_canonicalize(asset_token.as_str())?;
    _increase_bond_amount(
        deps.storage,
        &staker_addr_raw,
        &asset_token_raw,
        amount,
        true,
    )?;
    Ok(Response::new().add_attributes(vec![
        attr("action", "increase_short_token"),
        attr("staker_addr", staker_addr.as_str()),
        attr("asset_token", asset_token.as_str()),
        attr("amount", amount.to_string()),
    ]))
}
pub fn increase_short_token ( deps : DepsMut , info : MessageInfo , staker_addr : Addr , asset_token : Addr , amount : Uint128 , ) -> StdResult < Response > { let config : Config = read_config ( deps . storage ) ? ; if deps . api . addr_canonicalize ( info . sender . as_str ( ) ) ? != config . mint_contract { return Err ( StdError :: generic_err ( " " ) ) ; } let staker_addr_raw : CanonicalAddr = deps . api . addr_canonicalize ( staker_addr . as_str ( ) ) ? ; let asset_token_raw : CanonicalAddr = deps . api . addr_canonicalize ( asset_token . as_str ( ) ) ? ; _increase_bond_amount ( deps . storage , & staker_addr_raw , & asset_token_raw , amount , true , ) ? ; Ok ( Response :: new ( ) . add_attributes ( vec ! [ attr ( " " " " ) attr ( " " staker_addr as_str ( ) ) attr ( " " asset_token as_str ( ) ) attr ( " " amount to_string ( ) ) ] ) ) }
only mint contract can execute the operation
only mint contract can execute the operation
deps
DepsMut
info
MessageInfo
staker_addr
Addr
asset_token
Addr
amount
Uint128
deps
DepsMut
info
MessageInfo
staker_addr
Addr
asset_token
Addr
amount
Uint128