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

Contract verification fails with dependency "File not found" in pnpm monorepo #6653

Closed
2 tasks done
rocketman-21 opened this issue Dec 22, 2023 · 2 comments
Closed
2 tasks done
Labels
T-bug Type: bug

Comments

@rocketman-21
Copy link

rocketman-21 commented Dec 22, 2023

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 (1978a03 2023-12-21T09:54:24.034180000Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

The error details suggest that a source file from OpenZeppelin's contracts is not found.

Steps to Reproduce

Run the following command in this branch:
collectivexyz/revolution-protocol#39

cd packages/protocol-rewards && forge script script/DeployProtocolRewards.s.sol:DeployContracts --rpc-url https://rpc.sepolia.org/ --broadcast --verify -vvvvv --etherscan-api-key [API_KEY] --private-key [PRIVATE_KEY] --chain-id 11155111 --verifier etherscan --verifier-url https://api-sepolia.etherscan.io/api? --force

Observe the error output.

Expected Behavior

Successful verification of the contract.

Actual Behavior

Error during contract verification with the following message:

Fail - Unable to verify. Solidity Compilation Error: Source "node_modules/@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol" not found: File not found. Searched the following locations: "".

Tried solutions

allow_paths = ["../../node_modules", "node_modules"] in packages/protocol-rewards/foundry.toml doesn't resolve the issue. It is just not finding the file.

@rocketman-21 rocketman-21 added the T-bug Type: bug label Dec 22, 2023
@gakonst gakonst added this to Foundry Dec 22, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Dec 22, 2023
@rocketman-21 rocketman-21 changed the title Contract verification fails with "File not found" in pnpm monorepo Contract verification fails with dependency "File not found" in pnpm monorepo Dec 22, 2023
@mattsse
Copy link
Member

mattsse commented Jan 9, 2024

is this still the case on a newer version?
we recently added a few fixes for smylinks:

foundry-rs/compilers#35
foundry-rs/compilers#36

@rocketman-21
Copy link
Author

rocketman-21 commented Jan 9, 2024

is this still the case on a newer version? we recently added a few fixes for smylinks:

foundry-rs/compilers#35 foundry-rs/compilers#36

amazing it seems to be working now with

forge 0.2.0 (71d8ea5 2024-01-09T15:10:35.372218000Z)

tysm sir

@jenpaff jenpaff moved this from Todo to Completed in Foundry Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

3 participants