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. 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".

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

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

The ABI example.

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

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() function on the DepositPool contract.

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() 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() function on the DepositPool contract.

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 * 1025.

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() 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.

Last updated

Was this helpful?