pub fn withdraw_sponsor(deps: DepsMut, info: MessageInfo) -> StdResult<Response> {
    let config: Config = read_config(deps.storage)?;
    if config.owner != deps.api.addr_canonicalize(info.sender.as_str())? {
        return Err(StdError::generic_err("Unauthorized"));
    }

    let lotto = deps.api.addr_humanize(&config.lotto_contract)?.to_string();

    Ok(Response::new()
        .add_messages(vec![CosmosMsg::Wasm(WasmMsg::Execute {
            contract_addr: lotto,
            funds: vec![],
            msg: to_binary(&LottoMsg::SponsorWithdraw {})?,
        })])
        .add_attributes(vec![("action", "withdraw_sponsor")]))
}
/// Withdraw Sponsor
/// Owner (governance contract) can execute withdraw sponsor lotto operation
Withdraw Sponsor
Owner (governance contract) can execute withdraw sponsor lotto operation
Withdraw Sponsor Owner ( governance contract ) can execute withdraw sponsor lotto operation
pub fn withdraw_sponsor(deps: DepsMut, info: MessageInfo) -> StdResult<Response> {
    let config: Config = read_config(deps.storage)?;
    if config.owner != deps.api.addr_canonicalize(info.sender.as_str())? {
        return Err(StdError::generic_err("Unauthorized"));
    }
    let lotto = deps.api.addr_humanize(&config.lotto_contract)?.to_string();
    Ok(Response::new()
        .add_messages(vec![CosmosMsg::Wasm(WasmMsg::Execute {
            contract_addr: lotto,
            funds: vec![],
            msg: to_binary(&LottoMsg::SponsorWithdraw {})?,
        })])
        .add_attributes(vec![("action", "withdraw_sponsor")]))
}
pub fn withdraw_sponsor ( deps : DepsMut , info : MessageInfo ) -> StdResult < Response > { let config : Config = read_config ( deps . storage ) ? ; if config . owner != deps . api . addr_canonicalize ( info . sender . as_str ( ) ) ? { return Err ( StdError :: generic_err ( " " ) ) ; } let lotto = deps . api . addr_humanize ( & config . lotto_contract ) ? . to_string ( ) ; Ok ( Response :: new ( ) . add_messages ( vec ! [ CosmosMsg Wasm ( WasmMsg Execute { contract_addr lotto funds vec [ ] msg to_binary ( LottoMsg SponsorWithdraw { } ) } ) ] ) . add_attributes ( vec ! [ ( " " " " ) ] ) ) }
Withdraw Sponsor
Owner (governance contract) can execute withdraw sponsor lotto operation
Withdraw Sponsor Owner ( governance contract ) can execute withdraw sponsor lotto operation
deps
DepsMut
info
MessageInfo
deps
DepsMut
info
MessageInfo