I have a smart contract that is barely below the limits of the solidity compiler.

When I try to enable optimization at 200 runs I get this error:

CompilerError: Stack too deep when compiling inline assembly: Variable length is 7 slot(s) too deep inside the stack.

Why is it not able to optimize my code? Is this expected? Is there some bug in the solidity compiler optimizer? Do I just need to enable different settings for my compilation?


enter image description here

  • Are you using too many local variables or using a looping function which loops a lot? This error occurs in such cases usually. May 22, 2022 at 6:02


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.