Tenderly / hardhat-tenderly

Tenderly plugin for HardHat
https://www.npmjs.com/package/@tenderly/hardhat-tenderly
Other
161 stars 40 forks source link

Tenderly can't compile contracts because it doesn't support `--via-ir` option #128

Open jrico207 opened 1 year ago

jrico207 commented 1 year ago

My contract needs solidity compiler option --via-ir it seems tenderly.verifyMultiCompilerAPI does not use this compiler option. Hardhat supports this option so while I'm able to use it with hardhat, I can't compile and verify contracts using tenderly.

Can you add viaIR option?

This is how it looks on hardhat.

                compiler: {
                    version: "0.8.17",
                    settings: {
                        optimizer: {
                            enabled: true,
                            runs: 1000,
                        },
                        viaIR: true
                    },
                }

Without it, I get this compilation error.

    error_type: 'CompilerError',
    component: 'general',
    message: 'Compiler error (/solidity/libsolidity/codegen/LValue.cpp:52):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.',
    formatted_message: undefined
  }
dule-git commented 3 weeks ago

Hey @jrico207,

Maybe the issue is resolved for you now after many versions have been released. But I would advise for moving from verifyMultiCompilerAPI since it does the same thing as tenderly.verify, but it is way less stable.

tenderly.verify loads the compiler configuration that you used to to deploy the contract from hardhat, which is more reliable than you providing the compiler config by yourself.

Or maybe you have a use-case that we are not covering? Maybe you have deployed this contract months ago and you want to verify that contract with the compiler config you used back then?