NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.31k stars 1.41k forks source link

viaIR-mode does not inline insided solidity libraries #3782

Closed SevenSwen closed 1 year ago

SevenSwen commented 1 year ago

Version of Hardhat

2.13.0

What happened?

Solidity-coverage has broken inliner optimization. When I run coverage with optimizerSteps:

"dhfoDgvlfnTUtnIf" +
"[" +
    "xa[r]EscLM" +
    "cCTUtTOntnfDIl" +
    "Lcl" +
    "Vcl [j]" +
    "Tpel" +
    "xa[rl]" +
    "xa[r]cL" +
    "gvif" +
    "CTUca[r]LSsTFOtfDnca[r]Ilc"
"]" +
  "jml[jl] VcTOcl jml",

(default settings without u instrumentation in all steps) than all tests will be finished success. But If I remove "gvif" step (inliner optimization) then I will have error: NomicLabsHardhatPluginError: The contract <contract_name> is missing links for the following libraries: @openzeppelin/contracts/utils/math/Math.sol:Math Repo/branch: https://github.com/1inch/farming/tree/feature/enable_viaIR

Same my issue into ethereum/solidity

Minimal reproduction steps

Search terms

viaIR, inliner, link library

fvictorio commented 1 year ago

Hey @SevenSwen, are you sure this issue shouldn't be reported in the solidity-coverage repo?

SevenSwen commented 1 year ago

Hmm, maybe you right @fvictorio, sorry for this. I have created issue to solidity-coverage.

I'll close this issue for now