@zoralabs/protocol-deployments 0.1.2 → 0.1.3-MINT.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -3,3 +3,4 @@
3
3
  // The can be generated by running `yarn prepack` in the root
4
4
  export * from "./generated/wagmi";
5
5
  export * as contracts1155 from "./generated/1155";
6
+ export * as mints from "./generated/mints";
package/wagmi.config.ts CHANGED
@@ -2,6 +2,7 @@ import { defineConfig } from "@wagmi/cli";
2
2
  import { Abi } from "viem";
3
3
  import { readdirSync, readFileSync } from "fs";
4
4
  import * as abis from "@zoralabs/zora-1155-contracts";
5
+ import { zoraMintsImplABI } from "@zoralabs/mints-contracts";
5
6
 
6
7
  type Address = `0x${string}`;
7
8
 
@@ -14,7 +15,7 @@ type Addresses = {
14
15
  };
15
16
  };
16
17
 
17
- const getAddresses = () => {
18
+ const get1155Addresses = () => {
18
19
  const addresses: Addresses = {};
19
20
 
20
21
  const addressesFiles = readdirSync("../1155-deployments/addresses");
@@ -91,17 +92,44 @@ const getAddresses = () => {
91
92
  return addresses;
92
93
  };
93
94
 
95
+ const getMintsAddresses = () => {
96
+ const addressesFiles = readdirSync("../mints-deployments/addresses");
97
+
98
+ const chainIds = addressesFiles.map((x) => Number(x.split(".")[0]));
99
+
100
+ const mintsProxyConfig = JSON.parse(
101
+ readFileSync(
102
+ "../mints-deployments/deterministicConfig/mintsProxy/params.json",
103
+ "utf-8",
104
+ ),
105
+ );
106
+
107
+ const mintsProxyAddress =
108
+ mintsProxyConfig.expectedTransparentProxyAddress as Address;
109
+
110
+ return Object.fromEntries(
111
+ chainIds.map((chainId) => [chainId, mintsProxyAddress]),
112
+ );
113
+ };
114
+
94
115
  export default defineConfig({
95
116
  out: "src/generated/wagmi.ts",
96
117
  contracts: [
97
- ...Object.entries(getAddresses()).map(([contractName, addressConfig]) => ({
98
- abi: addressConfig.abi,
99
- address: addressConfig.address,
100
- name: contractName,
101
- })),
118
+ ...Object.entries(get1155Addresses()).map(
119
+ ([contractName, addressConfig]) => ({
120
+ abi: addressConfig.abi,
121
+ address: addressConfig.address,
122
+ name: contractName,
123
+ }),
124
+ ),
102
125
  {
103
126
  abi: abis.zoraCreator1155ImplABI,
104
127
  name: "ZoraCreator1155Impl",
105
128
  },
129
+ {
130
+ abi: zoraMintsImplABI,
131
+ name: "ZoraMintsImpl",
132
+ address: getMintsAddresses(),
133
+ },
106
134
  ],
107
135
  });