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

Disallow deposit/withdrawal when all amounts are 0 #34

Merged
merged 4 commits into from
Aug 19, 2024
Merged

Conversation

JanKuczma
Copy link
Collaborator

This PR adds:

  • A check to deposit and withdrawal methods. The check ensures that at least one deposit/withdrawal token amount is non-zero.
  • A check before token transfer. The check ensures the token amount is non-zero to avoid unnecessary cross-contract calls.

@JanKuczma JanKuczma requested a review from woocash2 August 16, 2024 10:09
@JanKuczma JanKuczma changed the title Disallow deposit withdraw when all amounts are 0 Disallow deposit/withdrawal when all amounts are 0 Aug 16, 2024
@@ -235,7 +235,7 @@ pub enum StablePoolError {
InvalidTokenId(AccountId),
IdenticalTokenId,
IncorrectAmountsCount,
InvalidAmpCoef,
InsufficientAmounts,
Copy link
Contributor

@woocash2 woocash2 Aug 16, 2024

Choose a reason for hiding this comment

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

If this is used only for 0 amounts, maybe call it ZeroAmounts (or something like that)?

Copy link
Contributor

@woocash2 woocash2 left a comment

Choose a reason for hiding this comment

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

just one nit

@JanKuczma JanKuczma merged commit a82659b into main Aug 19, 2024
1 check passed
@JanKuczma JanKuczma deleted the min-liq-mint branch August 19, 2024 08:10
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