I'm getting
CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.
this error. According to solidity docs I need to add "viaIR": true
option but I can't add the same option to the brownie-config.yaml
file. Here is the file: compiler: viaIR: true solc: version: 0.8.17 optimizer: enabled: true runs: 200
-
If after using the viaIR it still fail then it is likely the contract is still too complex.– Ismael ♦Feb 9 at 3:27
-
But in the remix, it was compiled successfully.– aliercanozgokceFeb 9 at 20:01
-
1The PR for this feature is still open: github.com/eth-brownie/brownie/pull/1572– aliercanozgokceFeb 9 at 20:02
1 Answer
Add viaIR to your brownie configuration (only on master branch of brownie at the time of writing)
$> cat brownie-config.yaml
[...]
compiler:
solc:
# viaIR option has been added in 0.8.13, you can adjust the version your need
version: 0.8.13
viaIR: True
See for more information https://github.com/eth-brownie/brownie/issues/1477