> For the complete documentation index, see [llms.txt](https://zayn-network.gitbook.io/overview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zayn-network.gitbook.io/overview/build-on-zayn/deploying-smart-contracts/hardhat.md).

# Hardhat

**Introduction to Hardhat**

Hardhat is a flexible Ethereum development environment. It is designed for developers who need robust tools to write, test, deploy, and debug their Ethereum software. Hardhat works well with Zayn Network by integrating with its Ethereum-compatible features.

**Steps to Deploy Using Hardhat**

1. **Set Up Your Hardhat Project:**
   * Install Hardhat using npm:

     ```bash
     bashCopy codenpm install --save-dev hardhat
     ```
   * Initialize a new Hardhat project:

     ```bash
     bashCopy codenpx hardhat
     ```
2. **Configure Hardhat for Zayn Network:**
   * Modify the `hardhat.config.js` to include Zayn Network’s RPC details:

     ```javascript
     javascriptCopy codemodule.exports = {
       networks: {
         zayn: {
           url: "https://rpc.zayn.network",
           accounts: ['your-private-key']
         }
       },
       solidity: "0.8.4",
     };
     ```
3. **Write Your Smart Contract:**
   * Create a new contract in the `contracts` folder, for example, `MyContract.sol`.
4. **Compile Your Smart Contract:**
   * Run the following command:

     ```bash
     bashCopy codenpx hardhat compile
     ```
5. **Deploy Your Smart Contract:**
   * Create a deploy script under the `scripts` folder.
   * Run the deployment script:

     ```bash
     bashCopy codenpx hardhat run scripts/deploy.js --network zayn
     ```
