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.xyarn install
yarn compile
To execute code static analysis and tests run commands
yarn static-analyze
yarn testYou can also report gas usage for each tested methods in smart contracts
REPORT_GAS=true yarn testTo show tests coverage report run
yarn coverageYou can export smart contracts API documentation to html file. It will be saved in docs folder
yarn docgenUse 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.jsonfor Polygon chain -
Execute deployment
yarn hardhat ignition deploy MODULE_FILE_PATH --network NETWORK --parameters PARAMETERS_FILE_PATH
-
Verify deployed contracts providing
deploymentIdyarn hardhat ignition verify DEPLOYMENT_ID
For example:
yarn hardhat ignition verify chain-137