sc-forks / solidity-coverage

Code coverage for Solidity smart-contracts
MIT License
979 stars 264 forks source link

viaIR-mode does not inline internal solidity libraries #790

Closed SevenSwen closed 9 months 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 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 https://github.com/ethereum/solidity/issues/14055

Minimal reproduction steps clone repo yarn yarn coverage Search terms viaIR, inliner, link library

cgewecke commented 9 months ago

This should be fixed in v0.8.7 - viaIR is natively supported and no special config is required.

If you're still running into issues with this please report them to #861