Error --via-ir #1486
-
my terminal throws an error i tried running forge coverage --via-ir still shows the same error , any other solution for this |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
Hello @Abhishek-2416, Stack too deep errors suck. They are almost always cause by limitations of the EVM and all of the data it needs to handle. This is a link https://ethereum.stackexchange.com/questions/12736/stack-too-deep-exception to a similar issues in stack exchange, please take a look maybe it would help resolve your issue. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Although i think its the best method which was suggested by @Abbasjafri-syed , but just found one more method to avoid this error and that is simply run forge coverage --ir-minimum Even this works but give a warning that it might not be very accurate |
Beta Was this translation helpful? Give feedback.
-
Adding to the helpful feedback above is you can avoid refactoring your code if you add |
Beta Was this translation helpful? Give feedback.
hey,
was getting this error also...finds that Stack too deep error is thrown by the Solidity compiler when any function have lots of local variables, have complex logical expressions or have a deep function stack..
The main issue is due to using lot of local variable in setup of raffle test which can be mitigated by dividing it into 2 parts like below: