# Upgradeable

The `UpgradeableComponent` is designed for easy upgradability of tokenbound accounts.

The full contract code of the `UpgradableComponent` can be found [**here**](https://github.com/horuslabsio/TBA/blob/v3/src/components/upgradeable/upgradeable.cairo)**.**

## Functions

### `_upgrade`

```rust
fn _upgrade(
    ref self: ComponentState<TContractState>, 
    new_class_hash: ClassHash
);
```

The `_upgrade` function replaces the current contract's class hash with a new one provided by `new_class_hash`.&#x20;

#### Parameters

| Name             | Type        | Description                                                      |
| ---------------- | ----------- | ---------------------------------------------------------------- |
| `new_class_hash` | `ClassHash` | The class hash of the new contract implementation to upgrade to. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tbaexplorer.com/contracts/components/upgradeable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
