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

fix calculation for withdrawn rewards #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

codchen
Copy link
Collaborator

@codchen codchen commented Nov 19, 2024

Describe your changes and provide context

Withdrawn results should be calculated as: bank balance - (all principals - withdrawn principals - staked principals). However previously we use the sum of VESTING_AMOUNTS as all principals which is incorrect because VESTING_AMOUNTS gets updated whenever we withdraw unlocked tokens. This PR changes the calculation to make use of an immutable field that represents all principals. It also fixes any affected contract state in the migration handler.

Testing performed to validate your change

todo

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.

1 participant