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 wrong accounting in stake() when mintBonusMP #111

Closed
0x-r4bbit opened this issue Sep 11, 2024 · 1 comment
Closed

Fix wrong accounting in stake() when mintBonusMP #111

0x-r4bbit opened this issue Sep 11, 2024 · 1 comment
Assignees
Milestone

Comments

@0x-r4bbit
Copy link
Collaborator

When staking, we currently

  1. first increase the account.balance (https://github.com/logos-co/staking/blob/develop/contracts/StakeManager.sol#L208)
  2. then we mint bonus mp (https://github.com/logos-co/staking/blob/develop/contracts/StakeManager.sol#L208) with account and stakeAmount

The result is that we're accounting for stakeAmount twice, once as part of account.balance and once via stakeAmount.
This needs to be fixed.

Also, provide a test that proofs the fix

@0x-r4bbit 0x-r4bbit added this to the Staking V1 milestone Sep 11, 2024
@3esmit 3esmit self-assigned this Sep 11, 2024
@3esmit
Copy link
Collaborator

3esmit commented Sep 16, 2024

Fixed by #115

@3esmit 3esmit closed this as completed Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants