matter-labs / foundry-zksync

Fork of Foundry tailored for zkSync environment
Apache License 2.0
302 stars 130 forks source link

Confusing Error due to 'detect_missing_libraries' flag #722

Open Jrigada opened 2 weeks ago

Jrigada commented 2 weeks ago

Component

Forge

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

What version of Foundry are you on?

No response

What command(s) is the bug in?

No response

Operating System

None

Describe the bug

When users set detect_missing_libraries = true in foundry.toml and attempt to compile contracts, a panic occurs due to missing bytecode in dual-compiled contracts. This issue arises because, with this flag enabled, zksolc outputs no bytecode, resulting in the dual-compiled contracts not being generated correctly.

To improve the user experience, we should enhance the error message shown when attempting to locate a contract with this flag enabled, or alternatively, consider a different strategy to ensure the error message provides clear guidance on the missing bytecode issue.

710