threshold-network / merkle-distribution

Threshold Network rewards generation and distribution
https://threshold.network
1 stars 6 forks source link

Handling legacy staking (Nu & Keep tokens) end of support #112

Closed manumonti closed 7 months ago

manumonti commented 9 months ago

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 and keepInT tokens. Either way, the staking rewards have been calculated from nuInT and keepInT 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 and keepInT 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 or keepInT greater than 0.

Also, these tokens nuInT and keepInT 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

Additional work

manumonti commented 9 months ago

List of legacy stakes affected:

Legacy staking provider list ``` '0x01474098607ed064f72832e1491b2261967166da', '0x04670e07912b3764cc1ccf1c22ad0f35b95e9ba0', '0x06eb8d86cbc1693079d2ff0fa9cb55a26cd07f15', '0x07c9a8f8264221906b7b8958951ce4753d39628b', '0x0ace6419dbdab7f9330568258b9ddb37a295b677', '0x229beeaa51590c3abbc628af55283b73ed2dbf9d', '0x25d9bbb4eccbf3a5e6d6bbce9813302e508f321d', '0x33769235a2980730ae7e17fc6eaf4740530cde1b', '0x378c89b5b93667a005856822e1b65e2d7c076373', '0x1147ccfb4aefc6e587a23b78724ef20ec6e474d4', '0x456d643cd97b058fd3bbbeb76f04b1de3679bc6a', '0x650a9ed18df873cad98c88dcac8170531cad2399', '0x4d3c343d4bd676e4098336ef75f1d717149623a1', '0xd977144724bc77faefae219f958ae3947205d0b5', '0x56c968857ef4919c67d151b56e7073065994c97a', '0xcbb734bba70c6462a9f22c2b481346ebef3cfad3', '0x700277deaf138c6af9b3177f83918b6a3544f27f', '0x2ebe08379f4fd866e871a9b9e1d5c695154c6a9f', '0x8cc46611bec3217d058d92fd234a8ed7d205e0d2', '0x83237ba2b7d0bf23090196fccbfb2be1ef21580d', '0x855a75f56706d7be02e2d20b74a0725abbdc453e', '0x4bfa10b1538e8e765e995688d8eec39c717b6797', '0x8868240903e44c7cb8bc5a5158f3de10707644e9', '0x8d0b183b68cc93b9f9e1490c85b4a4965ef5cd3b', '0x8d34285c047d5d8757551baa45e471e62e72f468', '0x9919c9f5cbbaa42cb3bea153e14e16f85fea5b5d', '0x3b9e5ae72d068448bb96786989c0d86fbc0551d1', '0xa2e44666bab3ed3be4f87b7c18ed2ffb911c0bef', '0xa6a2ae15f74f1e3f574f419a8853f0c9b095bc48', '0xa829c2e33907ab03d27d5dbb39effd8386112789', '0xb70c8d55d397aa5d76f96c64b3e4084db95c739e', '0xa4166c3e14cbdd6d4494945a99616f1c73ad9699', '0xaea619d02dcf7299fb24db2f60a08bfc8fb2dbcf', '0xca70fea021359778daec479b97d0cd2efe1ad099', '0xdcd4199e22d09248ca2583cbdd2759b2acd22381', '0xfc97a906c715587b56c2c65a07ce731ba80339de', '0xc82bed104c3d5785fecebf906e5b1747a1bce681', '0xcd087a44ed8ee2ace79f497c803005ff79a64a94', '0xce4407df6ae8a92eb69412bd6a8ec49a9b9b40dd', '0xd0908b1e0f6e64e3097c663bf95e2e9c040dd40d', '0xd680b01503cf95a489010da7409980060991d096', '0xd6edf0bc0c19f87ecef67632bfcd212ce8324ab9', '0x341154298ab7ca86278df9665fb2b8610b92214d', '0xe26e2d93bbc8fde0e1e3b290fc927fb374e7e34e', '0xa5f6822ef1a7df72628259f9d1dc17eb2bcb2385', '0x045e511f53debf55c9c0b4522f14f602f7c7ca81', '0xf9283ac13aec8a2b60a56a82f1f5e4da1742ccf8', '0xfd771e3e34a93e19caad4c11c3be16c70d5ec2fd' ```

Legacy stakes authorizations: https://gist.github.com/manumonti/3d5c82bffd43476838d6093deaa73de7

Monitoring legacy stakes staked amount: https://gist.github.com/manumonti/198e3fe2f9d4b5f0442b6354ff8ffa8b

manumonti commented 9 months ago

Related issues: https://github.com/threshold-network/merkle-distribution/issues/95

manumonti commented 7 months ago

All tasks have been finalized.