Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Client-based Hardhat config #46

Description

@fadeev

Instead of the current approach:

import "@nomicfoundation/hardhat-toolbox";
import "@zetachain/toolkit/tasks";
import { getHardhatConfigNetworks } from "@zetachain/networks";
import { HardhatUserConfig } from "hardhat/config";
const config: HardhatUserConfig = {
networks: {
...getHardhatConfigNetworks(),
},
solidity: "0.8.7",
};
export default config;

I propose:

import "@zetachain/toolkit/tasks";
import { ethers } from "ethers";

import { ZetaChainClient } from "@zetachain/toolkit/client";

const client = new ZetaChainClient({
  network: "testnet",
  wallet: new ethers.Wallet(process.env.PRIVATE_KEY as string),
});

export const config = {
  ...client.getHardhatConfig(),
};

Advantages:

  • uses the same client-based approach
  • can easily switch between testnet and mainnet
  • can still configure properties of config manually

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions