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

Duplicate contract names error for contracts with different file names #7042

Closed
2 tasks done
divine-comedian opened this issue Feb 7, 2024 · 0 comments · Fixed by #7053
Closed
2 tasks done

Duplicate contract names error for contracts with different file names #7042

divine-comedian opened this issue Feb 7, 2024 · 0 comments · Fixed by #7053
Labels
T-bug Type: bug

Comments

@divine-comedian
Copy link

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 (2cf84d9 2024-02-07T00:16:06.769732275Z)

What command(s) is the bug in?

forge create

Operating System

Linux

Describe the bug

While running forge create I receive an error saying I have duplicate contract names. While that is true I have them in two separate, distinctly named files - ModifiedTokenDistro.sol and TokenDistro.sol.
image

When I run this command:

forge create --private-key $PRIVATE_KEY --etherscan-api-key $GNOSISSCAN_API_KEY --chain-id 100 --verify --rpc-url $GNOSIS_RPC_URL --verifier-url https://api.gnosisscan.io/api contracts/ModifiedTokenDistro.sol:TokenDistro

I get this error:

Error: 
If cache is disabled, compiler version must be either provided with `--compiler-version` option or set in foundry.toml

Context:
- contract with duplicate name `TokenDistro`. please pass the path instead

image

However I did specify the relative path to the contract file and the contract name - so why does it think there is a duplicate contract if I did explicitly specify the file path?

here is a public URL to the contract in question
https://github.com/Giveth/giveconomy-foundry/blob/modify-allocation-functions/contracts/ModifiedTokenDistro.sol

@divine-comedian divine-comedian added the T-bug Type: bug label Feb 7, 2024
@gakonst gakonst added this to Foundry Feb 7, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Feb 7, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Feb 10, 2024
@jenpaff jenpaff moved this from Done 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

Successfully merging a pull request may close this issue.

1 participant