foundry icon indicating copy to clipboard operation
foundry copied to clipboard

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

Open entin-hun opened this issue 1 year ago • 2 comments

Component

Forge

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

  • [X] Foundry
  • [X] Foundryup

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

entin-hun avatar Sep 11 '24 13:09 entin-hun

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

jenpaff avatar Sep 24 '24 12:09 jenpaff

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.

entin-hun avatar Sep 24 '24 17:09 entin-hun

@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 avatar Oct 30 '24 08:10 grandizzy

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

grandizzy avatar Nov 14 '24 12:11 grandizzy

Closing as stale, pls respond to above if still an issue. Thank you

grandizzy avatar Mar 21 '25 17:03 grandizzy