chore: remove Python requirement for contracts development.#1144
Merged
Conversation
a10c331 to
16f9caa
Compare
Contributor
Author
In the past, we didn't have a clean and structured Hardhat usage for contract development/deployment, so we resorted to an adhoc Python script to generate a selector library utility for testing diamonds. Our usage of Hardhat has improved significantly, so it's time to integrate this codegen step as a Hardhat task in order to reduce codebase entropy.
16f9caa to
fff99da
Compare
karlem
reviewed
Sep 24, 2024
| // ridiculously, this appears to be the only way to get hardhat to compile a specific subtree | ||
| // we are only updating the in-memory representation of the config, so it won't write this value out to disk | ||
| // be careful if you compose this task with other tasks in larger scripts! | ||
| hre.config.paths.sources = './test/mocks' |
Contributor
There was a problem hiding this comment.
@raulk And presumably the rest works out of the box because it works with standard Hardhat folder structure?
karlem
reviewed
Sep 24, 2024
|
|
||
| // Codegen. | ||
| let code = `// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
| pragma solidity ^0.8.19; |
Contributor
There was a problem hiding this comment.
I think we use ^0.8.23 in most other contracts now. Is it worth updating here as well?
Contributor
|
Really cool. Just left small comments. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In the past, we didn't have a clean and structured Hardhat usage for contract development/deployment, so we resorted to an adhoc Python script to generate a selector library utility for testing diamonds.
Our usage of Hardhat has improved significantly, so it's time to integrate this codegen step as a Hardhat task in order to reduce codebase entropy.