Skip to content

[FIL-871] Remove allocator if allowance equal 0 #41

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Filip-L
Copy link
Collaborator

@Filip-L Filip-L commented Jun 23, 2025

No description provided.

@Filip-L Filip-L changed the title Remove allocator if allowance equal 0 [FIL-871] Remove allocator if allowance equal 0 Jun 23, 2025
@@ -112,8 +112,12 @@ contract Allocator is Initializable, Ownable2StepUpgradeable, UUPSUpgradeable, I
revert AlreadyZero();
} else if (allowanceBefore < amount) {
amount = allowanceBefore;
Copy link
Collaborator

Choose a reason for hiding this comment

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

amount is now unused?

@@ -112,8 +112,12 @@ contract Allocator is Initializable, Ownable2StepUpgradeable, UUPSUpgradeable, I
revert AlreadyZero();
} else if (allowanceBefore < amount) {
amount = allowanceBefore;
_allocators.remove(allocator);
} else if (allowanceBefore == amount) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we have just a single allowanceBefore <= amount branch that removes the allocator? why split into < and == doing the same thing?

@Filip-L Filip-L requested a review from kacperzuk-neti June 30, 2025 10:31
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