@zoralabs/coins 0.4.0 → 0.5.1-sdkalpha.0

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 (50) hide show
  1. package/.env.example +7 -0
  2. package/.turbo/turbo-build.log +93 -74
  3. package/CHANGELOG.md +12 -0
  4. package/README.md +29 -0
  5. package/abis/Coin.json +10 -0
  6. package/abis/CoinTest.json +55 -0
  7. package/abis/Create2.json +28 -0
  8. package/abis/DeployScript.json +9 -0
  9. package/abis/DeterministicDeployerAndCaller.json +315 -0
  10. package/abis/DeterministicUUPSProxyDeployer.json +167 -0
  11. package/abis/FactoryTest.json +20 -0
  12. package/abis/GenerateDeterministicParams.json +9 -0
  13. package/abis/ICoin.json +10 -0
  14. package/abis/IImmutableCreate2Factory.json +93 -0
  15. package/abis/ISafe.json +15 -0
  16. package/abis/ISymbol.json +15 -0
  17. package/abis/ImmutableCreate2FactoryUtils.json +15 -0
  18. package/abis/LibString.json +7 -0
  19. package/abis/ProxyShim.json +112 -0
  20. package/abis/ZoraFactory.json +0 -5
  21. package/addresses/8453.json +5 -8
  22. package/addresses/84532.json +5 -8
  23. package/deterministicConfig/deployerAndCaller.json +5 -0
  24. package/deterministicConfig/zoraFactory.json +8 -0
  25. package/dist/index.cjs +100 -4
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.js +96 -3
  28. package/dist/index.js.map +1 -1
  29. package/dist/wagmiGenerated.d.ts +475 -0
  30. package/dist/wagmiGenerated.d.ts.map +1 -1
  31. package/foundry.toml +14 -0
  32. package/integration/.env +2 -0
  33. package/lcov.info +634 -0
  34. package/package/wagmiGenerated.ts +111 -2
  35. package/package.json +4 -3
  36. package/remappings.txt +2 -1
  37. package/script/CoinsDeployerBase.sol +98 -0
  38. package/script/Deploy.s.sol +14 -5
  39. package/script/GenerateDeterministicParams.s.sol +43 -0
  40. package/src/Coin.sol +25 -7
  41. package/src/ZoraFactoryImpl.sol +2 -2
  42. package/src/interfaces/ICoin.sol +8 -2
  43. package/src/proxy/ZoraFactory.sol +7 -1
  44. package/src/version/ContractVersionBase.sol +1 -1
  45. package/test/Coin.t.sol +152 -4
  46. package/test/Factory.t.sol +33 -0
  47. package/test/utils/BaseTest.sol +4 -4
  48. package/wagmi.config.ts +7 -1
  49. package/abis/Deploy.json +0 -29
  50. package/addresses/1.json +0 -4
