// SPDX-FileCopyrightText: 2021 ShardLabs // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; import "../lib/Operator.sol"; /// @title INodeOperatorRegistry /// @author 2021 ShardLabs /// @notice Node operator registry interface interface INodeOperatorRegistry { /// @notice Allows to add a new node operator to the system. /// @param _name the node operator name. /// @param _rewardAddress public address used for ACL and receive rewards. /// @param _signerPubkey public key used on heimdall len 64 bytes. function addOperator( string memory _name, address _rewardAddress, bytes memory _signerPubkey ) external; /// @notice Allows to stop a node operator. /// @param _operatorId node operator id. function stopOperator(uint256 _operatorId) external; /// @notice Allows to remove a node operator from the system. /// @param _operatorId node operator id. function removeOperator(uint256 _operatorId) external; /// @notice Allows a staked validator to join the system. function joinOperator() external; /// @notice Allows to stake an operator on the Highbury stakeManager. /// This function calls Highbury transferFrom so the totalAmount(_amount + _heimdallFee) /// has to be approved first. /// @param _amount amount to stake. /// @param _heimdallFee heimdallFee to stake. function stake(uint256 _amount, uint256 _heimdallFee) external; /// @notice Restake Furys for a validator on highbury stake manager. /// @param _amount amount to stake. /// @param _restakeRewards restake rewards. function restake(uint256 _amount, bool _restakeRewards) external; /// @notice Allows the operator's owner to migrate the NFT. This can be done only /// if the DAO stopped the operator. function migrate() external; /// @notice Allows to unstake an operator from the stakeManager. After the withdraw_delay /// the operator owner can call claimStake func to withdraw the staked tokens. function unstake() external; /// @notice Allows to topup heimdall fees on highbury stakeManager. /// @param _heimdallFee amount to topup. function topUpForFee(uint256 _heimdallFee) external; /// @notice Allows to claim staked tokens on the stake Manager after the end of the /// withdraw delay function unstakeClaim() external; /// @notice Allows an owner to withdraw rewards from the stakeManager. function withdrawRewards() external; /// @notice Allows to update the signer pubkey /// @param _signerPubkey update signer public key function updateSigner(bytes memory _signerPubkey) external; /// @notice Allows to claim the heimdall fees staked by the owner of the operator /// @param _accumFeeAmount accumulated fees amount /// @param _index index /// @param _proof proof function claimFee( uint256 _accumFeeAmount, uint256 _index, bytes memory _proof ) external; /// @notice Allows to unjail a validator and switch from UNSTAKE status to STAKED function unjail() external; /// @notice Allows an operator's owner to set the operator name. function setOperatorName(string memory _name) external; /// @notice Allows an operator's owner to set the operator rewardAddress. function setOperatorRewardAddress(address _rewardAddress) external; /// @notice Allows the DAO to set _defaultMaxDelegateLimit. function setDefaultMaxDelegateLimit(uint256 _defaultMaxDelegateLimit) external; /// @notice Allows the DAO to set _maxDelegateLimit for an operator. function setMaxDelegateLimit(uint256 _operatorId, uint256 _maxDelegateLimit) external; /// @notice Allows the DAO to set _commissionRate. function setCommissionRate(uint256 _commissionRate) external; /// @notice Allows the DAO to set _commissionRate for an operator. /// @param _operatorId id of the operator /// @param _newCommissionRate new commission rate function updateOperatorCommissionRate( uint256 _operatorId, uint256 _newCommissionRate ) external; /// @notice Allows the DAO to set _minAmountStake and _minHeimdallFees. function setStakeAmountAndFees( uint256 _minAmountStake, uint256 _minHeimdallFees ) external; /// @notice Allows to pause/unpause the node operator contract. function togglePause() external; /// @notice Allows the DAO to enable/disable restake. function setRestake(bool _restake) external; /// @notice Allows the DAO to set stFURY contract. function setStFURY(address _stFURY) external; /// @notice Allows the DAO to set validator factory contract. function setValidatorFactory(address _validatorFactory) external; /// @notice Allows the DAO to set stake manager contract. function setStakeManager(address _stakeManager) external; /// @notice Allows to set contract version. function setVersion(string memory _version) external; /// @notice Get the stFURY contract addresses function getContracts() external view returns ( address _validatorFactory, address _stakeManager, address _highburyERC20, address _stFURY ); /// @notice Allows to get stats. function getState() external view returns ( uint256 _totalNodeOperator, uint256 _totalInactiveNodeOperator, uint256 _totalActiveNodeOperator, uint256 _totalStoppedNodeOperator, uint256 _totalUnstakedNodeOperator, uint256 _totalClaimedNodeOperator, uint256 _totalExitNodeOperator, uint256 _totalSlashedNodeOperator, uint256 _totalEjectedNodeOperator ); /// @notice Allows to get a list of operatorInfo. function getOperatorInfos(bool _delegation, bool _allActive) external view returns (Operator.OperatorInfo[] memory); /// @notice Allows to get all the operator ids. function getOperatorIds() external view returns (uint256[] memory); }