Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-based Hardhat config #46

Open
fadeev opened this issue Mar 26, 2024 · 1 comment
Open

Client-based Hardhat config #46

fadeev opened this issue Mar 26, 2024 · 1 comment

Comments

@fadeev
Copy link
Member

fadeev commented Mar 26, 2024

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
@ronaldoguedess
Copy link

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@fadeev @ronaldoguedess and others