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
8.34k stars 1.76k forks source link

bug(`forge verify`): fails to resolve file during `--verify` #8844

Open entin-hun opened 2 months ago

entin-hun commented 2 months 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

Linux

Describe the bug

Hi, when forge create --verify runs, it returns:

cannot resolve file at "/root/opt/contract_deploy_foundry/lib/flattened/ExFlattened.sol"

Then, I separated create and verify, and turned out that it's successfully deployed, but then at verification step, the ABI path seems to be unreachable. If I open that path, the correct content is there.. bug

jenpaff commented 2 months ago

@entin-hun thanks a lot for opening this issue- would you be able to provide us with steps how to reproduce the issue?

entin-hun commented 2 months ago

provide us with steps how to reproduce the issue?

Hi @jenpaff , Thanks for looking into it: https://github.com/entin-hun/IncomeSplitter I made this repo specifically for reproduction. The issue is at the standalone verify step, so I think forge create should be removed from its title. I only kept that step in the repo script to guide you through the whole process from flattening, to prevent wondering whether the same contract's JSON is in the /out directory. Note that the flattened .sol starts with multiple solidity versions, so at forge verify-contract , the --compiler-version isn't the same.

grandizzy commented 3 weeks ago

@entin-hun this looks more like a forge flatten issue, could you please provide code for AutoSplit.sol used to flatten it?

forge flatten src/AutoSplit.sol > lib/flattened/SplitFlattened.sol

thank you!

grandizzy commented 1 week ago

@entin-hun bump wasn't able to reproduce using the provided repo and steps, mind to clarify this. thank you!