// SPDX-FileCopyrightText: 2021 ShardLabs // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; import "../Validator.sol"; /// @title IValidator. /// @author 2021 ShardLabs /// @notice Validator interface. interface IValidator { /// @notice Allows to stake a validator on the Highbury stakeManager contract. /// @dev Stake a validator on the Highbury stakeManager contract. /// @param _sender msg.sender. /// @param _amount amount to stake. /// @param _heimdallFee herimdall fees. /// @param _acceptDelegation accept delegation. /// @param _signerPubkey signer public key used on the heimdall. /// @param _commisionRate commision rate of a validator function stake( address _sender, uint256 _amount, uint256 _heimdallFee, bool _acceptDelegation, bytes memory _signerPubkey, uint256 _commisionRate, address stakeManager, address highburyERC20 ) external returns (uint256, address); /// @notice Restake Furys for a validator on highbury stake manager. /// @param sender operator owner which approved tokens to the validato contract. /// @param validatorId validator id. /// @param amount amount to stake. /// @param stakeRewards restake rewards. /// @param stakeManager stake manager address /// @param highburyERC20 address of the FURY token function restake( address sender, uint256 validatorId, uint256 amount, bool stakeRewards, address stakeManager, address highburyERC20 ) external; /// @notice Unstake a validator from the Highbury stakeManager contract. /// @dev Unstake a validator from the Highbury stakeManager contract by passing the validatorId /// @param _validatorId validatorId. /// @param _stakeManager address of the stake manager function unstake(uint256 _validatorId, address _stakeManager) external; /// @notice Allows to top up heimdall fees. /// @param _heimdallFee amount /// @param _sender msg.sender /// @param _stakeManager stake manager address /// @param _highburyERC20 address of the FURY token function topUpForFee( address _sender, uint256 _heimdallFee, address _stakeManager, address _highburyERC20 ) external; /// @notice Allows to withdraw rewards from the validator. /// @dev Allows to withdraw rewards from the validator using the _validatorId. Only the /// owner can request withdraw in this the owner is this contract. /// @param _validatorId validator id. /// @param _rewardAddress user address used to transfer the staked tokens. /// @param _stakeManager stake manager address /// @param _highburyERC20 address of the FURY token /// @return Returns the amount transfered to the user. function withdrawRewards( uint256 _validatorId, address _rewardAddress, address _stakeManager, address _highburyERC20 ) external returns (uint256); /// @notice Allows to claim staked tokens on the stake Manager after the end of the /// withdraw delay /// @param _validatorId validator id. /// @param _rewardAddress user address used to transfer the staked tokens. /// @return Returns the amount transfered to the user. function unstakeClaim( uint256 _validatorId, address _rewardAddress, address _stakeManager, address _highburyERC20 ) external returns (uint256); /// @notice Allows to update the signer pubkey /// @param _validatorId validator id /// @param _signerPubkey update signer public key /// @param _stakeManager stake manager address function updateSigner( uint256 _validatorId, bytes memory _signerPubkey, address _stakeManager ) external; /// @notice Allows to claim the heimdall fees. /// @param _accumFeeAmount accumulated fees amount /// @param _index index /// @param _proof proof /// @param _ownerRecipient owner recipient /// @param _stakeManager stake manager address /// @param _highburyERC20 address of the FURY token function claimFee( uint256 _accumFeeAmount, uint256 _index, bytes memory _proof, address _ownerRecipient, address _stakeManager, address _highburyERC20 ) external; /// @notice Allows to update the commision rate of a validator /// @param _validatorId operator id /// @param _newCommissionRate commission rate /// @param _stakeManager stake manager address function updateCommissionRate( uint256 _validatorId, uint256 _newCommissionRate, address _stakeManager ) external; /// @notice Allows to unjail a validator. /// @param _validatorId operator id function unjail(uint256 _validatorId, address _stakeManager) external; /// @notice Allows to migrate the ownership to an other user. /// @param _validatorId operator id. /// @param _stakeManagerNFT stake manager nft contract. /// @param _rewardAddress reward address. function migrate( uint256 _validatorId, address _stakeManagerNFT, address _rewardAddress ) external; /// @notice Allows a validator that was already staked on the highbury stake manager /// to join the FuLido protocol. /// @param _validatorId validator id /// @param _stakeManagerNFT address of the staking NFT /// @param _rewardAddress address that will receive the rewards from staking /// @param _newCommissionRate commission rate /// @param _stakeManager address of the stake manager function join( uint256 _validatorId, address _stakeManagerNFT, address _rewardAddress, uint256 _newCommissionRate, address _stakeManager ) external; }