Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
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