Skip to content

Comments

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

Merged
Filip-L merged 2 commits intomainfrom
FIL-871--decrease-allowance
Jul 14, 2025
Merged

[FIL-871] Remove allocator if allowance equal 0#41
Filip-L merged 2 commits intomainfrom
FIL-871--decrease-allowance

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?

} 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
@Filip-L Filip-L merged commit be01431 into main Jul 14, 2025
2 checks passed
@Filip-L Filip-L deleted the FIL-871--decrease-allowance branch July 14, 2025 09:05
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