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

Add dev message for binarySearch bounds #37

Merged

Conversation

trmid
Copy link
Member

@trmid trmid commented Aug 18, 2023

addresses c4-issue-445: code-423n4/2023-07-pooltogether-findings#445

Summary

When used in the intended context, the binarySearch function always has a valid exit condition. Instead of adding an additional, unreachable exit condition, the intended context has been added as a dev comment on the function.

@trmid trmid requested a review from asselstine August 18, 2023 01:38
@@ -409,6 +409,7 @@ library DrawAccumulatorLib {
}

/// @notice Binary searches an array of draw ids for the given target draw id.
/// @dev Index bounds and draw ID bounds must be validated before they are passed to this function.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be more specific here: "the target draw id must be on or with the oldest draw id and newest draw id"

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed by: 6f2bbaa

@trmid trmid requested a review from asselstine August 18, 2023 17:38
@asselstine asselstine merged commit 22bdf8c into main Aug 19, 2023
@asselstine asselstine deleted the gen-193-c4-issue-445-draw-accumulater-binary-search-exit branch August 19, 2023 18:24
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