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

Incorrect error revert in _verifyFlowMatrix() function #105

Open
hats-bug-reporter bot opened this issue Sep 15, 2024 · 1 comment
Open

Incorrect error revert in _verifyFlowMatrix() function #105

hats-bug-reporter bot opened this issue Sep 15, 2024 · 1 comment
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@hats-bug-reporter
Copy link

Github username: --
Twitter username: --
Submission hash (on-chain): 0x97175c3b5ad7714858d29433b82be58c2b204785f3f0040cf77c3a6b3b0a88e4
Severity: low

Description:
Description
The function _verifyFlowMatrix() contains if() condition that checks if:

if (3 * _flow.length != _coordinates.length) {
            // Mismatch in flow and coordinates length.
            revert CirclesArraysLengthMismatch(_flow.length, _coordinates.length, 2);
        }

However, incorrect error message is being reverted in CirclesArraysLengthMismatch(_flow.length, _coordinates.length, 2);.

_flow.length is multiplied by 3 in the if condition, but in the error message, it is only _flow.length, causing a mismatch between the logic and the revert error.

Recommendation
To fix this, the revert error message should correctly reflect the logic as follows:

if (3 * _flow.length != _coordinates.length) {
            // Mismatch in flow and coordinates length.
-            revert CirclesArraysLengthMismatch(_flow.length, _coordinates.length, 2);
+           revert CirclesArraysLengthMismatch(3 * _flow.length, _coordinates.length, 2);
        }
@hats-bug-reporter hats-bug-reporter bot added the bug Something isn't working label Sep 15, 2024
@benjaminbollen
Copy link
Collaborator

Same as #104 , thanks, but not a low issue.

Just to note: these errors have a uint8 code that identifies where in the code they are thrown, so that the developer can know what which data the error concerns

@benjaminbollen benjaminbollen added the invalid This doesn't seem right label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant