@zoralabs/protocol-deployments 0.1.2-exports.0 → 0.1.2

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.
@@ -0,0 +1,29 @@
1
+ $ yarn wagmi && yarn bundle-configs && tsup
2
+ $ wagmi generate
3
+ - Validating plugins
4
+ ✔ Validating plugins
5
+ - Resolving contracts
6
+ ✔ Resolving contracts
7
+ - Running plugins
8
+ ✔ Running plugins
9
+ - Writing to src/generated/wagmi.ts
10
+ ✔ Writing to src/generated/wagmi.ts
11
+ $ tsx scripts/bundle-configs.ts && yarn prettier
12
+ $ prettier --write 'src/**/*.ts' 'scripts/*' 'wagmi.config.ts'
13
+ src/index.ts 241ms (unchanged)
14
+ scripts/bundle-configs.ts 66ms (unchanged)
15
+ wagmi.config.ts 42ms (unchanged)
16
+ CLI Building entry: src/index.ts
17
+ CLI Using tsconfig: tsconfig.json
18
+ CLI tsup v7.3.0
19
+ CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/protocol-deployments/tsup.config.ts
20
+ CLI Target: es2021
21
+ CLI Cleaning output folder
22
+ CJS Build start
23
+ ESM Build start
24
+ ESM dist/index.js 108.65 KB
25
+ ESM dist/index.js.map 203.08 KB
26
+ ESM ⚡️ Build success in 54ms
27
+ CJS dist/index.cjs 110.76 KB
28
+ CJS dist/index.cjs.map 203.48 KB
29
+ CJS ⚡️ Build success in 54ms
package/CHANGELOG.md CHANGED
@@ -1,13 +1,12 @@
1
1
  # @zoralabs/protocol-deployments
2
2
 
3
- ## 0.1.2-exports.0
3
+ ## 0.1.2
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - b10b8d05: Publishing package in format that supports commonjs imports by specifying exports
8
- - Updated dependencies [b10b8d05]
9
- - @zoralabs/zora-1155-contracts@2.7.3-exports.0
10
- - @zoralabs/1155-deployments@0.0.3-exports.0
7
+ - 52b16aa: Publishing package in format that supports commonjs imports by specifying exports
8
+ - Updated dependencies [52b16aa]
9
+ - @zoralabs/zora-1155-contracts@2.7.3
11
10
 
12
11
  ## 0.1.1
13
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoralabs/protocol-deployments",
3
- "version": "0.1.2-exports.0",
3
+ "version": "0.1.2",
4
4
  "repository": "https://github.com/ourzora/zora-protocol",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@zoralabs/1155-deployments": "*",
27
- "@zoralabs/zora-1155-contracts": "2.7.3-exports.0"
27
+ "@zoralabs/zora-1155-contracts": "*"
28
28
  },
29
29
  "devDependencies": {
30
30
  "zoralabs-tsconfig": "*",
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "zoralabs-tsconfig/tsconfig.json",
3
+ "compilerOptions": {
4
+ "lib": ["es2021", "DOM"],
5
+ "baseUrl": ".",
6
+ "outDir": "dist"
7
+ },
8
+ "exclude": ["node_modules/**", "dist/**"],
9
+ "include": ["src/**/*.ts"]
10
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"],
5
+ sourcemap: true,
6
+ clean: true,
7
+ dts: false,
8
+ format: ["cjs", "esm"],
9
+ onSuccess:
10
+ "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
11
+ });
@@ -0,0 +1,107 @@
1
+ import { defineConfig } from "@wagmi/cli";
2
+ import { Abi } from "viem";
3
+ import { readdirSync, readFileSync } from "fs";
4
+ import * as abis from "@zoralabs/zora-1155-contracts";
5
+
6
+ type Address = `0x${string}`;
7
+
8
+ type Addresses = {
9
+ [contractName: string]: {
10
+ address: {
11
+ [chainId: number]: Address;
12
+ };
13
+ abi: Abi;
14
+ };
15
+ };
16
+
17
+ const getAddresses = () => {
18
+ const addresses: Addresses = {};
19
+
20
+ const addressesFiles = readdirSync("../1155-deployments/addresses");
21
+
22
+ const addAddress = ({
23
+ contractName,
24
+ chainId,
25
+ address,
26
+ abi,
27
+ }: {
28
+ contractName: string;
29
+ chainId: number;
30
+ address?: Address;
31
+ abi: Abi;
32
+ }) => {
33
+ if (!address) return;
34
+ if (!addresses[contractName]) {
35
+ addresses[contractName] = {
36
+ address: {},
37
+ abi,
38
+ };
39
+ }
40
+
41
+ addresses[contractName]!.address[chainId] = address;
42
+ };
43
+
44
+ for (const addressesFile of addressesFiles) {
45
+ const jsonAddress = JSON.parse(
46
+ readFileSync(`../1155-deployments/addresses/${addressesFile}`, "utf-8"),
47
+ ) as {
48
+ FIXED_PRICE_SALE_STRATEGY: Address;
49
+ MERKLE_MINT_SALE_STRATEGY: Address;
50
+ REDEEM_MINTER_FACTORY: Address;
51
+ "1155_IMPL": Address;
52
+ FACTORY_IMPL: Address;
53
+ FACTORY_PROXY: Address;
54
+ PREMINTER_PROXY?: Address;
55
+ };
56
+
57
+ const chainId = parseInt(addressesFile.split(".")[0]);
58
+
59
+ addAddress({
60
+ contractName: "ZoraCreatorFixedPriceSaleStrategy",
61
+ chainId,
62
+ address: jsonAddress.FIXED_PRICE_SALE_STRATEGY,
63
+ abi: abis.zoraCreatorFixedPriceSaleStrategyABI,
64
+ });
65
+ addAddress({
66
+ contractName: "ZoraCreatorMerkleMinterStrategy",
67
+ chainId,
68
+ address: jsonAddress.MERKLE_MINT_SALE_STRATEGY,
69
+ abi: abis.zoraCreatorMerkleMinterStrategyABI,
70
+ });
71
+ addAddress({
72
+ contractName: "ZoraCreator1155FactoryImpl",
73
+ chainId,
74
+ address: jsonAddress.FACTORY_PROXY,
75
+ abi: abis.zoraCreator1155FactoryImplABI,
76
+ });
77
+ addAddress({
78
+ contractName: "ZoraCreatorRedeemMinterFactory",
79
+ chainId,
80
+ address: jsonAddress.REDEEM_MINTER_FACTORY,
81
+ abi: abis.zoraCreatorRedeemMinterFactoryABI,
82
+ });
83
+ addAddress({
84
+ contractName: "ZoraCreator1155PremintExecutorImpl",
85
+ chainId,
86
+ address: jsonAddress.PREMINTER_PROXY,
87
+ abi: abis.zoraCreator1155PremintExecutorImplABI,
88
+ });
89
+ }
90
+
91
+ return addresses;
92
+ };
93
+
94
+ export default defineConfig({
95
+ out: "src/generated/wagmi.ts",
96
+ contracts: [
97
+ ...Object.entries(getAddresses()).map(([contractName, addressConfig]) => ({
98
+ abi: addressConfig.abi,
99
+ address: addressConfig.address,
100
+ name: contractName,
101
+ })),
102
+ {
103
+ abi: abis.zoraCreator1155ImplABI,
104
+ name: "ZoraCreator1155Impl",
105
+ },
106
+ ],
107
+ });