-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Validate the number of optimizer runs #3488
Comments
Hello @fvictorio Sorry, I'm new to this framework and probably a dumb question but do you know how we can reproduce this issue? |
Yes, just create a new project with some contracts and use this as your config: module.exports = {
solidity: {
version: "0.8.17",
settings: {
optimizer: {
enabled: true,
runs: 2 ** 32,
},
},
},
}; Then if you run
That error comes from the compiler, but Hardhat should throw a validation error before even trying to compile. I'm not super sure what's the best place to do this though. Maybe this needs a "post config resolution" phase, that we don't have yet (but we want to add, for example for #3323). But that's a bigger change. If you feel like tackling that, I can give you some hints. |
@konarshankar07 I opened #3500, if you want to give it a try. I think that what we need is:
I know this might be a lot if it's your first contribution, so if you'd prefer to help with something easier, let me know! |
Thanks @fvictorio I will first work on 3500 ticket and then come back on this |
Continuation of #1589.
The max number of optimizer runs is$2^{32}-1$ . If you use a bigger number, the error is:
While this comes from solc, we should add some validation here and show a better error message.
The text was updated successfully, but these errors were encountered: