This repository was archived by the owner on Apr 8, 2026. It is now read-only.
feat: better BuildInfo support#59
Merged
mattsse merged 3 commits intofoundry-rs:developfrom Jun 20, 2022
Merged
Conversation
Requires foundry with foundry-rs/foundry@6ce16a4. Generates the debug files for easy access to the build info files during hardhat scripts.
🦋 Changeset detectedLatest commit: cff90a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
mattsse
approved these changes
Jun 20, 2022
Member
perhaps we need to revise this as well: because this rather hashes chose this for efficiency reasons, as we can hash the json buffer without creating (large) temporary json objects that then need to be hashed. |
tynes
added a commit
that referenced
this pull request
Jun 21, 2022
* feat(hardhat-forge): better `BuildInfo` support Requires foundry with foundry-rs/foundry@6ce16a4. Generates the debug files for easy access to the build info files during hardhat scripts. * feat(hardhat-forge): buildinfo tests * feat(hardhat-forge): better `BuildInfo` support
gakonst
added a commit
that referenced
this pull request
Jun 24, 2022
* Version Packages (#44) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix(hh/forge): typechain support (#45) (#46) Typechain uses a private method on the artifact with an unsafe `any` typecast to get artifact paths. To work with typechain, this method must exist until typechain is updated. The issue is here: dethcrypto/TypeChain#544 Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com> * Version Packages (#47) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Merge develop into master (#49) * fix(hh/forge): typechain support (#45) Typechain uses a private method on the artifact with an unsafe `any` typecast to get artifact paths. To work with typechain, this method must exist until typechain is updated. The issue is here: dethcrypto/TypeChain#544 * feat: `Artifacts.getBuildInfo` (#48) Implement a naive `getBuildInfo` function. This is useful for tooling that integrates more deeply with the hardhat ecosystem. Note that this implementation is not 100% with the output that the hardhat compiler toolchain outputs, but the output is good enough to get more tooling to be compatible. * Version Packages * Merge develop into master (#55) * fix(hh/forge): typechain support (#45) Typechain uses a private method on the artifact with an unsafe `any` typecast to get artifact paths. To work with typechain, this method must exist until typechain is updated. The issue is here: dethcrypto/TypeChain#544 * feat: `Artifacts.getBuildInfo` (#48) Implement a naive `getBuildInfo` function. This is useful for tooling that integrates more deeply with the hardhat ecosystem. Note that this implementation is not 100% with the output that the hardhat compiler toolchain outputs, but the output is good enough to get more tooling to be compatible. * hardhat-forge: use the correct source name (#51) The relative path to the file from the root of the project should be used as the source name in the artifact. Closes #36 This will fix tooling that depends on the source name: https://github.com/defi-wonderland/smock/blob/27fe7a5f3c351714257cdc98204e282932c11e12/src/utils/storage.ts#L54 * test: explicitly set port for anvil (#53) * test: explicitly set port for anvil * chore: add changeset Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> * Version Packages (#56) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: `Artifacts.getBuildInfo` (#48) Implement a naive `getBuildInfo` function. This is useful for tooling that integrates more deeply with the hardhat ecosystem. Note that this implementation is not 100% with the output that the hardhat compiler toolchain outputs, but the output is good enough to get more tooling to be compatible. * hardhat-forge: use the correct source name (#51) The relative path to the file from the root of the project should be used as the source name in the artifact. Closes #36 This will fix tooling that depends on the source name: https://github.com/defi-wonderland/smock/blob/27fe7a5f3c351714257cdc98204e282932c11e12/src/utils/storage.ts#L54 * test: explicitly set port for anvil (#53) * test: explicitly set port for anvil * chore: add changeset * feat: better `BuildInfo` support (#59) * feat(hardhat-forge): better `BuildInfo` support Requires foundry with foundry-rs/foundry@6ce16a4. Generates the debug files for easy access to the build info files during hardhat scripts. * feat(hardhat-forge): buildinfo tests * feat(hardhat-forge): better `BuildInfo` support Co-authored-by: Georgios Konstantopoulos <me@gakonst.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a companion to foundry-rs/foundry#2012
It adds better support for
hre.artifacts.getBuildInfo. The hardhat plugin doesn't currently have access to the values that make up the hash for the filename, so it simply searches through eachBuildInfoto find the correct one. Not super ideal, but works for now.It will generate the debug files in the same way that hardhat does, so hardhat plugins that rely on the debug files should just work.
To be able to optimize this, the hardhat plugin needs to be able to compute
md5(_format,solcVersion,solcLongVersion,input)