πŸͺ–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:

      bashCopy codenpm install --save-dev hardhat
    • Initialize a new Hardhat project:

      bashCopy codenpx hardhat
  2. Configure Hardhat for Zayn Network:

    • Modify the hardhat.config.js to include Zayn Network’s RPC details:

      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:

      bashCopy codenpx hardhat compile
  5. Deploy Your Smart Contract:

    • Create a deploy script under the scripts folder.

    • Run the deployment script:

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

Last updated