@@ -260,66 +260,6 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
260260 //
261261 //
262262
263- /// @notice Allows the Governance to approve the particular application
264- /// before individual stake authorizers are able to authorize it.
265- function approveApplication (address application )
266- external
267- override
268- onlyGovernance
269- {
270- require (application != address (0 ), "Parameters must be specified " );
271- ApplicationInfo storage info = applicationInfo[application];
272- require (
273- info.status == ApplicationStatus.NOT_APPROVED ||
274- info.status == ApplicationStatus.PAUSED,
275- "Can't approve application "
276- );
277-
278- if (info.status == ApplicationStatus.NOT_APPROVED) {
279- applications.push (application);
280- }
281- info.status = ApplicationStatus.APPROVED;
282- emit ApplicationStatusChanged (application, ApplicationStatus.APPROVED);
283- }
284-
285- /// @notice Requests decrease of all authorizations for the given staking
286- /// provider on all applications by all authorized amount.
287- /// It may not change the authorized amount immediatelly. When
288- /// it happens depends on the application. Can only be called by the
289- /// given staking provider’s authorizer. Overwrites pending
290- /// authorization decrease for the given staking provider and
291- /// application.
292- /// @dev Calls `authorizationDecreaseRequested` callback
293- /// for each authorized application. See `IApplication`.
294- function requestAuthorizationDecrease (address stakingProvider ) external {
295- StakingProviderInfo storage stakingProviderStruct = stakingProviders[
296- stakingProvider
297- ];
298- uint96 deauthorizing = 0 ;
299- for (
300- uint256 i = 0 ;
301- i < stakingProviderStruct.authorizedApplications.length ;
302- i++
303- ) {
304- address application = stakingProviderStruct.authorizedApplications[
305- i
306- ];
307- uint96 authorized = stakingProviderStruct
308- .authorizations[application]
309- .authorized;
310- if (authorized > 0 ) {
311- requestAuthorizationDecrease (
312- stakingProvider,
313- application,
314- authorized
315- );
316- deauthorizing += authorized;
317- }
318- }
319-
320- require (deauthorizing > 0 , "Nothing was authorized " );
321- }
322-
323263 /// @notice Called by the application at its discretion to approve the
324264 /// previously requested authorization decrease request. Can only be
325265 /// called by the application that was previously requested to
@@ -399,8 +339,8 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
399339 /// Can be called only by the delegation owner or the staking
400340 /// provider.
401341 function optOutDecreaseAuthorization (address stakingProvider , uint96 amount )
402- external
403- onlyOwnerOrStakingProvider (stakingProvider)
342+ public
343+ onlyAuthorizerOf (stakingProvider)
404344 {
405345 require (amount > 0 , "Parameters must be specified " );
406346 StakingProviderInfo storage stakingProviderStruct = stakingProviders[
@@ -682,40 +622,10 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
682622 /// application. See `IApplication`.
683623 function requestAuthorizationDecrease (
684624 address stakingProvider ,
685- address application ,
625+ address ,
686626 uint96 amount
687627 ) public override onlyAuthorizerOf (stakingProvider) {
688- ApplicationInfo storage applicationStruct = applicationInfo[
689- application
690- ];
691- require (
692- applicationStruct.status == ApplicationStatus.APPROVED,
693- "Application is not approved "
694- );
695-
696- require (amount > 0 , "Parameters must be specified " );
697-
698- AppAuthorization storage authorization = stakingProviders[
699- stakingProvider
700- ].authorizations[application];
701- require (
702- authorization.authorized >= amount,
703- "Amount exceeds authorized "
704- );
705-
706- authorization.deauthorizing = amount;
707- uint96 deauthorizingTo = authorization.authorized - amount;
708- emit AuthorizationDecreaseRequested (
709- stakingProvider,
710- application,
711- authorization.authorized,
712- deauthorizingTo
713- );
714- IApplication (application).authorizationDecreaseRequested (
715- stakingProvider,
716- authorization.authorized,
717- deauthorizingTo
718- );
628+ optOutDecreaseAuthorization (stakingProvider, amount);
719629 }
720630
721631 /// @notice Forced deauthorization of Beta staker.
@@ -1016,6 +926,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
1016926 }
1017927 }
1018928
929+ // slither-disable-next-line dead-code
1019930 function skipApplication (address application )
1020931 internal
1021932 pure
0 commit comments