> For the complete documentation index, see [llms.txt](https://gitbook.mor.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/get-started/protocol-management.md). Agents can also search and read this documentation through its [MCP server](https://gitbook.mor.org/~gitbook/mcp).

# Protocol management

This page is intended for protocol owners and explains how to change protocol parameters.

## How to find an ABI for calling smart contract functions via multisig or code?

Almost all smart contracts use the UUPS proxy pattern. This means that all transactions are sent to the address of the proxy contract; these addresses are listed in the [documentation](https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/deployed-contracts.md). The ABI, however, should be taken from the implementation. You can find it using various services, for example, on Etherscan you need to do the following:

1. Open the smart contract.
2. Go to the “Contract” tab and check the contract name. If it contains the word "proxy", continue to the next step. If not, skip to step 6.
3. Click “Read as Proxy.”
4. Open the smart contract shown as the implementation.
5. Go to the “Contract” tab.
6. Confirm this is what you need by comparing the name of the contract you are looking for with what is shown on Etherscan.
7. Scroll to the very bottom and copy the ABI.

*This contract is a proxy, as the contract name contains "Proxy".*

<figure><img src="https://2371043446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl7W52NNhIIACGv1fus80%2Fuploads%2FtKxNumzmBRfuhW5tI1Lm%2Fimage.png?alt=media&amp;token=18b4d0ea-328f-441c-8200-e367ec43947f" alt=""><figcaption></figcaption></figure>

*The implementation address can be found as shown in the screenshot.*

<figure><img src="https://2371043446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl7W52NNhIIACGv1fus80%2Fuploads%2FoIqjJkwJbpC3D7GFvVwV%2Fimage.png?alt=media&amp;token=37528731-5759-45a5-98ad-c5abb9470c47" alt=""><figcaption></figcaption></figure>

*This contract is an implementation or valid searched contract, as the contract name doesn't contains "Proxy".*

<figure><img src="https://2371043446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl7W52NNhIIACGv1fus80%2Fuploads%2FMCSxfnlp8BF7O1oDDylj%2Fimage.png?alt=media&amp;token=cdc3bcb1-56a1-4e06-b859-a4fb38101c7c" alt=""><figcaption></figcaption></figure>

*The ABI example.*

<figure><img src="https://2371043446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl7W52NNhIIACGv1fus80%2Fuploads%2F8x0P5H5SuQjB2Pj2qy5p%2Fimage.png?alt=media&amp;token=2e11e58c-cc38-4492-a3fc-41b793b93097" alt=""><figcaption></figcaption></figure>

## Upgrade the protocol to the new version

To upgrade the protocol to a new version, the contract owner need to call the upgrateTo() function on the target contract

```solidity
function upgradeTo(address newImplementation) public;
```

Where `newImplementation` will be the address of the new version of the smart contract. The implementation must have the correct contract, which name you can double-check on Etherscan in the "Contract" section.

## Updating bucket limits in the deposit pool

To set new limits for a bucket in a `DepositPool`, the contract owner need to call the [`setRewardPoolProtocolDetails()`](https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#setrewardpoolprotocoldetails) function on the [`DepositPool`](https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md) contract.&#x20;

```solidity
function setRewardPoolProtocolDetails(
  uint256 rewardPoolIndex_,
  uint128 withdrawLockPeriodAfterStake_,
  uint128 claimLockPeriodAfterStake_,
  uint128 claimLockPeriodAfterClaim_,
  uint256 minimalStake_
) public onlyOwner;
```

This will update the following parameters:

* `rewardPoolIndex_` - the reward pool ID (bucket ID, `0` for the Capital users).
* `withdrawLockPeriodAfterStake_` - Lock period for the withdrawals after the stake transaction, seconds.
* `claimLockPeriodAfterStake_` - Lock period for claims after the stake transaction, seconds.
* `claimLockPeriodAfterClaim_` -Lock period for claims after the claim transaction, seconds.
* `minimalStake_` - Minimal staking amount for the user, wei.

Notes:

* Transaction cannot change one parameter separately. If only one or several parameters are changed, the rest must be duplicated to the transaction params.
* Be careful with the token amount decimals - use the same number of decimals as used by the deposit token.
* To check the changes or the current state, call the [`rewardPoolsProtocolDetails()`](https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#rewardpoolsprotocoldetails) function on the `DepositPool` contract.
* Changes will ONLY apply to the `DepositPool` where the function was called. To make changes to other `DepositPool`, the contract owner need to execute this transaction on each individual deposit pool.

## Updating referral tiers in the deposit pool:

To set new referral tiers for a bucket in a `DepositPool`, the contract owner need to call the [`editReferrerTiers()`](https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#editreferrertiers) function on the [`DepositPool`](https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md) contract.&#x20;

```solidity
function editReferrerTiers(
  uint256 rewardPoolIndex_,
  ReferrerTier[] calldata referrerTiers_
) external onlyOwner;
```

This will update the following parameters:

* `rewardPoolIndex_` - the reward pool ID (bucket ID, `0` for the Capital users).
* `referrerTiers_` - the referrer tiers structs array:
  * `amount` - the minimal token amount for the tier, wei.
  * `multiplier` - the multiplier for the tier, where 1% = 0.01 \* 10<sup>25</sup>.

Example: `editReferrerTiers(0, [ {3.5*10^18; 0.03 * 10^25}, {35*10^18; 0.04 * 10^25}, ...]);`

Notes:

* Transaction cannot change one parameter separately. If only one or several parameters are changed, the rest must be duplicated to the transaction params.
* Be careful with the token amount decimals - use the same number of decimals as used by the deposit token.
* To check the changes or the current state, call the [`referrerTiers()`](https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#referrertiers) function on the `DepositPool` contract.
* Changes will ONLY apply to the `DepositPool` where the function was called. To make changes to other `DepositPool`, the contract owner need to execute this transaction on each individual deposit pool.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/get-started/protocol-management.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
