Skip to content

N-02 Overly Restrictive Validation #2548

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 1 commit into
base: sparrowDom/roosterAMO
Choose a base branch
from

Conversation

sparrowDom
Copy link
Member

OpenZeppelin issue:
Throughout the codebase, there are several validation issues that can be corrected:

The NatSpec comment for ACTION_THRESHOLD describes it as the "Minimum liquidity required to continue," which implies the value 1e12 is an inclusive lower bound for an action to proceed. However, within the _burnOethOnTheContract function, this threshold must be exceeded, making the threshold an exclusive boundary and contradicting the NatSpec comment. Consider updating the NatSpec comment to clarify that the amount must be "greater than" the threshold to align with the code's logic.
The validation checks in _getAddLiquidityParams use a strict greater-than (>) comparison to ensure the calculated required token amounts are less than the maximum available balances. This logic is overly restrictive and will incorrectly cause the transaction to revert in valid scenarios where the required amount is exactly equal to the contract's available balance. To fix this and allow the strategy to correctly deploy its full token balance when necessary, consider changing the comparison operators from > to >=.
Consider fixing these issues to ensure the validations are correctly aligned with intended behavior

@sparrowDom sparrowDom changed the base branch from master to sparrowDom/roosterAMO June 24, 2025 13:13
Copy link

Warnings
⚠️ 👀 This PR needs at least 2 reviewers

Generated by 🚫 dangerJS against 11d6bf9

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.

1 participant