Skip to content
12 changes: 6 additions & 6 deletions contracts/staking/IApplicationWithDecreaseDelay.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ import "./IApplication.sol";

/// @title Interface for Threshold Network applications with delay after decrease request
interface IApplicationWithDecreaseDelay is IApplication {
/// @notice Approves the previously registered authorization decrease
/// request. Reverts if authorization decrease delay has not passed
/// yet or if the authorization decrease was not requested for the
/// given staking provider.
function approveAuthorizationDecrease(address stakingProvider) external;

/// @notice Returns authorization-related parameters of the application.
/// @dev The minimum authorization is also returned by `minimumAuthorization()`
/// function, as a requirement of `IApplication` interface.
Expand Down Expand Up @@ -59,10 +65,4 @@ interface IApplicationWithDecreaseDelay is IApplication {
external
view
returns (uint64);

/// @notice Approves the previously registered authorization decrease
/// request. Reverts if authorization decrease delay has not passed
/// yet or if the authorization decrease was not requested for the
/// given staking provider.
function approveAuthorizationDecrease(address stakingProvider) external;
}
20 changes: 10 additions & 10 deletions contracts/staking/IApplicationWithOperator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ import "./IApplication.sol";

/// @title Interface for Threshold Network applications with operator role
interface IApplicationWithOperator is IApplication {
/// @notice Used by staking provider to set operator address that will
/// operate a node. The operator address must be unique.
/// Reverts if the operator is already set for the staking provider
/// or if the operator address is already in use.
/// @dev Depending on application the given staking provider can set operator
/// address only once or multiple times. Besides that, application can decide
/// if function reverts if there is a pending authorization decrease for
/// the staking provider.
function registerOperator(address operator) external;

/// @notice Returns operator registered for the given staking provider.
function stakingProviderToOperator(address stakingProvider)
external
Expand All @@ -30,14 +40,4 @@ interface IApplicationWithOperator is IApplication {
external
view
returns (address);

/// @notice Used by staking provider to set operator address that will
/// operate a node. The operator address must be unique.
/// Reverts if the operator is already set for the staking provider
/// or if the operator address is already in use.
/// @dev Depending on application the given staking provider can set operator
/// address only once or multiple times. Besides that, application can decide
/// if function reverts if there is a pending authorization decrease for
/// the staking provider.
function registerOperator(address operator) external;
}
79 changes: 0 additions & 79 deletions contracts/staking/IStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ interface IStaking {
//
//

/// @notice Creates a delegation with `msg.sender` owner with the given
/// staking provider, beneficiary, and authorizer. Transfers the
/// given amount of T to the staking contract.
/// @dev The owner of the delegation needs to have the amount approved to
/// transfer to the staking contract.
function stake(
address stakingProvider,
address payable beneficiary,
address authorizer,
uint96 amount
) external;

/// @notice Allows the Governance to set the minimum required stake amount.
/// This amount is required to protect against griefing the staking
/// contract and individual applications are allowed to require
Expand All @@ -57,22 +45,6 @@ interface IStaking {
//
//

/// @notice Allows the Governance to approve the particular application
/// before individual stake authorizers are able to authorize it.
function approveApplication(address application) external;

/// @notice Increases the authorization of the given staking provider for
/// the given application by the given amount. Can only be called by
/// the authorizer for that staking provider.
/// @dev Calls `authorizationIncreased(address stakingProvider, uint256 amount)`
/// on the given application to notify the application about
/// authorization change. See `IApplication`.
function increaseAuthorization(
address stakingProvider,
address application,
uint96 amount
) external;

/// @notice Requests decrease of the authorization for the given staking
/// provider on the given application by the provided amount.
/// It may not change the authorized amount immediatelly. When
Expand All @@ -90,17 +62,6 @@ interface IStaking {
uint96 amount
) external;

/// @notice Requests decrease of all authorizations for the given staking
/// provider on all applications by all authorized amount.
/// It may not change the authorized amount immediatelly. When
/// it happens depends on the application. Can only be called by the
/// given staking provider’s authorizer. Overwrites pending
/// authorization decrease for the given staking provider and
/// application.
/// @dev Calls `authorizationDecreaseRequested(address stakingProvider, uint256 amount)`
/// for each authorized application. See `IApplication`.
function requestAuthorizationDecrease(address stakingProvider) external;

/// @notice Called by the application at its discretion to approve the
/// previously requested authorization decrease request. Can only be
/// called by the application that was previously requested to
Expand Down Expand Up @@ -145,23 +106,6 @@ interface IStaking {
/// Can only be called by the Governance.
function setAuthorizationCeiling(uint256 ceiling) external;

//
//
// Stake top-up
//
//

/// @notice Increases the amount of the stake for the given staking provider.
/// If `autoIncrease` flag is true then the amount will be added for
/// all authorized applications.
/// @dev The sender of this transaction needs to have the amount approved to
/// transfer to the staking contract.
function topUp(address stakingProvider, uint96 amount) external;

/// @notice Toggle `autoIncrease` flag. If true then the complete amount
/// in top-up will be added to already authorized applications.
function toggleAutoAuthorizationIncrease(address stakingProvider) external;

//
//
// Undelegating a stake (unstaking)
Expand All @@ -182,14 +126,6 @@ interface IStaking {
//
//

/// @notice Sets reward in T tokens for notification of misbehaviour
/// of one staking provider. Can only be called by the governance.
function setNotificationReward(uint96 reward) external;

/// @notice Transfer some amount of T tokens as reward for notifications
/// of misbehaviour
function pushNotificationReward(uint96 reward) external;

/// @notice Withdraw some amount of T tokens from notifiers treasury.
/// Can only be called by the governance.
function withdrawNotificationReward(address recipient, uint96 amount)
Expand All @@ -212,12 +148,6 @@ interface IStaking {
address[] memory stakingProviders
) external;

/// @notice Takes the given number of queued slashing operations and
/// processes them. Receives 5% of the slashed amount.
/// Executes `involuntaryAllocationDecrease` function on each
/// affected application.
function processSlashing(uint256 count) external;

//
//
// Auxiliary functions
Expand All @@ -244,12 +174,6 @@ interface IStaking {
view
returns (uint256);

/// @notice Returns auto-increase flag.
function getAutoIncreaseFlag(address stakingProvider)
external
view
returns (bool);

/// @notice Gets the stake owner, the beneficiary and the authorizer
/// for the specified staking provider address.
/// @return owner Stake owner address.
Expand All @@ -267,9 +191,6 @@ interface IStaking {
/// @notice Returns length of application array
function getApplicationsLength() external view returns (uint256);

/// @notice Returns length of slashing queue
function getSlashingQueueLength() external view returns (uint256);

/// @notice Returns the maximum application authorization
function getMaxAuthorization(address stakingProvider)
external
Expand Down
Loading