-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Corrupted compilation artifacts in case of contracts name collision #2843
Comments
so the first run succeeds where you get but on partial recompile there's a conflict. fixing |
Great, thanks for the quick fix @mattsse |
Actually there are still collision possible. For example, if two files have the same name without the case sensitivy, but different with:
Then the collision still occur. In the repo Tested with the latest forge:
I haven't tested if |
right, forgot about case-sesnistivity... but this is now a simple fix. thanks for flagging again |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (6b3db2a 2022-08-19T00:24:19.967244Z)
What command(s) is the bug in?
forge build
Operating System
No response
Describe the bug
If two contracts are in files that share the same filename/contract name, foundry will generate corrupted compilation artifacts (one of the contract overwrites the other).
I was the impression that it was solved when #1488 was fixed, but I am still experimenting the issue with the latest
forge
.I created a repo to show the issue https://github.com/montyly/foundry-collision
src/a.sol:A
has afoo
function https://github.com/montyly/foundry-collision/blob/ce58230b551d8baccefbdcde07be52efaf3da7eb/src/a.sol#L1-L3src/inner/a.sol:A
has abar
function https://github.com/montyly/foundry-collision/blob/master/src/inner/a.solA
(in this example, it containsbar
) : https://github.com/montyly/foundry-collision/blob/master/out/a.sol/A.json#L2-L9This issue is a major blocker for many slither/echidna users, so it would be great if we could have a fix.
The text was updated successfully, but these errors were encountered: