fn execute_clean_redeems(
    deps: DepsMut,
    _env: Env,
    info: MessageInfo,
) -> Result<Response, ContractError> {
    let config = TOKEN_INFO.load(deps.storage)?;
    if config.mint.is_none() || config.mint.as_ref().unwrap().minter != info.sender {
        return Err(Cw20ContractError::Unauthorized {}.into());
    }

    let keys = REEDEMS
        .keys(deps.storage, None, None, Order::Ascending)
        .collect::<Result<Vec<String>, StdError>>()?;

    for key in keys {
        REEDEMS.remove(deps.storage, &key)
    }

    Ok(Response::new().add_attribute("action", "remove_all_redeems"))
}
/// Removes all redeems info from contract
Removes all redeems info from contract
Removes all redeems info from contract
fn execute_clean_redeems(
    deps: DepsMut,
    _env: Env,
    info: MessageInfo,
) -> Result<Response, ContractError> {
    let config = TOKEN_INFO.load(deps.storage)?;
    if config.mint.is_none() || config.mint.as_ref().unwrap().minter != info.sender {
        return Err(Cw20ContractError::Unauthorized {}.into());
    }
    let keys = REEDEMS
        .keys(deps.storage, None, None, Order::Ascending)
        .collect::<Result<Vec<String>, StdError>>()?;
    for key in keys {
        REEDEMS.remove(deps.storage, &key)
    }
    Ok(Response::new().add_attribute("action", "remove_all_redeems"))
}
fn execute_clean_redeems ( deps : DepsMut , _env : Env , info : MessageInfo , ) -> Result < Response , ContractError > { let config = TOKEN_INFO . load ( deps . storage ) ? ; if config . mint . is_none ( ) || config . mint . as_ref ( ) . unwrap ( ) . minter != info . sender { return Err ( Cw20ContractError :: Unauthorized { } . into ( ) ) ; } let keys = REEDEMS . keys ( deps . storage , None , None , Order :: Ascending ) . collect :: < Result < Vec < String > , StdError > > ( ) ? ; for key in keys { REEDEMS . remove ( deps . storage , & key ) } Ok ( Response :: new ( ) . add_attribute ( " " , " " ) ) }
Removes all redeems info from contract
Removes all redeems info from contract
deps
DepsMut
_env
Env
info
MessageInfo
deps
DepsMut
_env
Env
info
MessageInfo