@@ -0,0 +1,315 @@
1
+ [
2
+ {
3
+ "type": "constructor",
4
+ "inputs": [],
5
+ "stateMutability": "nonpayable"
6
+ },
7
+ {
8
+ "type": "function",
9
+ "name": "eip712Domain",
10
+ "inputs": [],
11
+ "outputs": [
12
+ {
13
+ "name": "fields",
14
+ "type": "bytes1",
15
+ "internalType": "bytes1"
16
+ },
17
+ {
18
+ "name": "name",
19
+ "type": "string",
20
+ "internalType": "string"
21
+ },
22
+ {
23
+ "name": "version",
24
+ "type": "string",
25
+ "internalType": "string"
26
+ },
27
+ {
28
+ "name": "chainId",
29
+ "type": "uint256",
30
+ "internalType": "uint256"
31
+ },
32
+ {
33
+ "name": "verifyingContract",
34
+ "type": "address",
35
+ "internalType": "address"
36
+ },
37
+ {
38
+ "name": "salt",
39
+ "type": "bytes32",
40
+ "internalType": "bytes32"
41
+ },
42
+ {
43
+ "name": "extensions",
44
+ "type": "uint256[]",
45
+ "internalType": "uint256[]"
46
+ }
47
+ ],
48
+ "stateMutability": "view"
49
+ },
50
+ {
51
+ "type": "function",
52
+ "name": "hashDigest",
53
+ "inputs": [
54
+ {
55
+ "name": "salt",
56
+ "type": "bytes32",
57
+ "internalType": "bytes32"
58
+ },
59
+ {
60
+ "name": "code",
61
+ "type": "bytes",
62
+ "internalType": "bytes"
63
+ },
64
+ {
65
+ "name": "postCreateCall",
66
+ "type": "bytes",
67
+ "internalType": "bytes"
68
+ }
69
+ ],
70
+ "outputs": [
71
+ {
72
+ "name": "",
73
+ "type": "bytes32",
74
+ "internalType": "bytes32"
75
+ }
76
+ ],
77
+ "stateMutability": "view"
78
+ },
79
+ {
80
+ "type": "function",
81
+ "name": "permitSafeCreate2AndCall",
82
+ "inputs": [
83
+ {
84
+ "name": "signature",
85
+ "type": "bytes",
86
+ "internalType": "bytes"
87
+ },
88
+ {
89
+ "name": "salt",
90
+ "type": "bytes32",
91
+ "internalType": "bytes32"
92
+ },
93
+ {
94
+ "name": "code",
95
+ "type": "bytes",
96
+ "internalType": "bytes"
97
+ },
98
+ {
99
+ "name": "postCreateCall",
100
+ "type": "bytes",
101
+ "internalType": "bytes"
102
+ },
103
+ {
104
+ "name": "_expectedAddress",
105
+ "type": "address",
106
+ "internalType": "address"
107
+ }
108
+ ],
109
+ "outputs": [
110
+ {
111
+ "name": "",
112
+ "type": "address",
113
+ "internalType": "address"
114
+ }
115
+ ],
116
+ "stateMutability": "payable"
117
+ },
118
+ {
119
+ "type": "function",
120
+ "name": "proxyConstructorArgs",
121
+ "inputs": [],
122
+ "outputs": [
123
+ {
124
+ "name": "",
125
+ "type": "bytes",
126
+ "internalType": "bytes"
127
+ }
128
+ ],
129
+ "stateMutability": "view"
130
+ },
131
+ {
132
+ "type": "function",
133
+ "name": "proxyCreationCode",
134
+ "inputs": [
135
+ {
136
+ "name": "proxyCode",
137
+ "type": "bytes",
138
+ "internalType": "bytes"
139
+ }
140
+ ],
141
+ "outputs": [
142
+ {
143
+ "name": "",
144
+ "type": "bytes",
145
+ "internalType": "bytes"
146
+ }
147
+ ],
148
+ "stateMutability": "view"
149
+ },
150
+ {
151
+ "type": "function",
152
+ "name": "proxyShim",
153
+ "inputs": [],
154
+ "outputs": [
155
+ {
156
+ "name": "",
157
+ "type": "address",
158
+ "internalType": "contract ProxyShim"
159
+ }
160
+ ],
161
+ "stateMutability": "view"
162
+ },
163
+ {
164
+ "type": "function",
165
+ "name": "safeCreate2AndCall",
166
+ "inputs": [
167
+ {
168
+ "name": "salt",
169
+ "type": "bytes32",
170
+ "internalType": "bytes32"
171
+ },
172
+ {
173
+ "name": "code",
174
+ "type": "bytes",
175
+ "internalType": "bytes"
176
+ },
177
+ {
178
+ "name": "postCreateCall",
179
+ "type": "bytes",
180
+ "internalType": "bytes"
181
+ },
182
+ {
183
+ "name": "_expectedAddress",
184
+ "type": "address",
185
+ "internalType": "address"
186
+ }
187
+ ],
188
+ "outputs": [
189
+ {
190
+ "name": "",
191
+ "type": "address",
192
+ "internalType": "address"
193
+ }
194
+ ],
195
+ "stateMutability": "payable"
196
+ },
197
+ {
198
+ "type": "event",
199
+ "name": "EIP712DomainChanged",
200
+ "inputs": [],
201
+ "anonymous": false
202
+ },
203
+ {
204
+ "type": "error",
205
+ "name": "CallFailed",
206
+ "inputs": [
207
+ {
208
+ "name": "returnData",
209
+ "type": "bytes",
210
+ "internalType": "bytes"
211
+ }
212
+ ]
213
+ },
214
+ {
215
+ "type": "error",
216
+ "name": "Create2EmptyBytecode",
217
+ "inputs": []
218
+ },
219
+ {
220
+ "type": "error",
221
+ "name": "Create2FailedDeployment",
222
+ "inputs": []
223
+ },
224
+ {
225
+ "type": "error",
226
+ "name": "Create2InsufficientBalance",
227
+ "inputs": [
228
+ {
229
+ "name": "balance",
230
+ "type": "uint256",
231
+ "internalType": "uint256"
232
+ },
233
+ {
234
+ "name": "needed",
235
+ "type": "uint256",
236
+ "internalType": "uint256"
237
+ }
238
+ ]
239
+ },
240
+ {
241
+ "type": "error",
242
+ "name": "ECDSAInvalidSignature",
243
+ "inputs": []
244
+ },
245
+ {
246
+ "type": "error",
247
+ "name": "ECDSAInvalidSignatureLength",
248
+ "inputs": [
249
+ {
250
+ "name": "length",
251
+ "type": "uint256",
252
+ "internalType": "uint256"
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ "type": "error",
258
+ "name": "ECDSAInvalidSignatureS",
259
+ "inputs": [
260
+ {
261
+ "name": "s",
262
+ "type": "bytes32",
263
+ "internalType": "bytes32"
264
+ }
265
+ ]
266
+ },
267
+ {
268
+ "type": "error",
269
+ "name": "FactoryProxyAddressMismatch",
270
+ "inputs": [
271
+ {
272
+ "name": "expected",
273
+ "type": "address",
274
+ "internalType": "address"
275
+ },
276
+ {
277
+ "name": "actual",
278
+ "type": "address",
279
+ "internalType": "address"
280
+ }
281
+ ]
282
+ },
283
+ {
284
+ "type": "error",
285
+ "name": "InvalidSalt",
286
+ "inputs": [
287
+ {
288
+ "name": "signer",
289
+ "type": "address",
290
+ "internalType": "address"
291
+ },
292
+ {
293
+ "name": "salt",
294
+ "type": "bytes32",
295
+ "internalType": "bytes32"
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ "type": "error",
301
+ "name": "InvalidShortString",
302
+ "inputs": []
303
+ },
304
+ {
305
+ "type": "error",
306
+ "name": "StringTooLong",
307
+ "inputs": [
308
+ {
309
+ "name": "str",
310
+ "type": "string",
311
+ "internalType": "string"
312
+ }
313
+ ]
314
+ }
315
+ ]
@@ -0,0 +1,167 @@
1
+ [
2
+ {
3
+ "type": "constructor",
4
+ "inputs": [],
5
+ "stateMutability": "nonpayable"
6
+ },
7
+ {
8
+ "type": "function",
9
+ "name": "expectedProxyAddress",
10
+ "inputs": [
11
+ {
12
+ "name": "proxySalt",
13
+ "type": "bytes32",
14
+ "internalType": "bytes32"
15
+ },
16
+ {
17
+ "name": "proxyCode",
18
+ "type": "bytes",
19
+ "internalType": "bytes"
20
+ }
21
+ ],
22
+ "outputs": [
23
+ {
24
+ "name": "",
25
+ "type": "address",
26
+ "internalType": "address"
27
+ }
28
+ ],
29
+ "stateMutability": "view"
30
+ },
31
+ {
32
+ "type": "function",
33
+ "name": "proxyConstructorArgs",
34
+ "inputs": [],
35
+ "outputs": [
36
+ {
37
+ "name": "",
38
+ "type": "bytes",
39
+ "internalType": "bytes"
40
+ }
41
+ ],
42
+ "stateMutability": "view"
43
+ },
44
+ {
45
+ "type": "function",
46
+ "name": "proxyCreationCode",
47
+ "inputs": [
48
+ {
49
+ "name": "transparentProxyCode",
50
+ "type": "bytes",
51
+ "internalType": "bytes"
52
+ }
53
+ ],
54
+ "outputs": [
55
+ {
56
+ "name": "",
57
+ "type": "bytes",
58
+ "internalType": "bytes"
59
+ }
60
+ ],
61
+ "stateMutability": "view"
62
+ },
63
+ {
64
+ "type": "function",
65
+ "name": "proxyShimAddress",
66
+ "inputs": [],
67
+ "outputs": [
68
+ {
69
+ "name": "",
70
+ "type": "address",
71
+ "internalType": "address"
72
+ }
73
+ ],
74
+ "stateMutability": "view"
75
+ },
76
+ {
77
+ "type": "function",
78
+ "name": "safeCreate2AndUpgradeToAndCall",
79
+ "inputs": [
80
+ {
81
+ "name": "proxySalt",
82
+ "type": "bytes32",
83
+ "internalType": "bytes32"
84
+ },
85
+ {
86
+ "name": "proxyCode",
87
+ "type": "bytes",
88
+ "internalType": "bytes"
89
+ },
90
+ {
91
+ "name": "initialImplementation",
92
+ "type": "address",
93
+ "internalType": "address"
94
+ },
95
+ {
96
+ "name": "postUpgradeCall",
97
+ "type": "bytes",
98
+ "internalType": "bytes"
99
+ },
100
+ {
101
+ "name": "_expectedAddress",
102
+ "type": "address",
103
+ "internalType": "address"
104
+ }
105
+ ],
106
+ "outputs": [],
107
+ "stateMutability": "payable"
108
+ },
109
+ {
110
+ "type": "error",
111
+ "name": "Create2EmptyBytecode",
112
+ "inputs": []
113
+ },
114
+ {
115
+ "type": "error",
116
+ "name": "Create2FailedDeployment",
117
+ "inputs": []
118
+ },
119
+ {
120
+ "type": "error",
121
+ "name": "Create2InsufficientBalance",
122
+ "inputs": [
123
+ {
124
+ "name": "balance",
125
+ "type": "uint256",
126
+ "internalType": "uint256"
127
+ },
128
+ {
129
+ "name": "needed",
130
+ "type": "uint256",
131
+ "internalType": "uint256"
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ "type": "error",
137
+ "name": "FactoryProxyAddressMismatch",
138
+ "inputs": [
139
+ {
140
+ "name": "expected",
141
+ "type": "address",
142
+ "internalType": "address"
143
+ },
144
+ {
145
+ "name": "actual",
146
+ "type": "address",
147
+ "internalType": "address"
148
+ }
149
+ ]
150
+ },
151
+ {
152
+ "type": "error",
153
+ "name": "InvalidSalt",
154
+ "inputs": [
155
+ {
156
+ "name": "signer",
157
+ "type": "address",
158
+ "internalType": "address"
159
+ },
160
+ {
161
+ "name": "salt",
162
+ "type": "bytes32",
163
+ "internalType": "bytes32"
164
+ }
165
+ ]
166
+ }
167
+ ]
@@ -370,6 +370,19 @@
370
370
  "outputs": [],
371
371
  "stateMutability": "nonpayable"
372
372
  },
373
+ {
374
+ "type": "function",
375
+ "name": "test_deploy_with_weth",
376
+ "inputs": [
377
+ {
378
+ "name": "initialOrderSize",
379
+ "type": "uint256",
380
+ "internalType": "uint256"
381
+ }
382
+ ],
383
+ "outputs": [],
384
+ "stateMutability": "nonpayable"
385
+ },
373
386
  {
374
387
  "type": "function",
375
388
  "name": "test_deploy_without_initial_order",
@@ -377,6 +390,13 @@
377
390
  "outputs": [],
378
391
  "stateMutability": "nonpayable"
379
392
  },
393
+ {
394
+ "type": "function",
395
+ "name": "test_implementation_address",
396
+ "inputs": [],
397
+ "outputs": [],
398
+ "stateMutability": "nonpayable"
399
+ },
380
400
  {
381
401
  "type": "function",
382
402
  "name": "test_revert_deploy_with_invalid_currency_tick",
@@ -0,0 +1,9 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "run",
5
+ "inputs": [],
6
+ "outputs": [],
7
+ "stateMutability": "nonpayable"
8
+ }
9
+ ]
package/abis/ICoin.json CHANGED
@@ -43,6 +43,11 @@
43
43
  }
44
44
  ],
45
45
  "outputs": [
46
+ {
47
+ "name": "",
48
+ "type": "uint256",
49
+ "internalType": "uint256"
50
+ },
46
51
  {
47
52
  "name": "",
48
53
  "type": "uint256",
@@ -142,6 +147,11 @@
142
147
  }
143
148
  ],
144
149
  "outputs": [
150
+ {
151
+ "name": "",
152
+ "type": "uint256",
153
+ "internalType": "uint256"
154
+ },
145
155
  {
146
156
  "name": "",
147
157
  "type": "uint256",
@@ -0,0 +1,93 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "findCreate2Address",
5
+ "inputs": [
6
+ {
7
+ "name": "salt",
8
+ "type": "bytes32",
9
+ "internalType": "bytes32"
10
+ },
11
+ {
12
+ "name": "initCode",
13
+ "type": "bytes",
14
+ "internalType": "bytes"
15
+ }
16
+ ],
17
+ "outputs": [
18
+ {
19
+ "name": "deploymentAddress",
20
+ "type": "address",
21
+ "internalType": "address"
22
+ }
23
+ ],
24
+ "stateMutability": "view"
25
+ },
26
+ {
27
+ "type": "function",
28
+ "name": "findCreate2AddressViaHash",
29
+ "inputs": [
30
+ {
31
+ "name": "salt",
32
+ "type": "bytes32",
33
+ "internalType": "bytes32"
34
+ },
35
+ {
36
+ "name": "initCodeHash",
37
+ "type": "bytes32",
38
+ "internalType": "bytes32"
39
+ }
40
+ ],
41
+ "outputs": [
42
+ {
43
+ "name": "deploymentAddress",
44
+ "type": "address",
45
+ "internalType": "address"
46
+ }
47
+ ],
48
+ "stateMutability": "view"
49
+ },
50
+ {
51
+ "type": "function",
52
+ "name": "hasBeenDeployed",
53
+ "inputs": [
54
+ {
55
+ "name": "deploymentAddress",
56
+ "type": "address",
57
+ "internalType": "address"
58
+ }
59
+ ],
60
+ "outputs": [
61
+ {
62
+ "name": "",
63
+ "type": "bool",
64
+ "internalType": "bool"
65
+ }
66
+ ],
67
+ "stateMutability": "view"
68
+ },
69
+ {
70
+ "type": "function",
71
+ "name": "safeCreate2",
72
+ "inputs": [
73
+ {
74
+ "name": "salt",
75
+ "type": "bytes32",
76
+ "internalType": "bytes32"
77
+ },
78
+ {
79
+ "name": "initializationCode",
80
+ "type": "bytes",
81
+ "internalType": "bytes"
82
+ }
83
+ ],
84
+ "outputs": [
85
+ {
86
+ "name": "deploymentAddress",
87
+ "type": "address",
88
+ "internalType": "address"
89
+ }
90
+ ],
91
+ "stateMutability": "payable"
92
+ }
93
+ ]
@@ -0,0 +1,15 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "getOwners",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "address[]",
10
+ "internalType": "address[]"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ }
15
+ ]
@@ -0,0 +1,15 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "symbol",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "string",
10
+ "internalType": "string"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ }
15
+ ]
@@ -0,0 +1,15 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "IMMUTABLE_CREATE2_FACTORY",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "IImmutableCreate2Factory",
10
+ "internalType": "contract IImmutableCreate2Factory"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ }
15
+ ]
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "HexLengthInsufficient",
5
+ "inputs": []
6
+ }
7
+ ]