@zoralabs/protocol-deployments 0.0.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.
Files changed (77) hide show
  1. package/.env.anvil +2 -0
  2. package/.turbo/turbo-build.log +34 -0
  3. package/CHANGELOG.md +34 -0
  4. package/README.md +20 -0
  5. package/addresses/1.json +14 -0
  6. package/addresses/10.json +14 -0
  7. package/addresses/11155111.json +9 -0
  8. package/addresses/420.json +14 -0
  9. package/addresses/424.json +11 -0
  10. package/addresses/5.json +14 -0
  11. package/addresses/58008.json +11 -0
  12. package/addresses/7777777.json +14 -0
  13. package/addresses/8453.json +14 -0
  14. package/addresses/84531.json +14 -0
  15. package/addresses/999.json +14 -0
  16. package/addresses/999999999.json +13 -0
  17. package/chainConfigs/1.json +5 -0
  18. package/chainConfigs/10.json +5 -0
  19. package/chainConfigs/11155111.json +4 -0
  20. package/chainConfigs/420.json +5 -0
  21. package/chainConfigs/424.json +5 -0
  22. package/chainConfigs/5.json +5 -0
  23. package/chainConfigs/58008.json +4 -0
  24. package/chainConfigs/7777777.json +5 -0
  25. package/chainConfigs/8453.json +5 -0
  26. package/chainConfigs/84531.json +5 -0
  27. package/chainConfigs/999.json +5 -0
  28. package/chainConfigs/999999999.json +5 -0
  29. package/deterministicConfig/factoryProxy/params.json +10 -0
  30. package/deterministicConfig/factoryProxy/signatures.json +14 -0
  31. package/deterministicConfig/premintExecutorProxy/params.json +10 -0
  32. package/deterministicConfig/premintExecutorProxy/signatures.json +11 -0
  33. package/deterministicConfig/upgradeGate/params.json +7 -0
  34. package/deterministicConfig/upgradeGate/signatures.json +14 -0
  35. package/dist/index.cjs +3360 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.js +3314 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/package/batchPublish.test.d.ts +451 -0
  40. package/dist/package/batchPublish.test.d.ts.map +1 -0
  41. package/dist/package/chainConfigs.d.ts +61 -0
  42. package/dist/package/chainConfigs.d.ts.map +1 -0
  43. package/dist/package/deployment.d.ts +32 -0
  44. package/dist/package/deployment.d.ts.map +1 -0
  45. package/dist/package/index.d.ts +3 -0
  46. package/dist/package/index.d.ts.map +1 -0
  47. package/dist/package/wagmiGenerated.d.ts +6810 -0
  48. package/dist/package/wagmiGenerated.d.ts.map +1 -0
  49. package/dist/script/copy-deployed-contracts.d.ts +2 -0
  50. package/dist/script/copy-deployed-contracts.d.ts.map +1 -0
  51. package/dist/script/signDeploymentTransactions.d.ts +2 -0
  52. package/dist/script/signDeploymentTransactions.d.ts.map +1 -0
  53. package/foundry.toml +40 -0
  54. package/package/batchPublish.test.ts +326 -0
  55. package/package/chainConfigs.ts +60 -0
  56. package/package/deployment.ts +94 -0
  57. package/package/index.ts +5 -0
  58. package/package/wagmiGenerated.ts +3472 -0
  59. package/package.json +44 -0
  60. package/remappings.txt +9 -0
  61. package/script/CalculateDeterministicParams.s.sol +84 -0
  62. package/script/DeployMintersAndImplementations.s.sol +31 -0
  63. package/script/DeployNewImplementation.s.sol +26 -0
  64. package/script/DeployPreminterImpl.s.sol +23 -0
  65. package/script/DeployProxiesToNewChain.s.sol +42 -0
  66. package/script/DeployUpgradeGate.s.sol +27 -0
  67. package/script/Upgrade.s.sol +83 -0
  68. package/script/UpgradePreminter.s.sol +34 -0
  69. package/script/bundle-chainConfigs.mjs +36 -0
  70. package/script/copy-deployed-contracts.ts +66 -0
  71. package/script/signDeploymentTransactions.ts +277 -0
  72. package/test/NewFactoryProxyDeployer.t.sol +127 -0
  73. package/test/ZoraCreator1155Factory_Fork.t.sol +151 -0
  74. package/test/ZoraCreator1155PremintExecutorForkTest.t.sol +93 -0
  75. package/tsconfig.json +25 -0
  76. package/tsup.config.ts +10 -0
  77. package/wagmi.config.ts +113 -0
@@ -0,0 +1,113 @@
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("./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(`./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
+ addAddress({
90
+ contractName: "IImmutableCreate2Factory",
91
+ chainId,
92
+ address: "0x0000000000FFe8B47B3e2130213B802212439497",
93
+ abi: abis.iImmutableCreate2FactoryABI,
94
+ });
95
+ }
96
+
97
+ return addresses;
98
+ };
99
+
100
+ export default defineConfig({
101
+ out: "package/wagmiGenerated.ts",
102
+ contracts: [
103
+ ...Object.entries(getAddresses()).map(([contractName, addressConfig]) => ({
104
+ abi: addressConfig.abi,
105
+ address: addressConfig.address,
106
+ name: contractName,
107
+ })),
108
+ {
109
+ abi: abis.zoraCreator1155ImplABI,
110
+ name: "ZoraCreator1155Impl",
111
+ },
112
+ ],
113
+ });