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

feat(solc): handle conflicting artifacts properly #1491

Merged

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Jul 20, 2022

Motivation

Closes #1487

this changes how output files are computed and now takes possible conflicts into account.

this doesn't change how artifacts were emitted up to now and only adds extra logic if there are conflicting files.

maybe there'll be some edge cases with caching, but hard to anticipate at this point.

this also passes all existing foundry tests with a patched version

Solution

change emit logic:

  1. compute all output files as before but keep track of conflicting contracts
  2. adjust conflicting paths by finding a unique alternative path, traversing the sol file and prepending the parent dir(s) to the output file. this will always find a unique output path

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

solc: handle conflicting <file>/<contract name> pairs properly
2 participants