Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
0x0scion opened this issue Jun 30, 2022 · 2 comments
Closed
2 tasks done
Labels
T-bug Type: bug

Comments

@0x0scion
Copy link

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
@0x0scion 0x0scion added the T-bug Type: bug label Jun 30, 2022
@0x0scion
Copy link
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)

@onbjerg
Copy link
Collaborator

onbjerg commented Jun 30, 2022

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
Labels
T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

2 participants