zeta-chain / template

A smart contract template for ZetaChain for building omnichain and cross-chain messaging contracts
140 stars 74 forks source link

Client-based Hardhat config #46

Open fadeev opened 5 months ago

fadeev commented 5 months ago

Instead of the current approach:

https://github.com/zeta-chain/template/blob/9a47a78c3e2058c478910d62b30e158a1db0d4bb/hardhat.config.ts#L1-L14

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:

ronaldoguedess commented 4 months ago

🚀