Skip to content

Coverage Error: could not find anchor: no matching instruction in range #2165

Closed

Description

@0x0scion

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (5279f69 2022-06-29T00:09:16.192779Z)

What command(s) is the bug in?

forge coverage

Operating System

macOS (Intel)

Describe the bug

Getting an error when trying to run coverage:
(ERC20Upgradeable is an OZ contract)
all test run without issues

Analysing contracts...
Error: 
could not find anchor: no matching instruction in range ERC20Upgradeable:2193:91:3

Activity

  1. 0x0scion commented on Jun 30, 2022

    @0x0scion
    Author

    Some additional info:
    same error when running forge coverage in this example repo: https://github.com/devanonon/ERC4626Votes (from this blog post)

    Error is gone when reverting to a slightly earlier version of foundry - forge 0.2.0 (5385486 2022-06-27T00:03:53.397337486Z)

  2. onbjerg commented on Jun 30, 2022

    @onbjerg
    Member

    This is a known issue, abstract contracts do not work right now. forge coverage is not production ready yet! Thank you for your report 😄 See #1965

    The reason it works on a previous version is that the previous version used a different system to figure out what opcodes mark source ranges as covered, but that system is not super accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions