sc-forks / solidity-coverage

Code coverage for Solidity smart-contracts
MIT License
975 stars 263 forks source link

Tracking Issue: using viaIR in versions >= 0.8.7 #861

Closed cgewecke closed 6 months ago

cgewecke commented 7 months ago

Problems with viaIR resulting in 0% coverage should be resolved by v0.8.7. Release notes with advice about upgrading are here

There is a working example of the patch in this E2E test PR against the 1inch/solidity-utils repo.

If you're still experiencing problems with this please report them here and

cgewecke commented 7 months ago

Update: Patched in v0.8.10 (& a little more in 0.8.11)

870 is reporting some missing line coverage. The instrumentation disappears in two cases:

uint24 quantity = _cancelOrdersSide(_orderIds[i], price, bidsAtPrice[tokenId][price], bids[tokenId]);
brushFromUs += quantity * price;   // <--- not covered
for (uint i = _index; i < _segments.length.sub(1); ++i) {
    _segments[i] = _segments[i.inc()]; // <--- not covered
}

Compiling with 0.8.24

Something to note is that the instrumentation is preserved if console.log statements are added, so there must be a way to make it sticky.

cgewecke commented 6 months ago

Closing b/c this seems like it's resolved now. Will re-open if there are new reports of issues.