-
Notifications
You must be signed in to change notification settings - Fork 57
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
View methods to preview rewards #23
Conversation
aalavandhan
commented
Nov 28, 2024
•
edited
Loading
edited
- Remove the reward calculation logic from update accounting
- Added a separate previewRewards view method
- Added method to view unlock time schedule
e4c5634
to
05cdd60
Compare
c6af76d
to
2f6e2b2
Compare
2f6e2b2
to
29b6a5e
Compare
* @return Updated amount of distribution tokens to award, with any bonus included on the | ||
* newly added tokens. | ||
*/ | ||
function computeNewReward( | ||
uint256 currentRewardTokens, | ||
uint256 stakingShareSeconds, | ||
uint256 stakeTimeSec | ||
uint256 totalStakingShareSeconds_, |
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.
Do we need to send this in, when there's already a contract variable for it we could read from?
I assume it's to support hypothetical queries from the front end. Just want to make sure there's a use case for it, since it's a bit of a code smell to have this copied / naming conflict / etc.
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.
We need to send this in when we run the preview. Because, totalStakingShareSeconds
wouldn't have yet been committed on-chain.