...
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.
We will modify the trnsloctok trnsloctoks (transfer locked tokens) action in the following ways:
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.
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.
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 fio.treasury account and then transferred to the token 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
Track the total amount of incentives provided by the program, and stop providing incentives once the 20,000,000 FIO threshold is reached.
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.
...
Note functional updates needed for SDKs
Functional Test plan
...
FIP-6
FIP-21
...
transfer locked tokens for each specific reward timeframe, note the resulting amounts are correct
...
transfer locked tokens for other timeframes, note no incentives are given (one period, multi period).
...
verify unlocking logic of both incentivized and non incentivized grants.
...
verify the behavior of the total_staking_incentives_granted on a per event basis.
...
verify the behavior of the incentive given when the total_staking_incentives_granted is close to the threshold and less FIO are available than the computed incentive.
...
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 unlocking general locks and staking incentives occurs without incident for individuals.
...