-
Notifications
You must be signed in to change notification settings - Fork 15
/
wagmi.config.ts
29 lines (27 loc) · 1.09 KB
/
wagmi.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { defineConfig } from "@wagmi/cli";
import { hardhat, react, actions } from "@wagmi/cli/plugins";
import deployments from "./contracts/deployments.json";
// Converts deployments data into format awaited by the hardhat plugin
// See: https://wagmi.sh/cli/plugins/hardhat#deployments-optional
let hhPluginDeployments = {};
for (let chainId in deployments) {
let contractList = deployments[chainId as keyof typeof deployments][0].contracts;
for (const [contractName, contractData] of Object.entries(contractList)) {
if (contractName.includes("_")) continue; // Exclude proxies' implementation contracts
if (!hhPluginDeployments[contractName]) hhPluginDeployments[contractName] = {};
hhPluginDeployments[contractName][chainId] = contractData.address;
}
}
export default defineConfig({
out: "src/generated.ts",
plugins: [
hardhat({
project: "./contracts/hardhat/",
deployments: hhPluginDeployments,
include: ["contracts/src/**", "contracts/dev/**"],
exclude: ["contracts/src/abstracts/**", "contracts/src/libs/**"],
}),
react(),
actions(),
],
});