Platform

TELx Staking Management Automation Module

The StakingRewardsManager Contract provides the TELx Council with the ability to automate the topping up of staking contracts. The Manager Contract administers the staking contracts and allows for configurations to be set by the TELx Council. The configurations set by the council determine how the Manager Contract will pull TEL from the TELx Council Safe to maintain the staking contracts, ensuring they are always fully operational according to the council’s specifications.

System Overview

The StakingRewardsManager Contract provides the TELx Council with the ability to automate the topping up of staking contracts. The Manager Contract administers the staking contracts and allows for configurations to be set by the TELx Council. The configurations set by the council determine how the Manager Contract will pull TEL from the TELx Council Safe to maintain the staking contracts, ensuring they are always fully operational according to the council’s specifications.

By automating the topping up process, unless there are configuration changes the Manager Contract eliminates the need for the TELx Council to vote to disburse tokens to staking contracts. A system such as Gelato will be responsible for the smart contract calls.

How it Works

The Staking Manager contract helps the TELx Council maintain the TELx LP staking contracts. It accomplishes this by allowing the TELx Council to set the rewards parameters for each staking contract and allowing any account to call functions to pull TEL from the TELx Council Safe and send it to the staking contracts.

The Manager Contract maintains a list of staking contracts that it needs to administer. Each staking contract has a configuration with two properties:

  • rewardsDuration is the duration of the staking period in seconds
  • rewardAmount is the amount of TEL to distribute during the staking period
  • Each function has a security role associated with it. This will allow more modular secuirty as certain aspects could be outsourced to third party providers.

  • The TELx Council can add existing staking contracts to the Manager Contracts internal list
  • Deploy new staking contracts administered by the Manager Contract
    • createNewStakingRewardsContract
  • Remove staking contracts from the Manager
    • Roles of the staking contract can be added and removed by calling grantRole or revokeRole.
  • Set configuration for any staking contract that is currently being managed
    • setStakingConfig
  • Set the StakingRewards factory contract for deploying new staking contracts
    • setStakingRewardsFactory
  • Recover arbitrary ERC20 tokens from the manager or from managed staking contracts
    • recoverERC20FromStaking and recoverERC20
  • Change the period finish time of any managed staking contract
    • This should only be used if there is a problem with a staking contract and it needs to stop distributing rewards or if configuration changes cannot wait until the end of the staking period
    • updatePeriodFinish
  • Start staking periods
    • topUp provides rewards to the staking contracts from the source provided and initiates the next staking period
    • These top up calls can be automated with a tool like Gelato

    Altering the System

    The Manager Contract is a transparent proxy, so the code of the manager can be changed while keeping the same contract address which owns the staking contracts. To upgrade the Manager, a new implementation of the code must be deployed, then the TELx Council can call upgradeTo on the proxy.