> For the complete documentation index, see [llms.txt](https://docs.ts.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ts.finance/technical-details/contract/contract-upgrade.md).

# Contract Upgrade

## Overview

TermMax employs a strategic mixed approach to contract upgradeability, balancing flexibility with security. Only critical infrastructure components are upgradeable, while core protocol logic remains immutable to ensure user trust and system stability.

## Upgradable Contracts

TermMax implements the Universal Upgradeable Proxy Standard (UUPS) pattern for the following contracts:

1\. AccessManager Contract

* Purpose: Controls the permission system for the entire protocol
* Upgrade Authority: DEFAULT\_ADMIN\_ROLE
* Critical Functions: Role management, permission controls, system-wide access control

2\. TermMaxRouter Contract

* Purpose: Handles routing logic between protocol components
* Upgrade Authority: DEFAULT\_ADMIN\_ROLE
* Critical Functions: User interaction routing, protocol integration management

## Upgrade Process

1. Multisig Preparation
   1. Technical team prepares upgrade transaction data
   2. Admin multisig wallet initiates upgrade proposal
   3. Upgrade parameters and new implementation address verified
2. Signature Collection
   1. Threshold Required: 4 out of 6 signatures
   2. Security Features:
      1. Gnosis Safe multisig wallet implementation
      2. Hypernative Guardian service provides additional transaction security
3. Post-Upgrade Verification
   1. Check the upgraded contract status on Etherscan and/or other networks' explorers&#x20;
   2. Confirm all state correctly preserved during upgrade
   3. Validate new functionality works as expected
   4. Ensure permissions and access controls maintained
      * Check external integrations remain functional
      * Monitor for any issues post-upgrade
   5. All upgrades monitored by Immunefi bug bounty hunters


---

# 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://docs.ts.finance/technical-details/contract/contract-upgrade.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.
