Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document contains design information relating to both FIP-6 and FIP-21

https://github.com/fioprotocol/fips/blob/master/fip-0006.mdhttps://github.com/fioprotocol/fips/blob/master/fip-0021.md

this effort is tracked by the following story

https://fioprotocol.atlassian.net/secure/RapidBoard.jspa?rapidView=2&projectKey=BD&modal=detail&selectedIssue=BD-2240&assignee=5b1708cb73c23f253a5f8692

Design:FIP-6:

for FIP-6 There are several important factors

  1. Establish tables to be used to record and account the new locked token model (these are called general locked tokens in this design).

  2. integrate the new tables into the locked token accounting for voting and transferring of tokens. This task is relatively easy as we can use the same pattern of development as the genesis grants, and we can add logic for general locks in the places where the genesis locks are integrated, but we can do this in a way that will NOT impact the genesis locks. (IE: we will make new methods to handle the general locks, and leave the genesis locks untouched).

  3. provide new actions for creating these new locks, this will require 2 new actions, one in the token contract, and one in the system contract (trnsloctoks, and addgenlocked)

  4. integrate the new locking logic into the token contract and the system contract

    1. make can transfer, and computegenerallockedtokens similar to the genesis token accounting, implement the logic specific for the general locks.

    2. integrate the calls to these new methods throughout the token contract and system contract as necessary to ensure voting and transfer update the accounting as expected.

FIP-21:

There are 2 important aspects of the staking incentives being proposed:

  1. Establish and integrate a set of set business rules for when to provide incentives, compute the amount of incentive to provide when incentives are applicable.

    1. We will modify the trnsloctoks (transfer locked tokens) action in the following ways:

      1. it will look for one locking period being present and a duration matching the set of durations specified for the incentive program. The changes will be programmed using a block of constants which will aid in modifications going forward.

      2. Before minting any new tokens,The amount to be added to the grant will be computed according to the table in FIP-21, this will be called Ra. the contents of the total_staking_incentives_granted will be checked, if the total_staking_incentives_granted is less than 20,000,000 then incentives will be added to the grant. if the total_staking_incentives_granted is >= 20,000,000 then NO incentives will be added to the grant. if incentives are being offered for this grant, The amount of incentives remaining will be calculate ad Ri = 20,000,000 - total_staking_incentives_granted . If Ri is less than the amount Ra, the incentive amount to be given will be reset for this grant to become Ri.

      3. Conditional minting logic will be added in order to provide the necessary additional tokens to the locked token grant account. Tokens will be minted directly to the grant account. The total amount of the grant will be increased by the amount of the incentive. Then the locked tokens table entry will be added to the table

  2. Track the total amount of incentives provided by the program, and stop providing incentives once the 20,000,000 FIO threshold is reached.

    1. A new global state table (global4) will be created containing the total_staking_incentives_granted. This table will be updated with any incentive amounts used by adding the computed incentive amount (as stated above) to the previous value of the table, until the 20,000,000 threshold is reached.

...

SDK Requirements

  • Note functional updates needed for SDKs

Functional Test plan

please refer to the javascript tests, which contain all of the tests for the general locks and staking incentives.

https://github.com/fioprotocol/fio.test/pull/26

Performance Testing plan

  • send the max number of locking periods (50), do this for 1000 users, verify general locks and staking incentives occurs without incident for individuals5000 users, then create small incentivized grants for another 5000. once this load is in place perform the functional tests, verify they pass. Do this on the dev net.

Fork Testing plan

  • this is not a forking change. the chain code modifications associated with FIP-6 will be released at a later time.

Rollout/Release plan6

  • new actions

  • removed actions

  • MSIGs

Rollout/Release verification plan

  • verification of rollout.

    • verify the locktokens table is present.

    • verify the abi for the system and the token contract, verify all new actions are present.

    • verify using get_actions that the new actions are present.

ToDo:

  1. address bug with domains.

  2. https://fioprotocol.atlassian.net/secure/RapidBoard.jspa?rapidView=2&projectKey=BD&modal=detail&selectedIssue=BD-2244&assignee=5b1708cb73c23f253a5f8692

  3. follow up with pawel to discover if we are final for the requirements.