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

TOB-AJNA-8: Array lengths are not checked in LP allowance functions #725

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

grandizzy
Copy link
Contributor

@grandizzy grandizzy commented Apr 4, 2023

Description of change

High level

  • add a check to both increaseLPAllowance and decreaseLPAllowance to ensure the lengths of amounts_ and indexes_ are the same
    • revert with InvalidAllowancesInput if arrays lengths are different

Description of bug or vulnerability and solution

  • Array lengths are not checked in LP allowance update functions
  • Could be a case of user error where an index is accidentally omitted by the user when calling the method resulting in unintended actions.
  • add a check to both increaseLPAllowance and decreaseLPAllowance to ensure the lengths of amounts_ and indexes_ are the same

Contract size

Pre Change

N/A

Post Change

N/A

Gas usage

Pre Change

N/A

Post Change

N/A

…tions

- add input validation (indexes array length same as amounts array length) otherwise revert with InvalidAllowancesInput
- unit tests
Copy link
Contributor

@prateek105 prateek105 left a comment

Choose a reason for hiding this comment

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

lgtm.

Copy link
Contributor

@ith-harvey ith-harvey left a comment

Choose a reason for hiding this comment

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

LGTM

@grandizzy grandizzy merged commit 2d869f2 into develop Apr 4, 2023
@grandizzy grandizzy deleted the tob-ajna-8 branch April 4, 2023 12:54
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.

4 participants