Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1.68 KB

File metadata and controls

56 lines (37 loc) · 1.68 KB

My Massa Smart-contract Project

Build

By default this will build all files in assembly/contracts directory.

npm run build

Deploy a smart contract

Prerequisites :

  • You must add a .env file at the root of the repository with you wallet private key :
    • PRIVATE_KEY="wallet_secret_key"

These keys will be the ones used by the deployer script to interact with the blockchain.

The following command will build contracts in assembly/contracts directory and execute the deployment script src/deploy.ts. This script will deploy on the node specified in the .env file.

npm run deploy

You can modify src/deploy.ts to change the smart contract being deployed, and to pass arguments to the constructor function:

  • line 16: specify what contract you want to deploy
  • line 19: create the Args object to pass to the constructor of the contract you want to deploy

When the deployment operation is executed on-chain, the constructor function of the smart contract being deployed will be called with the arguments provided in the deployment script.

You can edit this script and use massa-web3 library to create advanced deployment procedure.

For more information, please visit our ReadTheDocs about Massa smart-contract development.

Unit tests

The test framework documentation is available here: as-pect docs

npm run test

Format code

npm run fmt