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 draining issue due to incorrect invariant implementation. #7

Closed
wants to merge 8 commits into from

Conversation

robertleifke
Copy link
Member

The invariant function has been updated to correctly calculate the lhs and rhs values, ensuring that the relationship between token0 and token1 reserves maintains stability.

Changes include:

  • Replaced 'upperBound' with 'strike' to align with contract specifications.
  • Refactored scale calculations to use FullMath library for precise arithmetic.
  • Added security checks to prevent scale1 from exceeding twice the strike value.

This update resolves finding #1 and aligns the function with the expected invariant formula, improving overall contract stability.

Breaking changes:

  • None

References:

@robertleifke robertleifke deleted the rl/invariant branch June 29, 2024 18:15
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