This is blockchain part of Node Terminal project. It contains smart contracts used in application.
Create .env
file from the .env.example
file
Install Node (at least v20) and Yarn. You should be able to run the following command after the installation procedure below. Example:
$ node --version
20.x
$ yarn --version
1.22.x
yarn install
yarn compile
To execute code static analysis and tests run commands
yarn static-analyze
yarn test
You can also report gas usage for each tested methods in smart contracts
REPORT_GAS=true yarn test
To show tests coverage report run
yarn coverage
You can export smart contracts API documentation to html file. It will be saved in docs
folder
yarn docgen
Use Hardnat Ignition plugin to deploy new contracts.
-
Prepare deployment module
-
Add file defining deployment parameters. Name should contain chain id of destination network, e.g.
parameters-137.json
for Polygon chain -
Execute deployment
yarn hardhat ignition deploy MODULE_FILE_PATH --network NETWORK --parameters PARAMETERS_FILE_PATH
-
Verify deployed contracts providing
deploymentId
yarn hardhat ignition verify DEPLOYMENT_ID
For example:
yarn hardhat ignition verify chain-137