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

Reward adjustments fixes #135

Merged
merged 15 commits into from
Jun 11, 2024
Merged

Reward adjustments fixes #135

merged 15 commits into from
Jun 11, 2024

Conversation

amarinkovic
Copy link
Member

@amarinkovic amarinkovic commented May 31, 2024

Staking or unstaking of any user should have no effect on other user's rewards and boosts. Basic test case that is addressed with this change set, is described in test_threeStakersAndRewardsIntertwine.

@amarinkovic amarinkovic force-pushed the reward_adjustments branch 4 times, most recently from a604c08 to afb1ada Compare June 7, 2024 09:37
@amarinkovic amarinkovic mentioned this pull request Jun 7, 2024
Comment on lines +155 to +156
uint256 boost1 = ((((_getD(_entityId) - ratio) * _amount) / _getD(_entityId)) * _getA(_entityId)) / _getD(_entityId);
uint256 boost2 = (((ratio * _amount) / _getD(_entityId)) * _getA(_entityId)) / _getD(_entityId);
uint256 balance1 = _amount - (ratio * _amount) / _getD(_entityId);
uint256 balance2 = (ratio * _amount) / _getD(_entityId);
Copy link
Member Author

Choose a reason for hiding this comment

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

Here be dragons! 🐉

Copy link
Contributor

@kevin-fruitful kevin-fruitful left a comment

Choose a reason for hiding this comment

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

lgtm!!!

@amarinkovic amarinkovic merged commit 8e2b025 into dev Jun 11, 2024
3 checks passed
@amarinkovic amarinkovic deleted the reward_adjustments branch June 11, 2024 12:25
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.

2 participants