LogoLogo
  • Gather Fundamentals
    • INTRODUCTION TO GATHER
    • GTH
    • TOKEN STANDARDS
      • CREATE YOUR FIRST GRC-20 TOKEN
      • CREATE YOUR FIRST GRC-721 TOKEN
    • NETWORKS
    • CONSENSUS
      • PROOF-OF-WORK (POW) & GTHASH
    • BLOCK EXPLORER
    • BRIDGE
    • MULTI-SEND
  • GATHER DEVELOPEMENT STACK
    • WALLET SETUPS
      • GATHER WEB WALLET
      • METAMASK MAINNET CONFIGURATION
      • METAMASK TESTNET CONFIGURATION
    • SMART CONTRACTS & DAPPs
      • DEPLOYING YOUR FIRST SMART CONTRACT
      • HARDHAT CONFIGURATION AND DEPLOYMENT
      • TRUFFLE CONFIGURATION AND DEPLOYMENT
      • BUILDING AN ESCROW SMART CONTRACT
      • BUILDING AN E-COMMERCE SHOPPING SMART CONTRACT
      • DEPLOYING NFT MARKETPLACE DAPP
      • DEPLOYING DE-FI BANK DAPP
      • DEPLOYING DECENTRALIZED TWITTER
    • TESTNET FAUCET
    • COVALENT
    • THIRDWEB
    • VERIFY SMART CONTRACTS
      • VERIFY CONTRACTS ON SOURCIFY VIA REMIX IDE
      • VERIFY CONTRACTS USING HARDHAT
Powered by GitBook
On this page
  1. GATHER DEVELOPEMENT STACK
  2. SMART CONTRACTS & DAPPs

HARDHAT CONFIGURATION AND DEPLOYMENT

PreviousDEPLOYING YOUR FIRST SMART CONTRACTNextTRUFFLE CONFIGURATION AND DEPLOYMENT

Last updated 3 years ago

This document is a guide to help you configure Hardhat and deploy your dapp smart contracts for the Gather Network.

Follow these steps in sequential order:

  1. In your Hardhat dapp project open the file named hardhat.config.js and add the details of a Gather Networks (testnet and mainnet) in the networks object:

    require("@nomiclabs/hardhat-ethers");
    
    const mnemonic = "Enter_your_account_mnemonic_here";
    
    module.exports = {
      solidity: "0.6.12",
      networks: {
          
        gather-testnet: {
          url: `https://testnet.gather.network`,
          chainId: 356256156,
          accounts: {mnemonic: mnemonic}
        },
        
        gather-mainnet: {
          url: `https://mainnet.gather.network`,
          chainId: 192837465,
          accounts: {mnemonic: mnemonic}
        }
      }
    };
  2. Compile your dapp smart contracts and migrate on the Gather networks configured in the previous step.

    • For testnet:

      npx hardhat run scripts/deploy.js --network gather-testnet
    • For mainnet:

      npx hardhat run scripts/deploy.js --network gather-mainnet
  3. You have now deployed the smart contracts of your dapp on the Gather Blockchain. You can now easily interact with your smart contract deployed on the Gather Network blockchain using your dapp frontend or Hardhat commands.

    Follow this link for the Hardhat documentation:

Overview | Hardhat | Ethereum development environment for professionals by Nomic Labs