Skip to content

Commit

Permalink
update docs and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitomir2 committed Apr 23, 2024
1 parent 97c0852 commit 8665638
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
10 changes: 9 additions & 1 deletion contracts/RewardPool/IRewardPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ interface IRewardPool {
*/
function getValidatorReward(address validator) external view returns (uint256);

/**
* @notice Gets delegator's unclaimed rewards without custom rewards
* @param validator Address of validator
* @param delegator Address of delegator
* @return Delegator's unclaimed rewards with validator (in MATIC wei)
*/
function getRawDelegatorReward(address validator, address delegator) external view returns (uint256);

/**
* @notice Gets delegators's unclaimed rewards including custom rewards
* @param validator Address of validator
Expand Down Expand Up @@ -211,7 +219,7 @@ interface IRewardPool {
) external view returns (uint256 penalty);

/**
* @notice Returns the total reward that is generate for a position
* @notice Returns the total reward that is generated for a position
* @param validator The address of the validator
* @param delegator The address of the delegator
* @return reward for the delegator
Expand Down
10 changes: 6 additions & 4 deletions contracts/RewardPool/modules/APR.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ contract APR is Initializable, AccessControl {
return 1e18;
}

/// @notice Function that applies the base APR to a given reward
/// @dev Denominator is used because we should work with numbers with floating point
/// @param reward The reward to which we gonna apply the base APR
/// @return The reward with the applied APR
/**
* @notice Function that calculates the end reward for a user (without vesting bonuses) based on the pool reward index.
* @dev Denominator is used because we should work with numbers with floating point
* @param reward index The reward to which we gonna apply the base APR
* @dev The reward with the applied APR
*/
function _applyCustomReward(uint256 reward) internal view returns (uint256) {
return _applyBaseAPR(reward) / EPOCHS_YEAR;
}
Expand Down
5 changes: 1 addition & 4 deletions contracts/RewardPool/modules/DelegationRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,7 @@ abstract contract DelegationRewards is RewardPoolBase, Vesting, RewardsWithdrawa
// _______________ Public functions _______________

/**
* @notice Gets delegator's unclaimed rewards without custom rewards
* @param validator Address of validator
* @param delegator Address of delegator
* @return Delegator's unclaimed rewards with validator (in MATIC wei)
* @inheritdoc IRewardPool
*/
function getRawDelegatorReward(address validator, address delegator) public view returns (uint256) {
DelegationPool storage delegation = delegationPools[validator];
Expand Down

0 comments on commit 8665638

Please sign in to comment.