Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leave the scale factor into the unclaimed reward calculations #71

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

apbendi
Copy link
Collaborator

@apbendi apbendi commented Mar 18, 2024

To avoid the accrual of precision loss as unclaimed rewards are calculated and checkpointed, we leave the scale factor in the unclaimed reward checkpoints. Our unclaimed reward method becomes a helper function only. We also add a test to ensure this precision loss does not accrue to a meaningful degree, even in extreme conditions.

closes #70

To avoid the accrual of precision loss as unclaimed rewards are calculated
and checkpointed, we leave the scale factor in the unclaimed reward
checkpoints. Our unclaimed reward method becomes a helper function only.
We also add a test to ensure this precision loss does not accrue to a
meaningful degree, even in extreme conditions.
src/UniStaker.sol Outdated Show resolved Hide resolved
Copy link

Coverage after merging scale-rewards into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   UniStaker.sol99.49%95.83%100%100%626
   V3FactoryOwner.sol100%100%100%100%

Copy link
Collaborator

@wildmolasses wildmolasses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@apbendi apbendi merged commit a30210c into main Mar 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store unclaimed rewards as scaled values
3 participants