foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
7.86k stars 1.56k forks source link

Forge coverage doesn't recognize require with custom error branches #8279

Open anajuliabit opened 3 days ago

anajuliabit commented 3 days ago

Component

Forge

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

What version of Foundry are you on?

forge 0.2.0 (6179312 2024-06-10T00:18:46.177980000Z)

What command(s) is the bug in?

forge coverage --ir-minimum

Operating System

macOS (Apple Silicon)

Describe the bug

Solidity 0.8.26 introduce a new overload require(bool, Error) that allows usage of require functions with custom errors. This feature is available in the via-ir pipeline only.

Forge coverage doesn't recognize the require branches when using with custom error.