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

Inclusive conditions #62

Open
code423n4 opened this issue Oct 6, 2021 · 3 comments
Open

Inclusive conditions #62

code423n4 opened this issue Oct 6, 2021 · 3 comments
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Warden finding sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue

Comments

@code423n4
Copy link
Contributor

Handle

pauliax

Vulnerability details

Impact

I think the conditions should be inclusive '<=' here:
require(position.liquidity < MAX_TICK_LIQUIDITY, "MAX_TICK_LIQUIDITY");
require(incentive.endTime + 5 weeks < incentive.expiry, "END_PAST_BUFFER");
and here the check should not be inclusive as the incentive ids start from 0 and thus incentiveCount is always bigger by 1:
require(incentiveId <= incentiveCount[pool], "NOT_INCENTIVE");

Recommended Mitigation Steps

Review and update these conditions and be careful with such boundary checks (Robert Leshner cries in the corner).

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Warden finding labels Oct 6, 2021
code423n4 added a commit that referenced this issue Oct 6, 2021
@sarangparikh22 sarangparikh22 added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Oct 12, 2021
@sarangparikh22
Copy link
Collaborator

Haha! Robert lol, however, the above checks doesn't break anything, the incentive is protected by the time check below it. It is non-critical issues.

@alcueca
Copy link
Collaborator

alcueca commented Nov 12, 2021

Let's be considerate of Robert's plight, and keep it as Low Risk knowing what happened.

@sarangparikh22
Copy link
Collaborator

@alcueca haha, agreed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Warden finding sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Projects
None yet
Development

No branches or pull requests

4 participants