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

allow gas-custom-errors rule to properly handle custom errors inside require statements #602

Closed
shaspitz opened this issue Sep 12, 2024 · 6 comments · Fixed by #613
Closed

Comments

@shaspitz
Copy link

Solidity 0.8.26 introduces the ability to use custom errors within require statements. When using this functionality (custom error in conjunction w/ require statement), solhint faultily marks the line as having a gas-custom-errors infraction

@CJ42
Copy link

CJ42 commented Oct 18, 2024

Agree as these warnings are now misleading. A release with this support would be welcome.

image

@CJ42
Copy link

CJ42 commented Nov 25, 2024

Any updates on this? It would be useful to have, as custom error in require(...) statements is likely to be used more often with solc 0.8.27

@dbale-altoros
Copy link
Collaborator

I will address several issues in the upcoming weeks and get a new release before new year
sorry the delay guys

@dbale-altoros
Copy link
Collaborator

refer to this pr
#613
I think this fix the issue
Take a look at the first 5 tests on
test/rules/gas-consumption/gas-custom-errors.js
All start with should NOT raise error for require

If you find any other case , please advice

@shaspitz
Copy link
Author

Thanks! Is there a release I can reference with this fix?

@dbale-altoros
Copy link
Collaborator

dbale-altoros commented Dec 23, 2024 via email

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 a pull request may close this issue.

3 participants