Closed z80dev closed 1 year ago
### What I did Enable compiling contracts with the `--via-ir` solc flag ### How I did it parse a boolean config value for enabling the `--via-ir` flag. this enables compiling solidity contracts through the Yul IR pipeline. This avoids `stack too deep` errors. I wrote the affected contract as inline code because if I write it as a contract in the contracts folder, then we have to enable `via_ir` for the whole project, or else all tests fail when compilation is attempted so I wrote it as inline source, write it to a file, attempt compilation without `via_ir` and check that it fails, and then re-attempt compilation after enabling the `via_ir` flag. ### How to verify it Add the following config values in a repo with contracts affected by stack-too-deep ``` solidity: via_ir: True ``` ### Checklist --- [ApeWorX/ape-solidity #117](https://github.com/ApeWorX/ape-solidity/pull/117) by [z80dev](https://github.com/z80dev) on GitHub *via LinearSync*
What I did
Enable compiling contracts with the
--via-ir
solc flagHow I did it
parse a boolean config value for enabling the
--via-ir
flag. this enables compiling solidity contracts through the Yul IR pipeline. This avoidsstack too deep
errors.I wrote the affected contract as inline code because if I write it as a contract in the contracts folder, then we have to enable
via_ir
for the whole project, or else all tests fail when compilation is attemptedso I wrote it as inline source, write it to a file, attempt compilation without
via_ir
and check that it fails, and then re-attempt compilation after enabling thevia_ir
flag.How to verify it
Add the following config values in a repo with contracts affected by stack-too-deep
Checklist