-
Notifications
You must be signed in to change notification settings - Fork 28
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
add optional chain param to viem deploy #783
add optional chain param to viem deploy #783
Conversation
I actually don't think this is needed at all. We have access to the chain ID, either by querying the network or via the custom one configured in hardhat config. All we need to do is pass the existing chain ID into the viem functions as well. No need for a new parameter. @kanej |
Agreed with @zoeyTM. Can you explain the motivation behind a new param? Is it because of a type-level limitation? |
6f5ec1c
to
1675490
Compare
I originally considered defining the custom chain inside the deploy function automatically if the chain id doesn't match a supported viem chain. But you have to make assumptions about native currency name, symbol, and decimals. They're required params when defining a viem chain. https://viem.sh/docs/chains/introduction#custom-chains EDIT: also I figured it should support functionality similar to the other viem hardhat functions (getPublicClient, getWalletClients, etc). They solve this problem with an optional chain parameter |
I think this functionality would be better served via extending hardhat config, adding the necessary fields to custom chains there, then pulling the info from |
And generate the custom chain internally if it's defined in the hardhat config? I can do it this way, I just want to make sure I understand how ya'll want it done before I get started |
f0a9619
to
98e7706
Compare
I am going to close this PR as we are porting Ignition to the Hardhat repo. We are also reworking the entirety of |
see #782