ApeWorX / ape-solidity

Solidity compiler plugin for the Ape Framework
https://www.apeworx.io/
Apache License 2.0
17 stars 23 forks source link

feat: enable via_ir in solidity settings [APE-1256] #117

Closed z80dev closed 1 year ago

z80dev commented 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

linear[bot] commented 1 year ago
APE-1256 "feat: enable via_ir in solidity settings" (ApeWorX/ape-solidity #117)

### 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*