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

Fix missing library references in Zodiac Core mastercopy JSON #18

Merged
merged 5 commits into from
Sep 13, 2024

Conversation

juliopavila
Copy link
Contributor

Description

This PR addresses the issue where zodiac-core was not adding library references in the mastercopy JSON. Specifically, the problem was occurring during the OZ contract verification process, where the expected library addresses were missing in the generated artifact.

Example of missing library reference:

"libraries": {
  "contracts/MultisendEncoder.sol": {
    "MultisendEncoder": "0xB48669C9c27A3bE7219755B82E5d3567a0f4D21E"
  }
}

Solution

The following changes have been implemented:

  • Added logic to ensure that library references and their respective addresses are included in the compilerInput.settings.libraries field of the mastercopy JSON.
  • Replaced placeholder references with the actual on-chain addresses of deployed libraries in the bytecode.
  • Updated the mastercopy artifact structure to properly include these references in future deployments.

Testing

  • Verified that the new process correctly replaces library references and updates the mastercopy artifacts.
  • Ensured that the libraries section is added to the compilerInput for contracts with linked libraries.

cristovaoth and others added 2 commits September 10, 2024 17:38
- Resolved issue where 'zodiac-core' was not including library references in the mastercopy artifacts.
- Implemented logic to add 'libraries' field to the compilerInput in mastercopy artifacts.
- Ensured correct linkage of deployed library addresses during the build process.
@juliopavila
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

if (libraryAddress) {
compilerInput.settings.libraries[libraryPath][libraryName] =
libraryAddress;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@coveralls
Copy link

coveralls commented Sep 13, 2024

Pull Request Test Coverage Report for Build 10852152908

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.512%

Totals Coverage Status
Change from base Build 10777662617: 0.0%
Covered Lines: 122
Relevant Lines: 123

💛 - Coveralls

@samepant samepant merged commit d375c9f into master Sep 13, 2024
1 of 2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2024
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.

4 participants