๐Ÿงช Deploy Using Hardhat

  1. Install Hardhat (if not already installed):

npm install --save-dev hardhat
  1. Create a Hardhat project:

npx hardhat init
  1. Add your network configuration in hardhat.config.js:

module.exports = {
  solidity: "0.8.20",
  networks: {
    yourChain: {
      url: "https://rpc1mainnet.qie.digital/",
      accounts: ["YOUR_PRIVATE_KEY"]
    }
  }
};
  1. Write your contract in contracts/ and deploy script in scripts/deploy.js:

const hre = require("hardhat");

async function main() {
  const Contract = await hre.ethers.getContractFactory("MyContract");
  const contract = await Contract.deploy();
  await contract.deployed();
  console.log("Deployed to:", contract.address);
}

main();
  1. Run deployment:

    npx hardhat run scripts/deploy.js --network yourChain

Last updated