-
Notifications
You must be signed in to change notification settings - Fork 269
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
CompilerError: Stack too deep, try removing local variables. #248
Comments
@ekreda Could you provide any more information about this? How many local variables are defined in that function? |
@cgewecke the max solidity allow (8)... We managed to overcome this for now by refactoring our code and reduce the local variables as suggested - once done everything is working back as expected. |
This has caught my eye because I don't think we do inject variables - all our events use constants, unless I'm missing something. Are you able to share the code that is unable to be instrumented correctly? |
I'm having this problem as well. We have a complex contract that has already had a bunch of local vars removed due to the limit, so unfortunately I don't think we can remove more for the purpose of coverage testing. (Also unfortunately I can't share the code right now.) I was hoping there might be a compiler flag to increase the limit, but I haven't found it yet. |
@area I've isolated that the |
Yep, it turned out that our tests were using using
|
Found a nice trick to avoid this issue: https://ethereum.stackexchange.com/a/83842/3032 |
I have also got this error. |
Hi I'm using solidity-coverage on a few contracts (all using default configuration) but on one of my contracts I'm getting:
CompilerError: Stack too deep, try removing local variables.
Compilation failed. See above.
Naturally the sol file compiled exception free when it's compiled not by solidity-coverage.
The text was updated successfully, but these errors were encountered: