Rewards Distributor
RewardsDistributor
version
DidAccumulateRate
event DidAccumulateRate(uint8 subjectType, uint256 subject, address staker, uint256 stakeAmount, uint256 sharesAmount)
DidReduceRate
event DidReduceRate(uint8 subjectType, uint256 subject, address staker, uint256 stakeAmount, uint256 sharesAmount)
Rewarded
ClaimedRewards
event ClaimedRewards(uint8 subjectType, uint256 subject, address to, uint256 epochNumber, uint256 value)
DidTransferRewardShares
event DidTransferRewardShares(uint256 sharesId, uint8 subjectType, address from, address to, uint256 sharesAmount)
SetDelegationFee
SetDelegationParams
TokensSwept
RewardingNonRegisteredSubject
AlreadyClaimed
AlreadyRewarded
SetDelegationFeeNotReady
constructor
initialize
function initialize(address _manager, uint256 _delegationParamsEpochDelay, uint256 _defaultFeeBps) public
didAllocate
function didAllocate(uint8 subjectType, uint256 subject, uint256 stakeAmount, uint256 sharesAmount, address staker) external
didUnallocate
function didUnallocate(uint8 subjectType, uint256 subject, uint256 stakeAmount, uint256 sharesAmount, address staker) external
didTransferShares
function didTransferShares(uint256 sharesId, uint8 subjectType, address from, address to, uint256 sharesAmount) external
reward
availableReward
function availableReward(uint8 subjectType, uint256 subjectId, uint256 epochNumber, address staker) public view returns (uint256)
claimRewards
setDelegationParams
setDelegationFeeBps
Sets delegation fee for a ScannerPool (required to own the ScannerPoolRegistry NFT). Change in fees will start having an effect in the beginning of the next reward epoch. After the first time setting the parameter, it cannot be set again until delegationParamsEpochDelay epochs pass.
Name | Type | Description |
---|---|---|
subjectType | uint8 | a DELEGATED subject type. |
subjectId | uint256 | the DELEGATED subject id. |
feeBps | uint16 |
getDelegationFee
function getDelegationFee(uint8 subjectType, uint256 subjectId, uint256 epochNumber) public view returns (uint256)
Returns current delegation fee for an epoch or defaultFeeBps if not set
sweep
Sweep all token that might be mistakenly sent to the contract. This covers both unrelated tokens and staked tokens that would be sent through a direct transfer. Restricted to SWEEPER_ROLE. If tokens are the same as staked tokens, only the extra tokens (no rewards) will be transferred.
WARNING: thoroughly review the token to sweep.
Name | Type | Description |
---|---|---|
token | contract IERC20 | address of the token to be swept. |
recipient | address | destination address of the swept tokens |
Name | Type | Description |
---|---|---|
[0] | uint256 | amount of tokens swept. For unrelated tokens is RewardDistributor's balance, for stakedToken its the balance minus total rewards distributed; |