POOLS Chain Documentation
  • Introduction
    • Version
    • Purpose: Blockchain & AI
    • Mission
    • Vision
  • MARKET OVERVIEW
    • Blockchain Market: Current State
    • Blockchain Market: Issues
    • Pools Chain Solutions
  • POOLS CHAIN OVERVIEW
    • Pools chain: Definition & Main functions
    • Features and Utilities
    • Compatible with EVM
    • Abilibitiy of Extension
    • Interoperable
    • Artificial Intelligence
    • Ecosystem
    • Dapps
      • Pools Wallet
      • AIHomes
      • Friendify GPT
      • More Dapps
      • Pools Phone
        • Pools Phone System
        • Pools Phone Authentication
  • Startmobis
  • TECHNICAL ARCHITECTURE
    • Proof-of-Stake (PoS)
    • Node structure
    • Security & Encryption mechanisms
    • Security and Finality
    • Reward
    • Validator Quorum
    • Staking and Governance
    • Staking on POOLS
    • Rewarding
    • Slashing
    • Double Sign
    • Governance Parameters
    • Smart contract language
      • Hardhat: Deploy ERC20 Contract
      • Truffle: Deploy ERC20 Contract
  • Develop smart contracts
  • Integrated smart contracts
  • Smart Contract Verification
    • Overview
    • How to verify your smart contracts on Pools Chain
  • Smart contract
    • Smart Contract Language
      • Hardhat
      • Truffle
    • Smart Contract Development
    • Smart Contract A.I Integration
    • Smart Contract Verification
      • Overview
      • How to verify your smart contracts on Pools Chain
  • TOKENOMIC
    • POOLS Coin: Role & Use case
    • Coin Distribution
    • Incentive Structure
  • ROADMAP & DEVELOPMENT PLAN
    • Pools Chain: Development Milestone
      • A playground for developers
      • Build the Infrastructure
      • Partnership
      • Marketing & PR
    • Future Plans
  • TEAM & PARTNERS
    • Core Team
    • Advisor & Partnership
  • NOTICE & DISCLAIMER
    • Legal Notices & Warnings
    • Regulatory Compliance & Transparency
    • Responsibilities & Rights
      • Pools Chain
      • Users
  • BUILT FOR DEVELOPERS
    • Pools SDK
      • Supported platforms
        • JavaScript
          • React
          • Pure JavaScript
          • Other web frameworks
          • React Native
          • Node.js
          • Electron
        • Mobile
          • Native IOS
    • Contract deploy
    • Blockchain Explorer
  • CONTACT US
    • Summary
    • Contact for further info
Powered by GitBook
On this page
  1. Smart contract
  2. Smart Contract Language

Hardhat

Hardhat: Deploy ERC20 Contract

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

$ cd smart-contract-example/hardhat

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 scripts/deploy-pool-token.js

 async function main() {
     const PoolToken = await hre.ethers.getContractFactory("PoolToken");
     const poolToken = await PoolToken.deploy("Pool Token", "CRT", "1000000000000000000000000");
      await poolToken.deployed();
      console.log("PoolToken deployed to:", poolToken.address);
 }

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 hardhat.config.js, for example:

 networks: {
   development: {
     url: "http://localhost:8545",
     accounts: getHDWallet(),
    },
   testnet: {
     url: "http://13.213.36.146:6868",
     accounts: getHDWallet(),
   },
 },

Step 7. Deploy Contract

npx hardhat run --network <your-network> scripts/deploy-pool-token.js

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

The correct balance will be shown on the Metamask page.

PreviousSmart Contract LanguageNextTruffle

Last updated 1 year ago