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

feature(RewardsStreamerMP): add rewardAccrued to account to allow accounts to stake again multiple times #110

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gravityblast
Copy link
Member

@gravityblast gravityblast commented Jan 14, 2025

Description

This PR fixes the rewards and index calculations to allows accounts to stake multiple times.
It adds a rewardAccrued field to the account struct to keep the accrued rewards once an account stakes again.

Fixes: #102

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Added natspec comments?
  • Ran pnpm adorno?
  • Ran pnpm verify?

@gravityblast gravityblast marked this pull request as draft January 14, 2025 12:43
function accountRewardIndex(address accountAddress) external view returns (uint256) {
return accounts[accountAddress].accountRewardIndex;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

the functions above are just for testing purpose now but we could remove them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Fix incorrect reward index update
1 participant