confusion about deploy
and script
folder
#1917
-
Hi! I have almost finished lesson 7 and left with some general doubts about folders.
Am i right about the above statments?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Beta Was this translation helpful? Give feedback.
-
Hey @MasterofBlockchain from your repo, I can see your directory structure is okay so your statements are right. Regarding the scripts folder, remember at first we used them to write our scripts to deploy the contracts? We could still use this folder for this purpose however, deploying scripts becomes hard to track if you have a lot of scripts to run or if you want to run multiple scripts at once, so we decided to start using the hardhat-deploy plugin. Using hardhat-deploy makes it easy to keep track of all our deploy scripts and we can easily deploy all of them at once by adding an However, the scripts folder is still usefull for writing standalone scripts that interact with our contracts in specific situations. For example, right now when we want to deploy our contract or mocks we run The test folder is meant to hold the various tests you have for your smartcontract. Hardhat chai (what you use for testing) is configured to run the scripts in the test folder whenever you run I hope this explanation helps you. |
Beta Was this translation helpful? Give feedback.
-
Wow! I pretty much got it in one reading. Wonderful explanation. |
Beta Was this translation helpful? Give feedback.
Hey @MasterofBlockchain from your repo, I can see your directory structure is okay so your statements are right.
Regarding the scripts folder, remember at first we used them to write our scripts to deploy the contracts? We could still use this folder for this purpose however, deploying scripts becomes hard to track if you have a lot of scripts to run or if you want to run multiple scripts at once, so we decided to start using the hardhat-deploy plugin. Using hardhat-deploy makes it easy to keep track of all our deploy scripts and we can easily deploy all of them at once by adding an
all
tag inmodule.exports.tags = ["all"]
Or if you rememberdeployments.fixtures(["all"])
also deploys all …