Closed manumonti closed 7 months ago
List of legacy stakes affected:
Legacy stakes authorizations: https://gist.github.com/manumonti/3d5c82bffd43476838d6093deaa73de7
Monitoring legacy stakes staked amount: https://gist.github.com/manumonti/198e3fe2f9d4b5f0442b6354ff8ffa8b
All tasks have been finalized.
Context
Before the Threshold network emerged, there were Nu and Keep stakers. Up to now, these users have been earning staking rewards. To achieve this, the legacy tokens were accepted in the TokenStaking contract, establishing a conversion between these tokens and the T token through the VendingMachine contract.
These converted tokens have been treated as a special case in the TokenStaking contract, so these were not T tokens, but
nuInT
andkeepInT
tokens. Either way, the staking rewards have been calculated fromnuInT
andkeepInT
values in the same way that the staked T.Since it has been planned to stop supporting these legacy stakers, there was an update on staking contracts, so these tokens
nuInT
andkeepInT
are no longer eligible to earn rewards.This is the tx where this happened: https://etherscan.io/tx/0x68ddee6b5651d5348a40555b0079b5066d05a63196e3832323afafae0095a656#eventlog
The changes made consisted of the legacy tokens being unstaked. So subgraph queries return 0 stakes with
nuInT
orkeepInT
greater than 0.Also, these tokens
nuInT
andkeepInT
have been used as authorization amount in tBTC and RandomBeacon apps. So, in addition to the unstaking of these tokens, the authorization amount has been decreased. InvoluntaryAuthorizationDecrease events were emitted (see tx logs in Etherscan link above).So, now, the stakers can withdraw their NU/KEEP tokens from the legacy NU/KEEP staking contracts, upgrading them to T and stake resulting T. If they do this before the deadlines, they will receive all the rewards even when there is a transition period in which they didn't be eligible for rewards. The process to achieve this is described here: https://forum.threshold.network/t/transition-guide-for-legacy-stakers/719
Also, see https://github.com/threshold-network/solidity-contracts/issues/141.
Action points
[x] Release a distribution with the rewards earned before unstaking tx: stakes should earn rewards as usual in the period between the last distribution (Nov 1st) and the unstaking tx (Nov 22nd). This requires modifying how the tBTC rewards script captures the authorization events. ✅ Done -> #106 #107 #109 #110
[x] Release a partial distribution with the rewards earned between unstaking tx (Nov 22nd) and the next planned release date (Dec 1st). Nov 22nd is the starting date for the transition period (see Transition Guide for Legacy Stakers, so we can't be sure if legacy stakes will earn the full rewards or not (it depends on if they complete the transition process or not). So stakes that had legacy tokens are not going to earn rewards in this short period, and the earned amount will be calculated and distributed in distributions after the transition deadline dates. ✅ Done -> #111
[x] #114 Release a distribution that includes legacy Nu stakes. The transition process deadline for legacy Nu stakes ends 7th Dec, so to distribute the rewards earned since Nov 22nd we are going to distribute a rewards batch that will include those earned by (a) legacy Nu stakes that completed the transition process. The period of these rewards is Nov 22nd to Dec 7th. (b) stakes that haven't legacy tokens (i.e. regular stakes). The period of these rewards is Dec 1st to Dec 7th. ✅ Done -> #116 . Rewards' distribution fixed in -> #122
[x] Release a distribution for Jan 1st. This distribution will include the earnings of the regular stakes for the period Dec 7th to Jan 1st. This distribution will not include legacy Keep earnings. ✅ Done -> #118 . Rewards' distribution fixed in -> #122
[x] Release a distribution for Feb 1st. This distribution will include the earnings of the regular stakes for the period Jan 1st to Feb 1st. This distribution will include legacy Keep earnings for those stakes that, at this time, have finalized the transition process. ✅ Done -> #128 #129
[x] Release a partial distribution with earnings before Keep transition deadline. This distribution will include: (a) the rewards for the period Feb 1st to Feb 23rd of regular stakes (no legacy stakes). (b) the rewards earned by legacy Keep stakes for the period Nov 22nd (unstaking tx) to Feb 23rd. Only those legacy Keep stakes that completed the transition process are eligible for rewards. Note: check if the amount of T that the legacy staker have topped up and authorized is the same that it was unstaked/deauthorized. If the staker authorize a lower amount, the earned rewards must be lower also. ✅ Done -> #137 #138
[x] Release a regular distribution with earnings after Keep transition deadline. This distribution will include the rewards for the period Feb 23rd to Mar 1st for all stakes. The legacy stake transition process has been completed, so the following distributions don't need to have special rules for them. ✅ Done -> #139 #140
Additional work