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

Remove useless check on supply cap #67

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

QGarchery
Copy link
Contributor

@QGarchery QGarchery commented Dec 18, 2024

This check is useless because:

  • at this point in the code, we know that suppliedAssets > 0
  • later we check that supplyAssets + suppliedAssets <= supplyCap
  • so after this last check we know that supplyCap > 0

I would even argue that the error returned is clearer: the supply cap (of 0) has been exceeded. Note that supplying 0 would not have made it revert, so the error UnauthorizedMarket doesn't give the full picture (it reverts because the amount is greater than the cap)

@QGarchery QGarchery self-assigned this Dec 18, 2024
@MathisGD MathisGD merged commit d92d83d into fix/allocator-issue Dec 18, 2024
22 checks passed
@MathisGD MathisGD deleted the refactor/remove-useless-check branch December 18, 2024 18:44
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.

3 participants