Skip to content

Commit 0153d2a

Browse files
authored
improve: Add comments about baseRewardPerToken to AcceleratingDistributor (#38)
Signed-off-by: nicholaspai <npai.nyc@gmail.com> Signed-off-by: nicholaspai <npai.nyc@gmail.com>
1 parent 7207ad2 commit 0153d2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

contracts/AcceleratingDistributor.sol

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,12 @@ contract AcceleratingDistributor is ReentrancyGuard, Ownable, Multicall {
292292
/**
293293
* @notice Returns the base rewards per staked token for a given staking token. This factors in the last time
294294
* any internal logic was called on this contract to correctly attribute retroactive cumulative rewards.
295-
* @dev the value returned is represented by a uint256 with fixed precision of 18 decimals.
295+
* @dev This method should only be called by this contract and should actually be marked internal, but it
296+
* was originally audited and deployed with this function being public. Its useful for testing if this function is
297+
* public but it can return nonsensical values if the stakedToken precision is fewer than 18 decimals.
298+
* @dev the value returned is represented by a uint256 with fixed precision of (18 + 18 - X) decimals, where
299+
* X = decimals of the stakedToken. This is becauseof how the return value is divided by `cumulativeStaked`
300+
* which has the same precisionas stakedToken.
296301
* @param stakedToken The address of the staked token to query.
297302
* @return uint256 Total base reward per token that will be applied, pro-rata, to stakers.
298303
*/

0 commit comments

Comments
 (0)