@@ -37,6 +37,13 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
3737 using SafeTUpgradeable for T;
3838 using SafeCastUpgradeable for uint256 ;
3939
40+ // enum is used for Staked event to have backward compatibility
41+ enum StakeType {
42+ NU,
43+ KEEP,
44+ T
45+ }
46+
4047 enum ApplicationStatus {
4148 NOT_APPROVED,
4249 APPROVED,
@@ -101,11 +108,25 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
101108 // slither-disable-next-line constable-states
102109 uint256 private legacySlashingQueueIndex;
103110
111+ event Staked (
112+ StakeType indexed stakeType ,
113+ address indexed owner ,
114+ address indexed stakingProvider ,
115+ address beneficiary ,
116+ address authorizer ,
117+ uint96 amount
118+ );
104119 event MinimumStakeAmountSet (uint96 amount );
105120 event ApplicationStatusChanged (
106121 address indexed application ,
107122 ApplicationStatus indexed newStatus
108123 );
124+ event AuthorizationIncreased (
125+ address indexed stakingProvider ,
126+ address indexed application ,
127+ uint96 fromAmount ,
128+ uint96 toAmount
129+ );
109130 event AuthorizationDecreaseRequested (
110131 address indexed stakingProvider ,
111132 address indexed application ,
@@ -130,8 +151,26 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
130151 address indexed panicButton
131152 );
132153 event AuthorizationCeilingSet (uint256 ceiling );
154+ event ToppedUp (address indexed stakingProvider , uint96 amount );
155+ event AutoIncreaseToggled (
156+ address indexed stakingProvider ,
157+ bool autoIncrease
158+ );
133159 event Unstaked (address indexed stakingProvider , uint96 amount );
160+ event TokensSeized (
161+ address indexed stakingProvider ,
162+ uint96 amount ,
163+ bool indexed discrepancy
164+ );
165+ event NotificationRewardSet (uint96 reward );
166+ event NotificationRewardPushed (uint96 reward );
134167 event NotificationRewardWithdrawn (address recipient , uint96 amount );
168+ event NotifierRewarded (address indexed notifier , uint256 amount );
169+ event SlashingProcessed (
170+ address indexed caller ,
171+ uint256 count ,
172+ uint256 tAmount
173+ );
135174 event GovernanceTransferred (address oldGovernance , address newGovernance );
136175
137176 modifier onlyGovernance () {
@@ -343,15 +382,14 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
343382 cleanAuthorizedApplications (stakingProviderStruct, 1 );
344383 }
345384
346- // TODO consider rename
347385 /// @notice Forced deauthorization of stake above 15m T.
348386 /// Can be called by anyone.
349- function forceCapDecreaseAuthorization (address [] memory _stakingProviders )
387+ function forceAuthorizationCap (address [] memory _stakingProviders )
350388 external
351389 {
352390 require (_stakingProviders.length > 0 , "Wrong input parameters " );
353391 for (uint256 i = 0 ; i < _stakingProviders.length ; i++ ) {
354- forceCapDecreaseAuthorization (_stakingProviders[i]);
392+ forceAuthorizationCap (_stakingProviders[i]);
355393 }
356394 }
357395
@@ -375,7 +413,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
375413 maxAuthorization = MAX_STAKE;
376414 availableToOptOut = HALF_MAX_STAKE;
377415 }
378- require (availableToOptOut >= amount, "Opt-out is not available " ); // TODO rephrase
416+ require (availableToOptOut >= amount, "Opt-out amount too high " );
379417 forceDecreaseAuthorization (stakingProvider, maxAuthorization - amount);
380418 stakingProviderStruct.optOutAmount += amount;
381419 }
@@ -710,9 +748,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
710748
711749 /// @notice Forced deauthorization of stake above 15m T.
712750 /// Can be called by anyone.
713- // TODO consider rename
714- function forceCapDecreaseAuthorization (address stakingProvider ) public {
715- //override {
751+ function forceAuthorizationCap (address stakingProvider ) public {
716752 forceDecreaseAuthorization (stakingProvider, MAX_STAKE);
717753 }
718754
@@ -950,7 +986,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
950986 }
951987 }
952988
953- require (deauthorized > 0 , "Nothing was deauthorized " );
989+ require (deauthorized > 0 , "Nothing to deauthorize " );
954990 }
955991
956992 function getAvailableOptOutAmount (
0 commit comments