@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 @@
1
+ {"version":3,"file":"wagmiGenerated.d.ts","sourceRoot":"","sources":["../../package/wagmiGenerated.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,eAAO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EAuIpC,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;CAaxC,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGvC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=copy-deployed-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-deployed-contracts.d.ts","sourceRoot":"","sources":["../../script/copy-deployed-contracts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=signDeploymentTransactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signDeploymentTransactions.d.ts","sourceRoot":"","sources":["../../script/signDeploymentTransactions.ts"],"names":[],"mappings":""}
package/foundry.toml ADDED
@@ -0,0 +1,40 @@
1
+ [profile.default]
2
+ fs_permissions = [
3
+ { access = "read", path = "./addresses" },
4
+ { access = "read", path = "./chainConfigs" },
5
+ { access = "read", path = "./package.json" },
6
+ { access = "readwrite", path = "./deterministicConfig" },
7
+ ]
8
+ libs = ['_imagine', 'node_modules', 'script']
9
+ allow_paths = [
10
+ "node_modules/@zoralabs/protocol-rewards",
11
+ "node_modules/@zoralabs/zora-1155-contracts",
12
+ ]
13
+ optimizer = true
14
+ optimizer_runs = 50
15
+ via_ir = true
16
+ solc_version = '0.8.17'
17
+ out = 'out'
18
+ src = 'src'
19
+
20
+ [profile.dev]
21
+ optimizer = false
22
+ optimizer_runs = 0
23
+ via_ir = false
24
+
25
+ [rpc_endpoints]
26
+ goerli = "https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}"
27
+ mainnet = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
28
+ # for optimism, since we are just using this for deployment/fork testing,
29
+ # we can use these since they're lower volume.
30
+ base = "https://base-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
31
+ base_goerli = "https://base-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}"
32
+ optimism = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
33
+ optimism_goerli = "https://opt-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}"
34
+ pgn = "https://rpc.publicgoods.network"
35
+ pgn_sepolia = "https://sepolia.publicgoods.network"
36
+ zora = "https://rpc.zora.energy"
37
+ zora_goerli = "https://testnet.rpc.zora.energy"
38
+ zora_sepolia = "https://sepolia.rpc.zora.energy"
39
+
40
+ # See more config options https://github.com/foundry-rs/foundry/tree/master/config
@@ -0,0 +1,326 @@
1
+ import {
2
+ http,
3
+ createWalletClient,
4
+ createPublicClient,
5
+ encodeFunctionData,
6
+ TransactionReceipt,
7
+ decodeEventLog,
8
+ encodeAbiParameters,
9
+ parseEther,
10
+ createTestClient,
11
+ } from "viem";
12
+ import { foundry, zora } from "viem/chains";
13
+ import { describe, it, expect } from "vitest";
14
+ import {
15
+ zoraCreator1155FactoryImplConfig,
16
+ zoraCreatorFixedPriceSaleStrategyABI,
17
+ } from "./wagmiGenerated";
18
+ import { zoraCreator1155ImplABI } from "@zoralabs/zora-1155-contracts";
19
+
20
+ const walletClient = createWalletClient({
21
+ chain: foundry,
22
+ transport: http(),
23
+ });
24
+
25
+ export const walletClientWithAccount = createWalletClient({
26
+ chain: foundry,
27
+ transport: http(),
28
+ });
29
+
30
+ const testClient = createTestClient({
31
+ chain: foundry,
32
+ mode: "anvil",
33
+ transport: http(),
34
+ });
35
+
36
+ const publicClient = createPublicClient({
37
+ chain: foundry,
38
+ transport: http(),
39
+ });
40
+
41
+ type Address = `0x${string}`;
42
+
43
+ // JSON-RPC Account
44
+ const [creatorAccount, collectorAccount] =
45
+ (await walletClient.getAddresses()) as [Address, Address, Address];
46
+
47
+ const factoryProxyAddress = zoraCreator1155FactoryImplConfig.address[
48
+ zora.id
49
+ ].toLowerCase() as `0x${string}`;
50
+
51
+ const AddressZero = "0x0000000000000000000000000000000000000000";
52
+
53
+ type CreateTokenParams = {
54
+ fixedPriceStrategyAddress: `0x${string}`;
55
+ maxSupply: bigint;
56
+ nextTokenId: bigint;
57
+ price: bigint;
58
+ saleEnd?: bigint;
59
+ saleStart?: bigint;
60
+ mintLimit?: bigint;
61
+ tokenURI: string;
62
+ royaltyBPS: number;
63
+ royaltyRecipient: `0x${string}`;
64
+ autoSupplyInterval: number;
65
+ };
66
+
67
+ function constructCreate1155Calls({
68
+ fixedPriceStrategyAddress,
69
+ maxSupply,
70
+ mintLimit,
71
+ nextTokenId,
72
+ price,
73
+ saleEnd,
74
+ saleStart,
75
+ tokenURI,
76
+ royaltyBPS,
77
+ royaltyRecipient,
78
+ autoSupplyInterval,
79
+ }: CreateTokenParams): `0x${string}`[] {
80
+ if (!royaltyRecipient) {
81
+ royaltyRecipient = AddressZero;
82
+ autoSupplyInterval = 0;
83
+ }
84
+ const verifyTokenIdExpected = encodeFunctionData({
85
+ abi: zoraCreator1155ImplABI,
86
+ functionName: "assumeLastTokenIdMatches",
87
+ args: [nextTokenId - 1n],
88
+ });
89
+
90
+ const setupNewToken = encodeFunctionData({
91
+ abi: zoraCreator1155ImplABI,
92
+ functionName: "setupNewToken",
93
+ args: [tokenURI, maxSupply],
94
+ });
95
+
96
+ let royaltyConfig = null;
97
+ if (royaltyBPS > 0 && royaltyRecipient != AddressZero) {
98
+ royaltyConfig = encodeFunctionData({
99
+ abi: zoraCreator1155ImplABI,
100
+ functionName: "updateRoyaltiesForToken",
101
+ args: [
102
+ nextTokenId,
103
+ {
104
+ royaltyBPS,
105
+ royaltyRecipient,
106
+ royaltyMintSchedule: autoSupplyInterval,
107
+ },
108
+ ],
109
+ });
110
+ }
111
+
112
+ const contractCalls = [
113
+ verifyTokenIdExpected,
114
+ setupNewToken,
115
+ royaltyConfig,
116
+ ].filter((item) => item !== null) as `0x${string}`[];
117
+
118
+ if (typeof price !== "undefined") {
119
+ const fixedPriceApproval = encodeFunctionData({
120
+ abi: zoraCreator1155ImplABI,
121
+ functionName: "addPermission",
122
+ args: [
123
+ nextTokenId,
124
+ fixedPriceStrategyAddress,
125
+ 2n ** 2n, // PERMISSION_BIT_MINTER
126
+ ],
127
+ });
128
+
129
+ const saleData = encodeFunctionData({
130
+ abi: zoraCreatorFixedPriceSaleStrategyABI,
131
+ functionName: "setSale",
132
+ args: [
133
+ nextTokenId,
134
+ {
135
+ pricePerToken: price,
136
+ saleStart: saleStart || 0n,
137
+ saleEnd: saleEnd || 0n,
138
+ maxTokensPerAddress: mintLimit || 0n,
139
+ fundsRecipient: AddressZero,
140
+ },
141
+ ],
142
+ });
143
+
144
+ const callSale = encodeFunctionData({
145
+ abi: zoraCreator1155ImplABI,
146
+ functionName: "callSale",
147
+ args: [nextTokenId, fixedPriceStrategyAddress, saleData],
148
+ });
149
+
150
+ return [...contractCalls, fixedPriceApproval, callSale] as `0x${string}`[];
151
+ }
152
+
153
+ return contractCalls;
154
+ }
155
+
156
+ function parseCreate1155Receipt(receipt: TransactionReceipt): {
157
+ contractAddress?: `0x${string}`;
158
+ tokenId?: bigint;
159
+ } {
160
+ const parsedLog = receipt.logs
161
+ .map((log) => {
162
+ try {
163
+ return decodeEventLog({
164
+ abi: zoraCreator1155ImplABI,
165
+ ...log,
166
+ });
167
+ } catch (e) {
168
+ return null;
169
+ }
170
+ })
171
+ .filter(Boolean);
172
+
173
+ const updatedTokenEvents = parsedLog.filter(
174
+ (log) => log?.eventName === "UpdatedToken"
175
+ );
176
+ const lastUpdatedTokenEvent =
177
+ updatedTokenEvents[updatedTokenEvents.length - 1];
178
+
179
+ let tokenId;
180
+ let contractAddress;
181
+
182
+ // @ts-ignore
183
+ if (lastUpdatedTokenEvent?.args?.tokenId) {
184
+ // @ts-ignore
185
+ tokenId = lastUpdatedTokenEvent?.args?.tokenId as bigint;
186
+ }
187
+
188
+ // @ts-ignore
189
+ if (receipt.logs?.[0].address) {
190
+ contractAddress = receipt.logs?.[0].address as `0x${string}`;
191
+ }
192
+
193
+ return { tokenId, contractAddress };
194
+ }
195
+
196
+ describe("Zora1155", () => {
197
+ it(
198
+ "can batch publish tokens",
199
+ async () => {
200
+ const fixedPriceMinterAddress = await publicClient.readContract({
201
+ abi: zoraCreator1155FactoryImplConfig.abi,
202
+ address: factoryProxyAddress,
203
+ functionName: "fixedPriceMinter",
204
+ });
205
+
206
+ const contractAdmin = creatorAccount;
207
+ const contractUri = "ipfs://contracturl";
208
+ const contractName = "my contract";
209
+
210
+ // setup token creation parameters, assuming that
211
+ // they have auto incrementing ids
212
+ const createToken1Params: CreateTokenParams = {
213
+ maxSupply: 100n,
214
+ mintLimit: 100n,
215
+ nextTokenId: 1n,
216
+ tokenURI: "ipfs://token1",
217
+ fixedPriceStrategyAddress: fixedPriceMinterAddress,
218
+ autoSupplyInterval: 10,
219
+ price: parseEther("0.05"),
220
+ royaltyBPS: 10,
221
+ royaltyRecipient: creatorAccount,
222
+ saleStart: 0n,
223
+ saleEnd: 10000000000000n,
224
+ };
225
+
226
+ const createToken2Params: CreateTokenParams = {
227
+ ...createToken1Params,
228
+ tokenURI: "ipfs://token2",
229
+ nextTokenId: 2n,
230
+ };
231
+
232
+ const createToken3Params: CreateTokenParams = {
233
+ ...createToken1Params,
234
+ tokenURI: "ipfs://token3",
235
+ nextTokenId: 3n,
236
+ price: parseEther("0.0001"),
237
+ };
238
+
239
+ // build setup actions to create tokens when contract is created
240
+ const setupActions = [
241
+ ...constructCreate1155Calls(createToken1Params),
242
+ ...constructCreate1155Calls(createToken2Params),
243
+ ...constructCreate1155Calls(createToken3Params),
244
+ ];
245
+
246
+ // have the factory create the contract
247
+ const createContractCall = await walletClient.writeContract({
248
+ abi: zoraCreator1155FactoryImplConfig.abi,
249
+ address: zoraCreator1155FactoryImplConfig.address[zora.id],
250
+ functionName: "createContract",
251
+ args: [
252
+ contractUri,
253
+ contractName,
254
+ {
255
+ royaltyBPS: 10,
256
+ royaltyMintSchedule: 5,
257
+ royaltyRecipient: creatorAccount,
258
+ },
259
+ contractAdmin,
260
+ setupActions,
261
+ ],
262
+ account: creatorAccount,
263
+ });
264
+
265
+ const receipt = await publicClient.waitForTransactionReceipt({
266
+ hash: createContractCall,
267
+ });
268
+
269
+ expect(receipt.status).toBe("success");
270
+
271
+ // parse the receipt to get the contract address and last token id
272
+ const { contractAddress, tokenId: lastTokenId } =
273
+ parseCreate1155Receipt(receipt);
274
+
275
+ // now try to mint a token
276
+ const quantityToMint = 2n;
277
+
278
+ const encodedParams = encodeAbiParameters(
279
+ [{ type: "address", name: "address" }],
280
+ [collectorAccount]
281
+ );
282
+
283
+ const zoraMintFee = parseEther("0.000777");
284
+
285
+ const valueToSend =
286
+ (BigInt(zoraMintFee) + createToken3Params.price) * quantityToMint;
287
+
288
+ // make sure the collector has enough balance
289
+ await testClient.setBalance({
290
+ address: collectorAccount,
291
+ value: parseEther("100"),
292
+ });
293
+
294
+ const mintCall = await walletClient.writeContract({
295
+ abi: zoraCreator1155ImplABI,
296
+ address: contractAddress!,
297
+ functionName: "mint",
298
+ account: collectorAccount,
299
+ args: [
300
+ fixedPriceMinterAddress,
301
+ lastTokenId!,
302
+ quantityToMint,
303
+ encodedParams,
304
+ ],
305
+ value: valueToSend,
306
+ });
307
+
308
+ expect(
309
+ (await publicClient.waitForTransactionReceipt({ hash: mintCall }))
310
+ .status
311
+ ).toBe("success");
312
+
313
+ // check balance of token
314
+ const tokenBalance = await publicClient.readContract({
315
+ abi: zoraCreator1155ImplABI,
316
+ address: contractAddress!,
317
+ functionName: "balanceOf",
318
+ args: [collectorAccount, lastTokenId!],
319
+ });
320
+
321
+ expect(tokenBalance).toBe(quantityToMint);
322
+ },
323
+ // 10 second timeout
324
+ 10 * 1000
325
+ );
326
+ });
@@ -0,0 +1,60 @@
1
+ export const chainConfigs = {
2
+ [1]: {
3
+ FACTORY_OWNER: "0xDB392f4391462d60B8B4413ef72018Ab595Af9D0",
4
+ MINT_FEE_RECIPIENT: "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0",
5
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
6
+ },
7
+ [10]: {
8
+ FACTORY_OWNER: "0x4c7f7b6067fac9a737ecf2ca1a733fc85dd65a2b",
9
+ MINT_FEE_RECIPIENT: "0x7A810DCd0f8d83B20212326813Db6EF7E9FD030c",
10
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
11
+ },
12
+ [11155111]: {
13
+ FACTORY_OWNER: "0xE51051a204afb2fC071A2406914cdEA5638e5018",
14
+ MINT_FEE_RECIPIENT: "0xE51051a204afb2fC071A2406914cdEA5638e5018",
15
+ },
16
+ [420]: {
17
+ FACTORY_OWNER: "0xbb45052B2260707655Dfd916a416264f5981192c",
18
+ MINT_FEE_RECIPIENT: "0x5dEe21327CD7CD6725C2578DA1c3E5bb2D2D34b2",
19
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
20
+ },
21
+ [424]: {
22
+ FACTORY_OWNER: "0x8fbC66d36cceB3Ad69B4d672756da54CcFec1cD2",
23
+ MINT_FEE_RECIPIENT: "0x95FD5d77B206cCc0B1f7D7A4077fbE8eb4fC31eF",
24
+ PROTOCOL_REWARDS: "0x7777777A456fF23D9b6851184472c08FBDa73e32",
25
+ },
26
+ [5]: {
27
+ FACTORY_OWNER: "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0",
28
+ MINT_FEE_RECIPIENT: "0x9444390c01Dd5b7249E53FAc31290F7dFF53450D",
29
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
30
+ },
31
+ [58008]: {
32
+ FACTORY_OWNER: "0xfAe426B462f4Bc9857ED28D8473Fb85192f23E9b",
33
+ MINT_FEE_RECIPIENT: "0x917D86f1eBD1d9f59Dae1C00e5Af7f8689299EC4",
34
+ },
35
+ [7777777]: {
36
+ FACTORY_OWNER: "0xdEA20c96253dc2d64897D2b8d27A8d935dE74955",
37
+ MINT_FEE_RECIPIENT: "0xEcfc2ee50409E459c554a2b0376F882Ce916D853",
38
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
39
+ },
40
+ [8453]: {
41
+ FACTORY_OWNER: "0x004d6611884B4A661749B64b2ADc78505c3e1AB3",
42
+ MINT_FEE_RECIPIENT: "0x7bf90111Ad7C22bec9E9dFf8A01A44713CC1b1B6",
43
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
44
+ },
45
+ [84531]: {
46
+ FACTORY_OWNER: "0x02539E813cA450C2c7334e885423f4A899a063Fe",
47
+ MINT_FEE_RECIPIENT: "0x02539E813cA450C2c7334e885423f4A899a063Fe",
48
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
49
+ },
50
+ [999]: {
51
+ FACTORY_OWNER: "0xE84DBB2B25F761751231a9D0DAfbdD4dC3aa8252",
52
+ MINT_FEE_RECIPIENT: "0xE84DBB2B25F761751231a9D0DAfbdD4dC3aa8252",
53
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
54
+ },
55
+ [999999999]: {
56
+ FACTORY_OWNER: "0xdae22ce69Afcb7f4bc37D32E267645722949DE0E",
57
+ MINT_FEE_RECIPIENT: "0xdae22ce69Afcb7f4bc37D32E267645722949DE0E",
58
+ PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B",
59
+ },
60
+ };
@@ -0,0 +1,94 @@
1
+ import { Address, LocalAccount, Hex } from "viem";
2
+
3
+ export type ConfiguredSalt = `0x${string}`;
4
+ // Load environment variables from `.env.local`
5
+ export type DeterministicDeploymentConfig = {
6
+ proxyDeployerAddress: Address;
7
+ proxyShimSalt: ConfiguredSalt;
8
+ proxySalt: ConfiguredSalt;
9
+ proxyCreationCode: Hex;
10
+ };
11
+
12
+ export type GenericDeploymentConfiguration = {
13
+ creationCode: Hex;
14
+ salt: Hex;
15
+ deployerAddress: Address;
16
+ upgradeGateAddress: Address;
17
+ proxyDeployerAddress: Address;
18
+ };
19
+
20
+ export type DeployedContracts = {
21
+ factoryImplAddress: Address;
22
+ };
23
+
24
+ export const signDeployFactory = ({
25
+ account,
26
+ deterministicDeploymentConfig: config,
27
+ implementationAddress,
28
+ owner,
29
+ chainId,
30
+ }: {
31
+ account: LocalAccount;
32
+ deterministicDeploymentConfig: DeterministicDeploymentConfig;
33
+ implementationAddress: Address;
34
+ owner: Address;
35
+ chainId: number;
36
+ }) =>
37
+ account.signTypedData({
38
+ types: {
39
+ createProxy: [
40
+ { name: "proxyShimSalt", type: "bytes32" },
41
+ { name: "proxySalt", type: "bytes32" },
42
+ { name: "proxyCreationCode", type: "bytes" },
43
+ { name: "implementationAddress", type: "address" },
44
+ { name: "owner", type: "address" },
45
+ ],
46
+ },
47
+ message: {
48
+ proxyShimSalt: config.proxyShimSalt,
49
+ implementationAddress,
50
+ proxyCreationCode: config.proxyCreationCode,
51
+ proxySalt: config.proxySalt,
52
+ owner: owner,
53
+ },
54
+ primaryType: "createProxy",
55
+ domain: {
56
+ chainId,
57
+ name: "DeterministicProxyDeployer",
58
+ version: "1",
59
+ verifyingContract: config.proxyDeployerAddress,
60
+ },
61
+ });
62
+
63
+ export const signGenericDeploy = ({
64
+ account,
65
+ config,
66
+ chainId,
67
+ initCall,
68
+ }: {
69
+ account: LocalAccount;
70
+ config: GenericDeploymentConfiguration;
71
+ initCall: Hex;
72
+ chainId: number;
73
+ }) =>
74
+ account.signTypedData({
75
+ types: {
76
+ createGenericContract: [
77
+ { name: "salt", type: "bytes32" },
78
+ { name: "creationCode", type: "bytes" },
79
+ { name: "initCall", type: "bytes" },
80
+ ],
81
+ },
82
+ message: {
83
+ salt: config.salt,
84
+ creationCode: config.creationCode,
85
+ initCall,
86
+ },
87
+ primaryType: "createGenericContract",
88
+ domain: {
89
+ chainId,
90
+ name: "DeterministicProxyDeployer",
91
+ version: "1",
92
+ verifyingContract: config.proxyDeployerAddress,
93
+ },
94
+ });
@@ -0,0 +1,5 @@
1
+ // the below files are auto-generated and will be
2
+ // built at build time. They are not checked in to git.
3
+ // The can be generated by running `yarn prepack` in the root
4
+ export * from "./wagmiGenerated";
5
+ export { chainConfigs } from "./chainConfigs";