Before running any command, make sure to install dependencies:
$ npm install
Compile the smart contracts with Hardhat:
$ npm run compile
Compile the smart contracts and generate TypeChain artifacts:
$ npm run typechain
Run tests using interactive CLI
$ npm run test:runner
Run all the tests:
$ npm run test
Deploy the contracts to Hardhat Network:
$ npm run deploy
If you use VSCode, you can enjoy syntax highlighting for your Solidity code via the vscode-solidity extension. The recommended approach to set the compiler version is to add the following fields to your VSCode user settings:
{
"solidity.compileUsingRemoteVersion": "v0.8.4+commit.c7e474f2",
"solidity.defaultCompiler": "remote"
}
Where of course v0.8.4+commit.c7e474f2
can be replaced with any other version.