@zoralabs/coins 1.1.2 → 2.1.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 (78) hide show
  1. package/.turbo/turbo-build.log +107 -110
  2. package/CHANGELOG.md +50 -0
  3. package/README.md +48 -1
  4. package/abis/BaseCoin.json +442 -0
  5. package/abis/BaseZoraV4CoinHook.json +6 -2
  6. package/abis/CoinTest.json +3 -246
  7. package/abis/CoinUniV4Test.json +20 -0
  8. package/abis/ContentCoinHook.json +6 -2
  9. package/abis/CreatorCoinHook.json +6 -2
  10. package/abis/FactoryTest.json +8 -133
  11. package/abis/FeeEstimatorHook.json +6 -2
  12. package/abis/HooksTest.json +0 -26
  13. package/abis/ICoin.json +378 -0
  14. package/abis/ICoinV3.json +378 -0
  15. package/abis/IZoraFactory.json +0 -18
  16. package/abis/IZoraV4CoinHook.json +2 -2
  17. package/abis/LiquidityMigrationTest.json +101 -0
  18. package/abis/MockBadFactory.json +15 -0
  19. package/abis/Ownable2StepUpgradeable.json +138 -0
  20. package/abis/ZoraFactoryImpl.json +38 -65
  21. package/addresses/8453.json +5 -5
  22. package/dist/index.cjs +272 -268
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.js +270 -266
  25. package/dist/index.js.map +1 -1
  26. package/dist/wagmiGenerated.d.ts +397 -470
  27. package/dist/wagmiGenerated.d.ts.map +1 -1
  28. package/package/wagmiGenerated.ts +275 -271
  29. package/package.json +3 -3
  30. package/script/DeployPostDeploymentHooks.s.sol +2 -2
  31. package/script/TestBackingCoinSwap.s.sol +9 -9
  32. package/script/TestV4Swap.s.sol +9 -9
  33. package/script/UpgradeFactoryImpl.s.sol +0 -1
  34. package/src/BaseCoin.sol +109 -6
  35. package/src/ContentCoin.sol +45 -0
  36. package/src/CreatorCoin.sol +7 -5
  37. package/src/ZoraFactoryImpl.sol +12 -95
  38. package/src/deployment/CoinsDeployerBase.sol +13 -30
  39. package/src/hooks/BaseZoraV4CoinHook.sol +8 -6
  40. package/src/hooks/deployment/BuySupplyWithSwapRouterHook.sol +4 -5
  41. package/src/interfaces/ICoin.sol +67 -1
  42. package/src/interfaces/ICreatorCoin.sol +2 -2
  43. package/src/interfaces/IZoraFactory.sol +0 -5
  44. package/src/interfaces/IZoraV4CoinHook.sol +1 -1
  45. package/src/libs/CoinConfigurationVersions.sol +1 -39
  46. package/src/libs/CoinRewardsV4.sol +2 -2
  47. package/src/libs/CoinSetup.sol +1 -4
  48. package/src/libs/UniV4SwapHelper.sol +1 -1
  49. package/src/libs/UniV4SwapToCurrency.sol +2 -2
  50. package/src/libs/V4Liquidity.sol +1 -1
  51. package/src/version/ContractVersionBase.sol +1 -1
  52. package/test/Coin.t.sol +112 -535
  53. package/test/CoinUniV4.t.sol +66 -10
  54. package/test/DeploymentHooks.t.sol +5 -102
  55. package/test/Factory.t.sol +49 -291
  56. package/test/LiquidityMigration.t.sol +160 -2
  57. package/test/MultiOwnable.t.sol +36 -36
  58. package/test/Upgrades.t.sol +23 -42
  59. package/test/utils/BaseTest.sol +39 -84
  60. package/test/utils/FeeEstimatorHook.sol +3 -3
  61. package/wagmi.config.ts +2 -2
  62. package/abis/Coin.json +0 -1912
  63. package/abis/DopplerUniswapV3Test.json +0 -800
  64. package/abis/ICoinV4.json +0 -1048
  65. package/abis/Simulate.json +0 -29
  66. package/abis/UniV3BuySell.json +0 -12
  67. package/abis/UniV3Errors.json +0 -32
  68. package/script/Simulate.s.sol +0 -59
  69. package/src/Coin.sol +0 -236
  70. package/src/CoinV4.sol +0 -151
  71. package/src/interfaces/ICoinV4.sol +0 -74
  72. package/src/libs/CoinDopplerUniV3.sol +0 -50
  73. package/src/libs/CoinRewards.sol +0 -201
  74. package/src/libs/CoinSetupV3.sol +0 -50
  75. package/src/libs/UniV3BuySell.sol +0 -231
  76. package/src/libs/UniV3Errors.sol +0 -11
  77. package/test/CoinDopplerUniV3.t.sol +0 -310
  78. /package/abis/{CoinV4.json → ContentCoin.json} +0 -0
