|
| 1 | +// SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | + |
| 3 | +// ██████████████ ▐████▌ ██████████████ |
| 4 | +// ██████████████ ▐████▌ ██████████████ |
| 5 | +// ▐████▌ ▐████▌ |
| 6 | +// ▐████▌ ▐████▌ |
| 7 | +// ██████████████ ▐████▌ ██████████████ |
| 8 | +// ██████████████ ▐████▌ ██████████████ |
| 9 | +// ▐████▌ ▐████▌ |
| 10 | +// ▐████▌ ▐████▌ |
| 11 | +// ▐████▌ ▐████▌ |
| 12 | +// ▐████▌ ▐████▌ |
| 13 | +// ▐████▌ ▐████▌ |
| 14 | +// ▐████▌ ▐████▌ |
| 15 | + |
| 16 | +pragma solidity ^0.8.9; |
| 17 | + |
| 18 | +import "./IApplication.sol"; |
| 19 | + |
| 20 | +/// @title Interface for Threshold Network applications with delay after decrease request |
| 21 | +interface IApplicationWithDecreaseDelay is IApplication { |
| 22 | + /// @notice Returns authorization-related parameters of the application. |
| 23 | + /// @dev The minimum authorization is also returned by `minimumAuthorization()` |
| 24 | + /// function, as a requirement of `IApplication` interface. |
| 25 | + /// @return _minimumAuthorization The minimum authorization amount required |
| 26 | + /// so that operator can participate in the application. |
| 27 | + /// @return authorizationDecreaseDelay Delay in seconds that needs to pass |
| 28 | + /// between the time authorization decrease is requested and the |
| 29 | + /// time that request gets approved. Protects against participants |
| 30 | + /// earning rewards and not being active in the network. |
| 31 | + /// @return authorizationDecreaseChangePeriod Authorization decrease change |
| 32 | + /// period in seconds. It is the time window, before authorization decrease |
| 33 | + /// delay ends, during which the pending authorization decrease |
| 34 | + /// request can be overwritten. |
| 35 | + /// If set to 0, pending authorization decrease request can not be |
| 36 | + /// overwritten until the entire `authorizationDecreaseDelay` ends. |
| 37 | + /// If set to a value equal to `authorizationDecreaseDelay`, request can |
| 38 | + /// always be overwritten. |
| 39 | + function authorizationParameters() |
| 40 | + external |
| 41 | + view |
| 42 | + returns ( |
| 43 | + uint96 _minimumAuthorization, |
| 44 | + uint64 authorizationDecreaseDelay, |
| 45 | + uint64 authorizationDecreaseChangePeriod |
| 46 | + ); |
| 47 | + |
| 48 | + /// @notice Returns the amount of stake that is pending authorization |
| 49 | + /// decrease for the given staking provider. If no authorization |
| 50 | + /// decrease has been requested, returns zero. |
| 51 | + function pendingAuthorizationDecrease(address _stakingProvider) |
| 52 | + external |
| 53 | + view |
| 54 | + returns (uint96); |
| 55 | + |
| 56 | + /// @notice Returns the remaining time in seconds that needs to pass before |
| 57 | + /// the requested authorization decrease can be approved. |
| 58 | + function remainingAuthorizationDecreaseDelay(address stakingProvider) |
| 59 | + external |
| 60 | + view |
| 61 | + returns (uint64); |
| 62 | + |
| 63 | + /// @notice Approves the previously registered authorization decrease |
| 64 | + /// request. Reverts if authorization decrease delay has not passed |
| 65 | + /// yet or if the authorization decrease was not requested for the |
| 66 | + /// given staking provider. |
| 67 | + function approveAuthorizationDecrease(address stakingProvider) external; |
| 68 | +} |
0 commit comments