> For the complete documentation index, see [llms.txt](https://gabriel-j-shapiro.gitbook.io/metalex-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gabriel-j-shapiro.gitbook.io/metalex-docs/protocol-how-to-guides/upgrade-a-cybercorp.md).

# Upgrade a cyberCORP

All contracts use UUPS upgradeable proxies (with beacon proxies for `CyberCertPrinter` and `CyberScrip`). Upgrades use a **co-approval** model: MetaLeX publishes a reference implementation, and the cyberCORP's owner opts in. See [Upgrade model](/metalex-docs/protocol-reference/upgrade-model.md).

## Upgrade the CyberCorp contract

`CyberCorp._authorizeUpgrade` is `onlyOwner` **and** requires the new implementation to equal the factory's reference implementation — otherwise it reverts `NotRefImplementation`.

```solidity
// The target must equal the factory's published reference implementation:
address published =
    ICyberCorpSingleFactory(CyberCorp(cyberCorp).upgradeFactory()).getRefImplementation();

UUPSUpgradeable(cyberCorp).upgradeToAndCall(published, "");
```

If `published` is not what you expected, do not upgrade — the gate exists so neither side can move you to an arbitrary implementation.

## Upgrade the IssuanceManager, DealManager, RoundManager

The `IssuanceManager`, `DealManager`, and `RoundManager` are UUPS proxies too; upgrade each with `upgradeToAndCall` against its factory's reference implementation, gated the same way.

## Upgrade CyberCertPrinter / CyberScrip instances

These are beacon proxies. The beacons are owned by the cyberCORP's `IssuanceManager`, which exposes:

```solidity
IIssuanceManager(issuanceManager).upgradeCertPrinterBeaconImplementation(newImpl);
IIssuanceManager(issuanceManager).upgradeScripBeaconImplementation(newImpl);
```

Upgrading a beacon moves every instance of that type under the IssuanceManager at once.

## What you can and cannot do

* You may stay on your current implementation indefinitely.
* You cannot upgrade to an implementation that is not the factory's published reference — the call reverts.
* MetaLeX cannot upgrade your contracts; the upgrade call is made by your owner.

## Related

* [Upgrade model](/metalex-docs/protocol-reference/upgrade-model.md).
* Explanation: [Co-approval upgradeability](/metalex-docs/protocol-explanation/co-approval-upgradeability.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://gabriel-j-shapiro.gitbook.io/metalex-docs/protocol-how-to-guides/upgrade-a-cybercorp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
