pub fn remove_dapp(deps: DepsMut, msg_info: MessageInfo, dapp: String) -> TreasuryResult {
    ADMIN.assert_admin(deps.as_ref(), &msg_info.sender)?;

    let mut state = STATE.load(deps.storage)?;
    if !state.dapps.contains(&deps.api.addr_validate(&dapp)?) {
        return Err(TreasuryError::NotInList {});
    }

    // Remove contract from whitelist.
    let dapp_address = deps.api.addr_validate(&dapp)?;
    state.dapps.retain(|addr| *addr != dapp_address);
    STATE.save(deps.storage, &state)?;

    // Respond and note the change
    Ok(Response::new().add_attribute("Removed contract from whitelist: ", dapp))
}
/// Remove a contract from the whitelist
Remove a contract from the whitelist
Remove a contract from the whitelist
pub fn remove_dapp(deps: DepsMut, msg_info: MessageInfo, dapp: String) -> TreasuryResult {
    ADMIN.assert_admin(deps.as_ref(), &msg_info.sender)?;
    let mut state = STATE.load(deps.storage)?;
    if !state.dapps.contains(&deps.api.addr_validate(&dapp)?) {
        return Err(TreasuryError::NotInList {});
    }
    // Remove contract from whitelist.
    let dapp_address = deps.api.addr_validate(&dapp)?;
    state.dapps.retain(|addr| *addr != dapp_address);
    STATE.save(deps.storage, &state)?;
    // Respond and note the change
    Ok(Response::new().add_attribute("Removed contract from whitelist: ", dapp))
}
pub fn remove_dapp ( deps : DepsMut , msg_info : MessageInfo , dapp : String ) -> TreasuryResult { ADMIN . assert_admin ( deps . as_ref ( ) , & msg_info . sender ) ? ; let mut state = STATE . load ( deps . storage ) ? ; if ! state . dapps . contains ( & deps . api . addr_validate ( & dapp ) ? ) { return Err ( TreasuryError :: NotInList { } ) ; } // Remove contract from whitelist. let dapp_address = deps . api . addr_validate ( & dapp ) ? ; state . dapps . retain ( | addr | * addr != dapp_address ) ; STATE . save ( deps . storage , & state ) ? ; // Respond and note the change Ok ( Response :: new ( ) . add_attribute ( " " , dapp ) ) }
Remove a contract from the whitelist
Remove a contract from the whitelist
deps
DepsMut
msg_info
MessageInfo
dapp
String
deps
DepsMut
msg_info
MessageInfo
dapp
String