-
Notifications
You must be signed in to change notification settings - Fork 16
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
Calculate Reward Earnings For Stakers #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finished a first pass, I plan to take another look after our meeting Monday
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, as long as the remaining TODOs are turned into tickets if they are not already
This commit implements the basic reward calculation mechanics associated with staking. The mechanics are largely modeled off the Synthetix StakingRewards contract. This commit also adds numerous tests, and related testing infrastructure for assesing whether the calucations for earned rewards is being done correctly.
Since we have (intentionally) left a full test suite of the reward earning functionality out of this PR for now, we lower the coverage threshold a bit. In the near future we will implement comprehensive tests and turn it back to 100.
Coverage after merging stake-earn into main will be
Coverage Report
|
This PR implements the calculation of reward earnings and adds some tests for these calculations as well. Note that reward earning calculations are a port of the battle tested Synthetix Staking Rewards contract.
This PR is not as exhaustive as it could be, to prevent it from becoming too large. Purposely omitted from this PR are:
Making the notify rewards method permissionedEDIT: with the merger of Add and test privileged rewards notifier role #12 this functionality is now includedEach of these will be tackled in future PRs. While these tasks are already documented in the spec issues, several "TODO" statements have also been left in the code for now as reminders. There are also comments left intentionally as reminders to revisit possible areas for better naming, refactoring and gas savings.