๐งช Deploy Using Hardhat
Install Hardhat (if not already installed):
npm install --save-dev hardhat
Create a Hardhat project:
npx hardhat init
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"]
}
}
};
Write your contract in
contracts/
and deploy script inscripts/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();
Run deployment:
npx hardhat run scripts/deploy.js --network yourChain
Last updated