Contract Deployment

Truffle: Deploy ERC20 Contract

Step 1. Enter smart-contract-example/truffle folder

$ cd planq-smart-contract-example/truffle

Step 2. Run npm install inside the folder

$ npm install

Step 3. Make a copy of .env.example to .env

$ cp .env.example .env

Step 4. Modify .env and fill ONE of the field

MNEMONIC=goose easy ivory ...
PRIVATE_KEY=XXXXXXX

Step 5. Review Migration Script at migrations/2_deploy_planq_token.js

  const PlanqToken = artifacts.require("PlanqToken");
  
  module.exports = function (deployer) {
      deployer.deploy(PlanqToken, "Planq Token", "PLQ", "1000000000000000000000000");
  };

Step 6. Endpoints setting

By default, the script will be using your local host "127.0.0.1" - If you are not running a localhost, you may leverage the public endpoint https://evm-rpc.planq.network/ by making changes to networks in truffle-config.js, for example:

Step 7. Deploy Contract

Step 8. Obtain Contract address from console and input to Metamask

Correct balance will be shown on Metamask page

Hardhat: Deploy ERC20 Contract

Step 1. Enter smart-contract-example/hardhat folder

Step 2. Run npm install inside the folder

Step 3. Make a copy of .env.example to .env

Step 4. Modify .env and fill ONE of the field

Step 5. Review Migration Script at scripts/deploy-planq-token.js

Step 6. Endpoints setting

By default, the script will be using your local host "127.0.0.1" - If you are not running a localhost, you may leverage the public endpoint https://evm-rpc.planq.network/ by making changes to networks in hardhat.config.js, for example:

Step 7. Deploy Contract

Step 8. Obtain Contract address from the console and input to Metamask

the Correct balance will be shown on Metamask page

Last updated