|
| 1 | +// SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | + |
| 3 | +pragma solidity 0.8.9; |
| 4 | + |
| 5 | +/// @title IKeepTokenStaking |
| 6 | +/// @notice Interface for Keep TokenStaking contract |
| 7 | +interface IKeepTokenStaking { |
| 8 | + /// @notice Seize provided token amount from every member in the misbehaved |
| 9 | + /// operators array. The tattletale is rewarded with 5% of the total seized |
| 10 | + /// amount scaled by the reward adjustment parameter and the rest 95% is burned. |
| 11 | + /// @param amountToSeize Token amount to seize from every misbehaved operator. |
| 12 | + /// @param rewardMultiplier Reward adjustment in percentage. Min 1% and 100% max. |
| 13 | + /// @param tattletale Address to receive the 5% reward. |
| 14 | + /// @param misbehavedOperators Array of addresses to seize the tokens from. |
| 15 | + function seize( |
| 16 | + uint256 amountToSeize, |
| 17 | + uint256 rewardMultiplier, |
| 18 | + address tattletale, |
| 19 | + address[] memory misbehavedOperators |
| 20 | + ) external; |
| 21 | + |
| 22 | + /// @notice Gets stake delegation info for the given operator. |
| 23 | + /// @param operator Operator address. |
| 24 | + /// @return amount The amount of tokens the given operator delegated. |
| 25 | + /// @return createdAt The time when the stake has been delegated. |
| 26 | + /// @return undelegatedAt The time when undelegation has been requested. |
| 27 | + /// If undelegation has not been requested, 0 is returned. |
| 28 | + function getDelegationInfo(address operator) |
| 29 | + external |
| 30 | + view |
| 31 | + returns ( |
| 32 | + uint256 amount, |
| 33 | + uint256 createdAt, |
| 34 | + uint256 undelegatedAt |
| 35 | + ); |
| 36 | + |
| 37 | + /// @notice Gets the stake owner for the specified operator address. |
| 38 | + /// @return Stake owner address. |
| 39 | + function ownerOf(address operator) external view returns (address); |
| 40 | + |
| 41 | + /// @notice Gets the beneficiary for the specified operator address. |
| 42 | + /// @return Beneficiary address. |
| 43 | + function beneficiaryOf(address operator) |
| 44 | + external |
| 45 | + view |
| 46 | + returns (address payable); |
| 47 | + |
| 48 | + /// @notice Gets the authorizer for the specified operator address. |
| 49 | + /// @return Authorizer address. |
| 50 | + function authorizerOf(address operator) external view returns (address); |
| 51 | + |
| 52 | + /// @notice Gets the eligible stake balance of the specified address. |
| 53 | + /// An eligible stake is a stake that passed the initialization period |
| 54 | + /// and is not currently undelegating. Also, the operator had to approve |
| 55 | + /// the specified operator contract. |
| 56 | + /// |
| 57 | + /// Operator with a minimum required amount of eligible stake can join the |
| 58 | + /// network and participate in new work selection. |
| 59 | + /// |
| 60 | + /// @param operator address of stake operator. |
| 61 | + /// @param operatorContract address of operator contract. |
| 62 | + /// @return balance an uint256 representing the eligible stake balance. |
| 63 | + function eligibleStake(address operator, address operatorContract) |
| 64 | + external |
| 65 | + view |
| 66 | + returns (uint256 balance); |
| 67 | +} |
| 68 | + |
| 69 | +/// @title INuCypherStakingEscrow |
| 70 | +/// @notice Interface for NuCypher StakingEscrow contract |
| 71 | +interface INuCypherStakingEscrow { |
| 72 | + /// @notice Slash the staker's stake and reward the investigator |
| 73 | + /// @param staker Staker's address |
| 74 | + /// @param penalty Penalty |
| 75 | + /// @param investigator Investigator |
| 76 | + /// @param reward Reward for the investigator |
| 77 | + function slashStaker( |
| 78 | + address staker, |
| 79 | + uint256 penalty, |
| 80 | + address investigator, |
| 81 | + uint256 reward |
| 82 | + ) external; |
| 83 | + |
| 84 | + /// @notice Request merge between NuCypher staking contract and T staking contract. |
| 85 | + /// Returns amount of staked tokens |
| 86 | + function requestMerge(address staker, address operator) |
| 87 | + external |
| 88 | + returns (uint256); |
| 89 | + |
| 90 | + /// @notice Get all tokens belonging to the staker |
| 91 | + function getAllTokens(address staker) external view returns (uint256); |
| 92 | +} |
0 commit comments