package/abis/ICoin.json CHANGED
@@ -64,6 +64,299 @@
64
64
  ],
65
65
  "stateMutability": "view"
66
66
  },
67
+ {
68
+ "type": "function",
69
+ "name": "getPayoutSwapPath",
70
+ "inputs": [
71
+ {
72
+ "name": "coinVersionLookup",
73
+ "type": "address",
74
+ "internalType": "contract IDeployedCoinVersionLookup"
75
+ }
76
+ ],
77
+ "outputs": [
78
+ {
79
+ "name": "",
80
+ "type": "tuple",
81
+ "internalType": "struct IHasSwapPath.PayoutSwapPath",
82
+ "components": [
83
+ {
84
+ "name": "path",
85
+ "type": "tuple[]",
86
+ "internalType": "struct PathKey[]",
87
+ "components": [
88
+ {
89
+ "name": "intermediateCurrency",
90
+ "type": "address",
91
+ "internalType": "Currency"
92
+ },
93
+ {
94
+ "name": "fee",
95
+ "type": "uint24",
96
+ "internalType": "uint24"
97
+ },
98
+ {
99
+ "name": "tickSpacing",
100
+ "type": "int24",
101
+ "internalType": "int24"
102
+ },
103
+ {
104
+ "name": "hooks",
105
+ "type": "address",
106
+ "internalType": "contract IHooks"
107
+ },
108
+ {
109
+ "name": "hookData",
110
+ "type": "bytes",
111
+ "internalType": "bytes"
112
+ }
113
+ ]
114
+ },
115
+ {
116
+ "name": "currencyIn",
117
+ "type": "address",
118
+ "internalType": "Currency"
119
+ }
120
+ ]
121
+ }
122
+ ],
123
+ "stateMutability": "view"
124
+ },
125
+ {
126
+ "type": "function",
127
+ "name": "getPoolConfiguration",
128
+ "inputs": [],
129
+ "outputs": [
130
+ {
131
+ "name": "",
132
+ "type": "tuple",
133
+ "internalType": "struct PoolConfiguration",
134
+ "components": [
135
+ {
136
+ "name": "version",
137
+ "type": "uint8",
138
+ "internalType": "uint8"
139
+ },
140
+ {
141
+ "name": "numPositions",
142
+ "type": "uint16",
143
+ "internalType": "uint16"
144
+ },
145
+ {
146
+ "name": "fee",
147
+ "type": "uint24",
148
+ "internalType": "uint24"
149
+ },
150
+ {
151
+ "name": "tickSpacing",
152
+ "type": "int24",
153
+ "internalType": "int24"
154
+ },
155
+ {
156
+ "name": "numDiscoveryPositions",
157
+ "type": "uint16[]",
158
+ "internalType": "uint16[]"
159
+ },
160
+ {
161
+ "name": "tickLower",
162
+ "type": "int24[]",
163
+ "internalType": "int24[]"
164
+ },
165
+ {
166
+ "name": "tickUpper",
167
+ "type": "int24[]",
168
+ "internalType": "int24[]"
169
+ },
170
+ {
171
+ "name": "maxDiscoverySupplyShare",
172
+ "type": "uint256[]",
173
+ "internalType": "uint256[]"
174
+ }
175
+ ]
176
+ }
177
+ ],
178
+ "stateMutability": "view"
179
+ },
180
+ {
181
+ "type": "function",
182
+ "name": "getPoolKey",
183
+ "inputs": [],
184
+ "outputs": [
185
+ {
186
+ "name": "",
187
+ "type": "tuple",
188
+ "internalType": "struct PoolKey",
189
+ "components": [
190
+ {
191
+ "name": "currency0",
192
+ "type": "address",
193
+ "internalType": "Currency"
194
+ },
195
+ {
196
+ "name": "currency1",
197
+ "type": "address",
198
+ "internalType": "Currency"
199
+ },
200
+ {
201
+ "name": "fee",
202
+ "type": "uint24",
203
+ "internalType": "uint24"
204
+ },
205
+ {
206
+ "name": "tickSpacing",
207
+ "type": "int24",
208
+ "internalType": "int24"
209
+ },
210
+ {
211
+ "name": "hooks",
212
+ "type": "address",
213
+ "internalType": "contract IHooks"
214
+ }
215
+ ]
216
+ }
217
+ ],
218
+ "stateMutability": "view"
219
+ },
220
+ {
221
+ "type": "function",
222
+ "name": "hooks",
223
+ "inputs": [],
224
+ "outputs": [
225
+ {
226
+ "name": "",
227
+ "type": "address",
228
+ "internalType": "contract IHooks"
229
+ }
230
+ ],
231
+ "stateMutability": "view"
232
+ },
233
+ {
234
+ "type": "function",
235
+ "name": "initialize",
236
+ "inputs": [
237
+ {
238
+ "name": "payoutRecipient_",
239
+ "type": "address",
240
+ "internalType": "address"
241
+ },
242
+ {
243
+ "name": "owners_",
244
+ "type": "address[]",
245
+ "internalType": "address[]"
246
+ },
247
+ {
248
+ "name": "tokenURI_",
249
+ "type": "string",
250
+ "internalType": "string"
251
+ },
252
+ {
253
+ "name": "name_",
254
+ "type": "string",
255
+ "internalType": "string"
256
+ },
257
+ {
258
+ "name": "symbol_",
259
+ "type": "string",
260
+ "internalType": "string"
261
+ },
262
+ {
263
+ "name": "platformReferrer_",
264
+ "type": "address",
265
+ "internalType": "address"
266
+ },
267
+ {
268
+ "name": "currency_",
269
+ "type": "address",
270
+ "internalType": "address"
271
+ },
272
+ {
273
+ "name": "poolKey_",
274
+ "type": "tuple",
275
+ "internalType": "struct PoolKey",
276
+ "components": [
277
+ {
278
+ "name": "currency0",
279
+ "type": "address",
280
+ "internalType": "Currency"
281
+ },
282
+ {
283
+ "name": "currency1",
284
+ "type": "address",
285
+ "internalType": "Currency"
286
+ },
287
+ {
288
+ "name": "fee",
289
+ "type": "uint24",
290
+ "internalType": "uint24"
291
+ },
292
+ {
293
+ "name": "tickSpacing",
294
+ "type": "int24",
295
+ "internalType": "int24"
296
+ },
297
+ {
298
+ "name": "hooks",
299
+ "type": "address",
300
+ "internalType": "contract IHooks"
301
+ }
302
+ ]
303
+ },
304
+ {
305
+ "name": "sqrtPriceX96",
306
+ "type": "uint160",
307
+ "internalType": "uint160"
308
+ },
309
+ {
310
+ "name": "poolConfiguration_",
311
+ "type": "tuple",
312
+ "internalType": "struct PoolConfiguration",
313
+ "components": [
314
+ {
315
+ "name": "version",
316
+ "type": "uint8",
317
+ "internalType": "uint8"
318
+ },
319
+ {
320
+ "name": "numPositions",
321
+ "type": "uint16",
322
+ "internalType": "uint16"
323
+ },
324
+ {
325
+ "name": "fee",
326
+ "type": "uint24",
327
+ "internalType": "uint24"
328
+ },
329
+ {
330
+ "name": "tickSpacing",
331
+ "type": "int24",
332
+ "internalType": "int24"
333
+ },
334
+ {
335
+ "name": "numDiscoveryPositions",
336
+ "type": "uint16[]",
337
+ "internalType": "uint16[]"
338
+ },
339
+ {
340
+ "name": "tickLower",
341
+ "type": "int24[]",
342
+ "internalType": "int24[]"
343
+ },
344
+ {
345
+ "name": "tickUpper",
346
+ "type": "int24[]",
347
+ "internalType": "int24[]"
348
+ },
349
+ {
350
+ "name": "maxDiscoverySupplyShare",
351
+ "type": "uint256[]",
352
+ "internalType": "uint256[]"
353
+ }
354
+ ]
355
+ }
356
+ ],
357
+ "outputs": [],
358
+ "stateMutability": "nonpayable"
359
+ },
67
360
  {
68
361
  "type": "function",
69
362
  "name": "payoutRecipient",
@@ -484,6 +777,91 @@
484
777
  "inputs": [],
485
778
  "anonymous": false
486
779
  },
