Truffle

Truffle: Deploy ERC20 Contract

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

$ cd pool-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 fields

MNEMONIC=goose easy ivory ...
PRIVATE_KEY=XXXXXXX

Step 5. Review Migration Script at

migrations/2_deploy_pool_token.js
 const PoolToken = artifacts.require("PoolToken");
  module.exports = function (deployer) {
     deployer.deploy(PoolToken, "Pool Token", "PT", "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 http://13.213.36.146:6868 by making changes to networks in truffle-config.js, for example:

 networks: {
   development: {
     provider: new HDWalletProvider(getHDWallet(), "http://127.0.0.1:8545"), // TODO
     network_id: "*",       // Any network (default: none)
   },
   testnet: {
     provider: new HDWalletProvider(getHDWallet(), "http://13.213.36.146:6868/"), // TODO
     network_id: "*",
     skipDryRun: true
   },
 },

Step 7. Deploy Contract

truffle deployed --network <your-network>

Last updated