Skip to content

chore: remove Python requirement for contracts development.#1144

Merged
raulk merged 2 commits intomainfrom
raulk/remove-python
Sep 24, 2024
Merged

chore: remove Python requirement for contracts development.#1144
raulk merged 2 commits intomainfrom
raulk/remove-python

Conversation

@raulk
Copy link
Copy Markdown
Contributor

@raulk raulk commented Sep 24, 2024

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.

@raulk raulk requested a review from a team as a code owner September 24, 2024 11:39
Copy link
Copy Markdown
Contributor

@cryptoAtwill cryptoAtwill left a comment

Choose a reason for hiding this comment

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

LGTM

@raulk raulk force-pushed the raulk/remove-python branch from a10c331 to 16f9caa Compare September 24, 2024 11:46
@raulk
Copy link
Copy Markdown
Contributor Author

raulk commented Sep 24, 2024

cc @JulissaDantes

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.
@raulk raulk force-pushed the raulk/remove-python branch from 16f9caa to fff99da Compare September 24, 2024 11:48
// 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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@raulk And presumably the rest works out of the box because it works with standard Hardhat folder structure?


// Codegen.
let code = `// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.19;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we use ^0.8.23 in most other contracts now. Is it worth updating here as well?

@karlem
Copy link
Copy Markdown
Contributor

karlem commented Sep 24, 2024

Really cool. Just left small comments.

@raulk raulk merged commit 294531c into main Sep 24, 2024
@raulk raulk deleted the raulk/remove-python branch September 24, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants