@@ -28,8 +28,8 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
2828import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol " ;
2929
3030/// @notice TokenStaking is the main staking contract of the Threshold Network.
31- /// Additionally, it serves as application manager for the apps
32- /// that run on the Threshold Network.
31+ /// It serves as application manager for the apps that run on
32+ /// the Threshold Network.
3333/// @dev TokenStaking is upgradeable, using OpenZeppelin's Upgradeability
3434/// framework. As such, it is required to satisfy OZ's guidelines, like
3535/// restrictions on constructors, immutable variables, base contracts and
@@ -39,6 +39,13 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
3939 using PercentUtils for uint256 ;
4040 using SafeCastUpgradeable for uint256 ;
4141
42+ // enum is used for Staked event to have backward compatibility
43+ enum StakeType {
44+ NU,
45+ KEEP,
46+ T
47+ }
48+
4249 enum ApplicationStatus {
4350 NOT_APPROVED,
4451 APPROVED,
@@ -47,9 +54,9 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
4754 }
4855
4956 struct StakingProviderInfo {
50- uint96 legacyNuInTStake ;
57+ uint96 nuInTStake ;
5158 address owner;
52- uint96 legacyKeepInTStake ;
59+ uint96 keepInTStake ;
5360 address payable beneficiary;
5461 uint96 tStake;
5562 address authorizer;
@@ -101,6 +108,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
101108 uint256 public slashingQueueIndex;
102109
103110 event Staked (
111+ StakeType indexed stakeType ,
104112 address indexed owner ,
105113 address indexed stakingProvider ,
106114 address beneficiary ,
@@ -263,6 +271,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
263271 increaseStakeCheckpoint (stakingProvider, amount);
264272
265273 emit Staked (
274+ StakeType.T,
266275 msg .sender ,
267276 stakingProvider,
268277 beneficiary,
@@ -641,10 +650,10 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
641650 //
642651 //
643652
644- /// @notice Reduces the liquid T stake amount by the provided amount and
653+ /// @notice Reduces the T stake amount by the provided amount and
645654 /// withdraws T to the owner. Reverts if there is at least one
646- /// authorization higher than the remaining liquid T stake or
647- /// if the unstake amount is higher than the liquid T stake amount.
655+ /// authorization higher than the remaining T stake or
656+ /// if the unstake amount is higher than the T stake amount.
648657 /// Can be called only by the delegation owner or the staking
649658 /// provider.
650659 function unstakeT (address stakingProvider , uint96 amount )
@@ -814,7 +823,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
814823 }
815824
816825 /// @notice Returns staked amount of T for the specified staking provider.
817- function tStake (address stakingProvider )
826+ function stakeAmount (address stakingProvider )
818827 external
819828 view
820829 override
0 commit comments