Create a basic sample projectoption. This will provide you with a preset basic Hardhat project structure with simple smart contracts, tests, and example scripts.
@nomiclabs/hardhat-ethers. Both of these packages are useful during development and should be installed.
sample projectsetup option installs a sample contract named
Greeter.solwhich can be seen below.
Greeter.solcontract allows the deployer to set a greeting string, deploy the contract, and later either change or return the set greeting. You can also add your own contracts.
hardhat.config.jsas the configuration file. The config file allows you to define deployment networks, tasks, compilers, etc.
hardhat.config.jsfile to configure deployments to either the
quaitestnetor a local instance of Quai
privKeyto fund contract deployment.
provider_url.Run the script using
privKeyvariable from a separate, private file rather than placing it directly into
hardhat.config.jsfor best account safety practices.
sample-script.js, we can set the initial greeting and log out the contract address upon deployment. Scripts can be used to automate many different functions other than deployment.
Greeter.solto the network of your choice, run: