-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
wagmi.config.ts
51 lines (39 loc) · 1.48 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { StandardMerkleTree } from '@openzeppelin/merkle-tree';
import { defineConfig } from '@wagmi/cli'
import type { Abi, Address } from 'abitype'
import { existsSync, mkdirSync,readFileSync, writeFileSync } from 'fs'
import * as HeklaDeployment from '../nfts/deployments/taikoon/hekla.json'
import * as MainnetDeployment from '../nfts/deployments/taikoon/mainnet.json'
import TaikoonToken from '../nfts/out/TaikoonToken.sol/TaikoonToken.json'
function generateNetworkWhitelist(network: string){
const tree = StandardMerkleTree.load(JSON.parse(
readFileSync(
`../nfts/data/taikoon/whitelist/${network}.json`,
'utf8')
))
writeFileSync(`./src/generated/whitelist/${network}.json`,
JSON.stringify(tree.dump(), null, 2))
console.warn(`Whitelist merkle root for network ${network}: ${tree.root}`)
}
function generateWhitelistJson() {
const whitelistDir = "./src/generated/whitelist";
if (!existsSync(whitelistDir)) {
mkdirSync(whitelistDir, { recursive: true });
}
generateNetworkWhitelist("hekla");
generateNetworkWhitelist("mainnet");
}
generateWhitelistJson();
export default defineConfig({
out: 'src/generated/abi/index.ts',
contracts: [
{
name: 'TaikoonToken',
address: {
167009: HeklaDeployment.TaikoonToken as Address,
167000: MainnetDeployment.TaikoonToken as Address,
},
abi: TaikoonToken.abi as Abi,
}
],
})