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(StakeManager): use OpenZeppelin Math to avoid precision loss in int divisions #66

Merged
merged 4 commits into from
Feb 26, 2024

Conversation

3esmit
Copy link
Collaborator

@3esmit 3esmit commented Feb 24, 2024

Description

Alternative to #67;
This PR fixes #64 and Fixes #24

Checklist

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

  • Added natspec comments?
  • Ran forge snapshot?
  • Ran pnpm lint?
  • Ran forge test?
  • Ran pnpm verify?

@3esmit 3esmit force-pushed the fix-precision-loss branch 6 times, most recently from 9ab32a2 to ad22d67 Compare February 24, 2024 04:02
@3esmit
Copy link
Collaborator Author

3esmit commented Feb 24, 2024

@0x-r4bbit Do you have any idea why lint is failing?

image

36191276-5bc817c0-116d-11e8-89cb-b5c96c054936

forge --version
forge 0.2.0 (ac80261 2024-02-24T00:17:06.154246094Z)

@3esmit
Copy link
Collaborator Author

3esmit commented Feb 24, 2024

The lint error is caused by this commit d7be979 as shown in vacp2p/foundry-template#18

@3esmit
Copy link
Collaborator Author

3esmit commented Feb 24, 2024

I found the error in lint, was a stupid EOF from Windows. I will now redo everything here.

Copy link
Collaborator

@0x-r4bbit 0x-r4bbit left a comment

Choose a reason for hiding this comment

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

Great stuff.

I'm approving this, but maybe also check out the comments I've made in #64 as they apply here as well.

@3esmit 3esmit merged commit 6c358da into develop Feb 26, 2024
6 of 7 checks passed
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.

Fix division precision loss Fix Floating-Point Number Calculations in Contract
2 participants