780
+ {
781
+ "type": "event",
782
+ "name": "LiquidityMigrated",
783
+ "inputs": [
784
+ {
785
+ "name": "fromPoolKey",
786
+ "type": "tuple",
787
+ "indexed": false,
788
+ "internalType": "struct PoolKey",
789
+ "components": [
790
+ {
791
+ "name": "currency0",
792
+ "type": "address",
793
+ "internalType": "Currency"
794
+ },
795
+ {
796
+ "name": "currency1",
797
+ "type": "address",
798
+ "internalType": "Currency"
799
+ },
800
+ {
801
+ "name": "fee",
802
+ "type": "uint24",
803
+ "internalType": "uint24"
804
+ },
805
+ {
806
+ "name": "tickSpacing",
807
+ "type": "int24",
808
+ "internalType": "int24"
809
+ },
810
+ {
811
+ "name": "hooks",
812
+ "type": "address",
813
+ "internalType": "contract IHooks"
814
+ }
815
+ ]
816
+ },
817
+ {
818
+ "name": "fromPoolKeyHash",
819
+ "type": "bytes32",
820
+ "indexed": false,
821
+ "internalType": "bytes32"
822
+ },
823
+ {
824
+ "name": "toPoolKey",
825
+ "type": "tuple",
826
+ "indexed": false,
827
+ "internalType": "struct PoolKey",
828
+ "components": [
829
+ {
830
+ "name": "currency0",
831
+ "type": "address",
832
+ "internalType": "Currency"
833
+ },
834
+ {
835
+ "name": "currency1",
836
+ "type": "address",
837
+ "internalType": "Currency"
838
+ },
839
+ {
840
+ "name": "fee",
841
+ "type": "uint24",
842
+ "internalType": "uint24"
843
+ },
844
+ {
845
+ "name": "tickSpacing",
846
+ "type": "int24",
847
+ "internalType": "int24"
848
+ },
849
+ {
850
+ "name": "hooks",
851
+ "type": "address",
852
+ "internalType": "contract IHooks"
853
+ }
854
+ ]
855
+ },
856
+ {
857
+ "name": "toPoolKeyHash",
858
+ "type": "bytes32",
859
+ "indexed": false,
860
+ "internalType": "bytes32"
861
+ }
862
+ ],
863
+ "anonymous": false
864
+ },
487
865
  {
488
866
  "type": "event",
489
867
  "name": "NameAndSymbolUpdated",