> For the complete documentation index, see [llms.txt](https://docs.qie.digital/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qie.digital/developer-docs/smart-contract-deployment/deploy-using-hardhat.md).

# 🧪 Deploy Using Hardhat

1. **Install Hardhat** (if not already installed):

```
npm install --save-dev hardhat
```

2. **Create a Hardhat project**:

```
npx hardhat init
```

3. **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"]
    }
  }
};

```

4. **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();

```

5. **Run deployment**:<br>

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