// SPDX-FileCopyrightText: 2021 ShardLabs // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; /// @title highbury stake manager interface. /// @author 2021 ShardLabs /// @notice User to interact with the highbury stake manager. interface IStakeManager { /// @notice Stake a validator on highbury stake manager. /// @param user user that own the validator in our case the validator contract. /// @param amount amount to stake. /// @param heimdallFee heimdall fees. /// @param acceptDelegation accept delegation. /// @param signerPubkey signer publickey used in heimdall node. function stakeFor( address user, uint256 amount, uint256 heimdallFee, bool acceptDelegation, bytes memory signerPubkey ) external; /// @notice Restake Furys for a validator on highbury stake manager. /// @param validatorId validator id. /// @param amount amount to stake. /// @param stakeRewards restake rewards. function restake( uint256 validatorId, uint256 amount, bool stakeRewards ) external; /// @notice Request unstake a validator. /// @param validatorId validator id. function unstake(uint256 validatorId) external; /// @notice Increase the heimdall fees. /// @param user user that own the validator in our case the validator contract. /// @param heimdallFee heimdall fees. function topUpForFee(address user, uint256 heimdallFee) external; /// @notice Get the validator id using the user address. /// @param user user that own the validator in our case the validator contract. /// @return return the validator id function getValidatorId(address user) external view returns (uint256); /// @notice get the validator contract used for delegation. /// @param validatorId validator id. /// @return return the address of the validator contract. function getValidatorContract(uint256 validatorId) external view returns (address); /// @notice Withdraw accumulated rewards /// @param validatorId validator id. function withdrawRewards(uint256 validatorId) external; /// @notice Get validator total staked. /// @param validatorId validator id. function validatorStake(uint256 validatorId) external view returns (uint256); /// @notice Allows to unstake the staked tokens on the stakeManager. /// @param validatorId validator id. function unstakeClaim(uint256 validatorId) external; /// @notice Allows to update the signer pubkey /// @param _validatorId validator id /// @param _signerPubkey update signer public key function updateSigner(uint256 _validatorId, bytes memory _signerPubkey) external; /// @notice Allows to claim the heimdall fees. /// @param _accumFeeAmount accumulated fees amount /// @param _index index /// @param _proof proof function claimFee( uint256 _accumFeeAmount, uint256 _index, bytes memory _proof ) external; /// @notice Allows to update the commision rate of a validator /// @param _validatorId operator id /// @param _newCommissionRate commission rate function updateCommissionRate( uint256 _validatorId, uint256 _newCommissionRate ) external; /// @notice Allows to unjail a validator. /// @param _validatorId id of the validator that is to be unjailed function unjail(uint256 _validatorId) external; /// @notice Returns a withdrawal delay. function withdrawalDelay() external view returns (uint256); /// @notice Transfers amount from delegator function delegationDeposit( uint256 validatorId, uint256 amount, address delegator ) external returns (bool); function epoch() external view returns (uint256); enum Status { Inactive, Active, Locked, Unstaked } struct Validator { uint256 amount; uint256 reward; uint256 activationEpoch; uint256 deactivationEpoch; uint256 jailTime; address signer; address contractAddress; Status status; uint256 commissionRate; uint256 lastCommissionUpdate; uint256 delegatorsReward; uint256 delegatedAmount; uint256 initialRewardPerStake; } function validators(uint256 _index) external view returns (Validator memory); /// @notice Returns the address of the nft contract function NFTContract() external view returns (address); /// @notice Returns the validator accumulated rewards on stake manager. function validatorReward(uint256 validatorId) external view returns (uint256); }