network config #1156
Replies: 3 comments 4 replies
-
Hey, I can’t know for sure, as I’m new to Hardhat, but assuming you mean hardhat.config.js, I think the reason not to do that is: Best case scenario: you’d confuse other developers because those aren’t Hardhat configuration options. Worst case scenario: Hardhat would throw an error because those aren’t Hardhat configuration options. Also, I don’t think the existence of the network configuration object is dependent on us using Hardhat either (i.e. it would still be of use if we switched to raw Ethers), so keeping it in a separate file somewhat adheres to the separation of concerns principle (the concerns here being configuring Hardhat and configuring our deployments across different networks.) helper-hardhat-config.js might be a bad name. |
Beta Was this translation helpful? Give feedback.
-
We use hardhat.config STRICTLY for what Hardhat should understand and implement: importing packages (so that Hardhat can implement them), and other things such as network etc. networkConfig will be irrelevant here. So, we make a different file for that. Also because Hardhat does not have to know anything about it, we solely use it for our logical operations. Hope this answers your doubts. |
Beta Was this translation helpful? Give feedback.
-
@GaneshDonikena You can use there also, but for readability, we have moved all of the helper things to a separate file. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone! , why can't we write the following code in hardhat-config.js ?
Beta Was this translation helpful? Give feedback.
All reactions