Replies: 2 comments 2 replies
-
The addresses are on docs.hifi.finance, a website which is referencend at the top of the README.
This is true, but this tool was never meant to handle addresses. Actually, it is not meant to handle everything that may go into an npm package. It's just that the artifacts and the TypeChain bindings that I was concerned about. I couldn't think about a better name to capture what this tool does - I considered
The problem is that the same set of artifacts and Solidity ode could be mapped to (1) multiple networks and (2) multiple deployments. The hypothetical additional task would have to handle these possibilities and let the user provide the chain id, the rules for how an overriding deployment should be handled, etc.
There is no one-size-fits-all solution. It is common for factory users to fork other factory contracts and add functionality on top. Additionally, there are all sorts of edge-case scenarios, like upgradeable proxies being deployed with OpenZeppelin's hardhat-upgrades.
This is interesting. I will think about whether I can add support for something like this without compromising on user experience. Perhaps via an optional flag. |
Beta Was this translation helpful? Give feedback.
-
How do you envisage the addresses become part of the npm package, @jjperezaguinaga? Couple of ideas:
Also:
|
Beta Was this translation helpful? Give feedback.
-
Background
Right now, the deployment of contracts includes both the types and the artifacts (e.g. ABIs) needed to interact with the smart contract. Unfortunately, the deployed contract address is still something that has to be tracked manually somehow, either via documentation or via some proxy registry. I brought up this topic to @PaulRBerg on the following tweet, and documentation was brought again, but I feel it's not really a full solution (e.g. I tried to play around with the
hifi-protocol
contracts and I couldn't find the address in the repository's README for any network).What's the problem?
I'm trying to refactor the way scaffold-eth uses the smart contracts in the front-end to highlight the benefits of
hardhat-packager
(see @austintgriffith's tweet). Right now it expects a tightly coupled monorepo where artifacts are easily built or assembled within the front-end, but more often than not, this isn't the case. This is a great example of howhardhat-packager
can help by getting the contracts into a neatlynpm
package.That being said, while trying to add
hardhat-packager
, I realized that the smart contract address was written into the file disk after deployment, and then fetched in the front-end. Unfortunately,hardhat-packager
has no mechanisms to write the contract address on file disk or provide the front-end with a way to fetch the deployed and thus, need further work on top of the types and ABI import.Describe the feature you'd like to discuss
I would like to open a discussion about how to tackle the problem in question. Here are some ideas:
hardhat-packager
with an additional task able to write a deployed contract address into file disk so it's also tracked as part of thenpm
package.hardhat-packager
with the ability to use a Singleton Factory approach to either fetch or deploy the bytecode to a specific network.hardhat-packager
with a proxy-like (e.g. ERC1820Registry) smart contract that can keep track of the contract addresses given a specific contract.I'm aware that
hardhat-packager
isn't necessarily the best place to solve this, and I envision somehardhat.config.ts
with another plugin could look something like this:where
packager
makes sure you have all the contracts' types/artifacts,deployer
ensures they are deployed to a given network, andregistry
registers the address being used to fetch a specific contract version.Looking forward to some feedback, thanks!
Beta Was this translation helpful? Give feedback.
All reactions