-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Stack too deep after importing interface #14332
Comments
This indeed looks like it should not happen, but we'd need a full reproduction to investigate the cause, can you provide a complete example case? |
Not anymore since I fixed the underlying problem but I can now exactly tell whats happening. First of all the error is correct, it's just really unhelpful that even in verbose mode there is absolutely no hint where the error is (file, contract, line). What you need to reproduce is. Additional Nodes: In my case I updated ContractB from and old version to the current version of solidity. The reason for the error to appear was the use of abi-encoding v2 which is the current default. After setting back to v1 the Stack to deep error is gone, but that is not the focus of that ticket just a little side information. Conditions: InterfaceB and ContractB needs to be in the same .sol-File. ContractB needs to raise an Stack to deep error. Steps to reproduce If you compile this setup a Stack too deep exception without any other additional information like code line, contract or even file was raised. With that knowledge I am unsure if this a hardhat problem with compiling contracts that are not needed or an solidity problem that raises up with the relative new feature of being able to import single interfaces/contracts from a .sol file containing multiple ones. At least the solidity compiler should be intelligent enough to skip bytecode genereration contracts from imported .sol-files that are not used. |
I got some unexpected behavior during compilation with solc 0.8.20. I can not tell if older versions had that problem too.
Timelock.sol contains the interface and 2 contracts if that is of any relevance...even if it should not.
Working code
Code that throws Stack too deep error
The text was updated successfully, but these errors were encountered: