-
Hi @othaime-en @krakxn I am not able to properly understand what does getNamedAccounts( ) really do? Also importing getNamedAcounts and deployments in your deploy file is optional? Where are getNamedAccounts function and deployments coming from? My deploy script was working fine even without importing it. Also I am not able to get my head around this deployer thing, What/who is deployer? Why are we connecting it to our contracts when deploying, something that I know is, it comes from config file,(namedAccount) where we set deployer as "0". Why are we exactly doing it? There is a mention of players/users also, I don't understand that either(Why are we setting players/users). Also getSigners( ) function basically connects the wallet? And, Accounts and wallet are interchangeably used by Patrick? I am not even able to find the proper docs to learn it. (would appreciate if you could let know) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hello @ashrth I recently explained this difference in this post. Please read through the discussion especially the marked answer and this comment if you feel you still don't understand, please feel free to seek further clarification. |
Beta Was this translation helpful? Give feedback.
-
@ashrth I have kept this as simple as possible (or tried to), so feel free to ask questions wherever necessary. "Where are getNamedAccounts function and deployments coming from?" They are coming from Hardhat; we "extract" it from the Hardhat package ( "My deploy script was working fine even without importing it" I will need context for this one; please post the code snippet if necessary. "Also I am not able to get my head around this deployer thing, What/who is deployer?" If you look at "Why are we connecting it to our contracts when deploying," This is a bit advanced, but to put the "why" in the simplest way possible, "Why are we exactly doing it?" It is just a test-account. In Injected Web3 (i.e. testnets and Metamask), we need an account right to create txns? Similarly, Hardhat is essentially a local testing environment to simulate real-world conditions. "There is a mention of players/users also, I don't understand that either(Why are we setting players/users)." We needed other accounts for testing, that is why we created more testing accounts like "Also getSigners( ) function basically connects the wallet?" Correct, it is similar to the one described above. "Accounts and wallet are interchangeably used by Patrick?" Sorry, I do not recall this one. Could you share the code snippet or timestamp? Thank you. "I am aware of the fact that are queries are petty" Asking the simplest things should be encouraged, do not worry, that is the best way to learn new things, especially in this space which is so new. (unrelated but it is just how the society has been for centuries; for instance, look at Galileo or any prominent reformer who questioned the inevitable "simplest things"). |
Beta Was this translation helpful? Give feedback.
@ashrth I have kept this as simple as possible (or tried to), so feel free to ask questions wherever necessary.
"Where are getNamedAccounts function and deployments coming from?" They are coming from Hardhat; we "extract" it from the Hardhat package (
hre
= Hardhat runtime environment). These utilities are provided to us in the Hardhat package."My deploy script was working fine even without importing it" I will need context for this one; please post the code snippet if necessary.
"Also I am not able to get my head around this deployer thing, What/who is deployer?" If you look at
hardhat.config
, you will see that in thenamedAccounts
field, there is adeployer
account. So, anything specifi…