@zoralabs/coins 2.1.1 → 2.2.1

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 (97) hide show
  1. package/.turbo/turbo-build$colon$js.log +152 -0
  2. package/CHANGELOG.md +60 -0
  3. package/abis/BaseCoin.json +26 -0
  4. package/abis/BaseTest.json +2 -7
  5. package/abis/CoinConstants.json +0 -104
  6. package/abis/ContentCoin.json +26 -0
  7. package/abis/CreatorCoin.json +30 -4
  8. package/abis/FeeEstimatorHook.json +0 -5
  9. package/abis/ICoin.json +26 -0
  10. package/abis/ICoinV3.json +26 -0
  11. package/abis/ICreatorCoin.json +39 -0
  12. package/abis/IERC721.json +36 -36
  13. package/abis/IHasCoinType.json +15 -0
  14. package/abis/IHasTotalSupplyForPositions.json +15 -0
  15. package/abis/IZoraFactory.json +52 -0
  16. package/abis/IZoraHookRegistry.json +188 -0
  17. package/abis/VmContractHelper227.json +233 -0
  18. package/abis/ZoraFactoryImpl.json +32 -6
  19. package/abis/ZoraHookRegistry.json +375 -0
  20. package/abis/{CreatorCoinHook.json → ZoraV4CoinHook.json} +1 -1
  21. package/addresses/8453.json +2 -1
  22. package/dist/index.cjs +72 -10
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.js +72 -10
  25. package/dist/index.js.map +1 -1
  26. package/dist/wagmiGenerated.d.ts +90 -10
  27. package/dist/wagmiGenerated.d.ts.map +1 -1
  28. package/foundry.toml +4 -1
  29. package/package/wagmiGenerated.ts +72 -10
  30. package/package.json +7 -5
  31. package/script/PrintRegisterUpgradePath.s.sol +0 -7
  32. package/script/TestBackingCoinSwap.s.sol +0 -1
  33. package/script/TestV4Swap.s.sol +0 -1
  34. package/script/UpgradeFactoryImpl.s.sol +1 -1
  35. package/src/BaseCoin.sol +15 -12
  36. package/src/ContentCoin.sol +10 -0
  37. package/src/CreatorCoin.sol +28 -7
  38. package/src/ZoraFactoryImpl.sol +62 -23
  39. package/src/deployment/CoinsDeployerBase.sol +24 -58
  40. package/src/hook-registry/ZoraHookRegistry.sol +93 -0
  41. package/src/hooks/{BaseZoraV4CoinHook.sol → ZoraV4CoinHook.sol} +13 -8
  42. package/src/interfaces/ICoin.sol +19 -1
  43. package/src/interfaces/ICreatorCoin.sol +4 -0
  44. package/src/interfaces/IZoraFactory.sol +32 -10
  45. package/src/interfaces/IZoraHookRegistry.sol +47 -0
  46. package/src/libs/CoinConstants.sol +0 -32
  47. package/src/libs/CoinRewardsV4.sol +53 -15
  48. package/src/libs/CreatorCoinConstants.sol +0 -1
  49. package/src/libs/HooksDeployment.sol +13 -65
  50. package/src/libs/MarketConstants.sol +10 -12
  51. package/src/libs/V4Liquidity.sol +30 -0
  52. package/src/version/ContractVersionBase.sol +1 -1
  53. package/test/CoinUniV4.t.sol +33 -30
  54. package/test/ContentCoinRewards.t.sol +320 -0
  55. package/test/CreatorCoin.t.sol +1 -1
  56. package/test/CreatorCoinRewards.t.sol +375 -0
  57. package/test/DeploymentHooks.t.sol +10 -10
  58. package/test/Factory.t.sol +24 -7
  59. package/test/HooksDeployment.t.sol +4 -4
  60. package/test/LiquidityMigration.t.sol +4 -9
  61. package/test/Upgrades.t.sol +44 -48
  62. package/test/ZoraHookRegistry.t.sol +266 -0
  63. package/test/utils/BaseTest.sol +25 -42
  64. package/test/utils/FeeEstimatorHook.sol +4 -6
  65. package/test/utils/RewardTestHelpers.sol +106 -0
  66. package/.turbo/turbo-build.log +0 -199
  67. package/abis/AutoSwapperTest.json +0 -618
  68. package/abis/BadImpl.json +0 -15
  69. package/abis/BaseZoraV4CoinHook.json +0 -1664
  70. package/abis/CoinTest.json +0 -819
  71. package/abis/CoinUniV4Test.json +0 -1128
  72. package/abis/ContentCoinHook.json +0 -1733
  73. package/abis/CreatorCoinTest.json +0 -887
  74. package/abis/Deploy.json +0 -9
  75. package/abis/DeployHooks.json +0 -9
  76. package/abis/DeployScript.json +0 -35
  77. package/abis/DeployedCoinVersionLookupTest.json +0 -740
  78. package/abis/DifferentNamespaceVersionLookup.json +0 -39
  79. package/abis/FactoryTest.json +0 -748
  80. package/abis/FakeHookNoInterface.json +0 -21
  81. package/abis/GenerateDeterministicParams.json +0 -9
  82. package/abis/HooksDeploymentTest.json +0 -645
  83. package/abis/HooksTest.json +0 -709
  84. package/abis/InvalidLiquidityMigrationReceiver.json +0 -21
  85. package/abis/LiquidityMigrationReceiver.json +0 -103
  86. package/abis/LiquidityMigrationTest.json +0 -889
  87. package/abis/MockBadFactory.json +0 -15
  88. package/abis/MultiOwnableTest.json +0 -766
  89. package/abis/PrintUpgradeCommand.json +0 -9
  90. package/abis/TestDeployedCoinVersionLookupImplementation.json +0 -39
  91. package/abis/TestV4Swap.json +0 -9
  92. package/abis/UpgradeFactoryImpl.json +0 -9
  93. package/abis/UpgradeHooks.json +0 -35
  94. package/abis/UpgradesTest.json +0 -723
  95. package/src/hooks/ContentCoinHook.sol +0 -27
  96. package/src/hooks/CreatorCoinHook.sol +0 -27
  97. package/src/libs/CreatorCoinRewards.sol +0 -34
@@ -1,1733 +0,0 @@
1
- [
2
- {
3
- "type": "constructor",
4
- "inputs": [
5
- {
6
- "name": "poolManager_",
7
- "type": "address",
8
- "internalType": "contract IPoolManager"
9
- },
10
- {
11
- "name": "coinVersionLookup_",
12
- "type": "address",
13
- "internalType": "contract IDeployedCoinVersionLookup"
14
- },
15
- {
16
- "name": "trustedMessageSenders_",
17
- "type": "address[]",
18
- "internalType": "address[]"
19
- },
20
- {
21
- "name": "upgradeGate",
22
- "type": "address",
23
- "internalType": "contract IHooksUpgradeGate"
24
- }
25
- ],
26
- "stateMutability": "nonpayable"
27
- },
28
- {
29
- "type": "receive",
30
- "stateMutability": "payable"
31
- },
32
- {
33
- "type": "function",
34
- "name": "afterAddLiquidity",
35
- "inputs": [
36
- {
37
- "name": "sender",
38
- "type": "address",
39
- "internalType": "address"
40
- },
41
- {
42
- "name": "key",
43
- "type": "tuple",
44
- "internalType": "struct PoolKey",
45
- "components": [
46
- {
47
- "name": "currency0",
48
- "type": "address",
49
- "internalType": "Currency"
50
- },
51
- {
52
- "name": "currency1",
53
- "type": "address",
54
- "internalType": "Currency"
55
- },
56
- {
57
- "name": "fee",
58
- "type": "uint24",
59
- "internalType": "uint24"
60
- },
61
- {
62
- "name": "tickSpacing",
63
- "type": "int24",
64
- "internalType": "int24"
65
- },
66
- {
67
- "name": "hooks",
68
- "type": "address",
69
- "internalType": "contract IHooks"
70
- }
71
- ]
72
- },
73
- {
74
- "name": "params",
75
- "type": "tuple",
76
- "internalType": "struct ModifyLiquidityParams",
77
- "components": [
78
- {
79
- "name": "tickLower",
80
- "type": "int24",
81
- "internalType": "int24"
82
- },
83
- {
84
- "name": "tickUpper",
85
- "type": "int24",
86
- "internalType": "int24"
87
- },
88
- {
89
- "name": "liquidityDelta",
90
- "type": "int256",
91
- "internalType": "int256"
92
- },
93
- {
94
- "name": "salt",
95
- "type": "bytes32",
96
- "internalType": "bytes32"
97
- }
98
- ]
99
- },
100
- {
101
- "name": "delta",
102
- "type": "int256",
103
- "internalType": "BalanceDelta"
104
- },
105
- {
106
- "name": "feesAccrued",
107
- "type": "int256",
108
- "internalType": "BalanceDelta"
109
- },
110
- {
111
- "name": "hookData",
112
- "type": "bytes",
113
- "internalType": "bytes"
114
- }
115
- ],
116
- "outputs": [
117
- {
118
- "name": "",
119
- "type": "bytes4",
120
- "internalType": "bytes4"
121
- },
122
- {
123
- "name": "",
124
- "type": "int256",
125
- "internalType": "BalanceDelta"
126
- }
127
- ],
128
- "stateMutability": "nonpayable"
129
- },
130
- {
131
- "type": "function",
132
- "name": "afterDonate",
133
- "inputs": [
134
- {
135
- "name": "sender",
136
- "type": "address",
137
- "internalType": "address"
138
- },
139
- {
140
- "name": "key",
141
- "type": "tuple",
142
- "internalType": "struct PoolKey",
143
- "components": [
144
- {
145
- "name": "currency0",
146
- "type": "address",
147
- "internalType": "Currency"
148
- },
149
- {
150
- "name": "currency1",
151
- "type": "address",
152
- "internalType": "Currency"
153
- },
154
- {
155
- "name": "fee",
156
- "type": "uint24",
157
- "internalType": "uint24"
158
- },
159
- {
160
- "name": "tickSpacing",
161
- "type": "int24",
162
- "internalType": "int24"
163
- },
164
- {
165
- "name": "hooks",
166
- "type": "address",
167
- "internalType": "contract IHooks"
168
- }
169
- ]
170
- },
171
- {
172
- "name": "amount0",
173
- "type": "uint256",
174
- "internalType": "uint256"
175
- },
176
- {
177
- "name": "amount1",
178
- "type": "uint256",
179
- "internalType": "uint256"
180
- },
181
- {
182
- "name": "hookData",
183
- "type": "bytes",
184
- "internalType": "bytes"
185
- }
186
- ],
187
- "outputs": [
188
- {
189
- "name": "",
190
- "type": "bytes4",
191
- "internalType": "bytes4"
192
- }
193
- ],
194
- "stateMutability": "nonpayable"
195
- },
196
- {
197
- "type": "function",
198
- "name": "afterInitialize",
199
- "inputs": [
200
- {
201
- "name": "sender",
202
- "type": "address",
203
- "internalType": "address"
204
- },
205
- {
206
- "name": "key",
207
- "type": "tuple",
208
- "internalType": "struct PoolKey",
209
- "components": [
210
- {
211
- "name": "currency0",
212
- "type": "address",
213
- "internalType": "Currency"
214
- },
215
- {
216
- "name": "currency1",
217
- "type": "address",
218
- "internalType": "Currency"
219
- },
220
- {
221
- "name": "fee",
222
- "type": "uint24",
223
- "internalType": "uint24"
224
- },
225
- {
226
- "name": "tickSpacing",
227
- "type": "int24",
228
- "internalType": "int24"
229
- },
230
- {
231
- "name": "hooks",
232
- "type": "address",
233
- "internalType": "contract IHooks"
234
- }
235
- ]
236
- },
237
- {
238
- "name": "sqrtPriceX96",
239
- "type": "uint160",
240
- "internalType": "uint160"
241
- },
242
- {
243
- "name": "tick",
244
- "type": "int24",
245
- "internalType": "int24"
246
- }
247
- ],
248
- "outputs": [
249
- {
250
- "name": "",
251
- "type": "bytes4",
252
- "internalType": "bytes4"
253
- }
254
- ],
255
- "stateMutability": "nonpayable"
256
- },
257
- {
258
- "type": "function",
259
- "name": "afterRemoveLiquidity",
260
- "inputs": [
261
- {
262
- "name": "sender",
263
- "type": "address",
264
- "internalType": "address"
265
- },
266
- {
267
- "name": "key",
268
- "type": "tuple",
269
- "internalType": "struct PoolKey",
270
- "components": [
271
- {
272
- "name": "currency0",
273
- "type": "address",
274
- "internalType": "Currency"
275
- },
276
- {
277
- "name": "currency1",
278
- "type": "address",
279
- "internalType": "Currency"
280
- },
281
- {
282
- "name": "fee",
283
- "type": "uint24",
284
- "internalType": "uint24"
285
- },
286
- {
287
- "name": "tickSpacing",
288
- "type": "int24",
289
- "internalType": "int24"
290
- },
291
- {
292
- "name": "hooks",
293
- "type": "address",
294
- "internalType": "contract IHooks"
295
- }
296
- ]
297
- },
298
- {
299
- "name": "params",
300
- "type": "tuple",
301
- "internalType": "struct ModifyLiquidityParams",
302
- "components": [
303
- {
304
- "name": "tickLower",
305
- "type": "int24",
306
- "internalType": "int24"
307
- },
308
- {
309
- "name": "tickUpper",
310
- "type": "int24",
311
- "internalType": "int24"
312
- },
313
- {
314
- "name": "liquidityDelta",
315
- "type": "int256",
316
- "internalType": "int256"
317
- },
318
- {
319
- "name": "salt",
320
- "type": "bytes32",
321
- "internalType": "bytes32"
322
- }
323
- ]
324
- },
325
- {
326
- "name": "delta",
327
- "type": "int256",
328
- "internalType": "BalanceDelta"
329
- },
330
- {
331
- "name": "feesAccrued",
332
- "type": "int256",
333
- "internalType": "BalanceDelta"
334
- },
335
- {
336
- "name": "hookData",
337
- "type": "bytes",
338
- "internalType": "bytes"
339
- }
340
- ],
341
- "outputs": [
342
- {
343
- "name": "",
344
- "type": "bytes4",
345
- "internalType": "bytes4"
346
- },
347
- {
348
- "name": "",
349
- "type": "int256",
350
- "internalType": "BalanceDelta"
351
- }
352
- ],
353
- "stateMutability": "nonpayable"
354
- },
355
- {
356
- "type": "function",
357
- "name": "afterSwap",
358
- "inputs": [
359
- {
360
- "name": "sender",
361
- "type": "address",
362
- "internalType": "address"
363
- },
364
- {
365
- "name": "key",
366
- "type": "tuple",
367
- "internalType": "struct PoolKey",
368
- "components": [
369
- {
370
- "name": "currency0",
371
- "type": "address",
372
- "internalType": "Currency"
373
- },
374
- {
375
- "name": "currency1",
376
- "type": "address",
377
- "internalType": "Currency"
378
- },
379
- {
380
- "name": "fee",
381
- "type": "uint24",
382
- "internalType": "uint24"
383
- },
384
- {
385
- "name": "tickSpacing",
386
- "type": "int24",
387
- "internalType": "int24"
388
- },
389
- {
390
- "name": "hooks",
391
- "type": "address",
392
- "internalType": "contract IHooks"
393
- }
394
- ]
395
- },
396
- {
397
- "name": "params",
398
- "type": "tuple",
399
- "internalType": "struct SwapParams",
400
- "components": [
401
- {
402
- "name": "zeroForOne",
403
- "type": "bool",
404
- "internalType": "bool"
405
- },
406
- {
407
- "name": "amountSpecified",
408
- "type": "int256",
409
- "internalType": "int256"
410
- },
411
- {
412
- "name": "sqrtPriceLimitX96",
413
- "type": "uint160",
414
- "internalType": "uint160"
415
- }
416
- ]
417
- },
418
- {
419
- "name": "delta",
420
- "type": "int256",
421
- "internalType": "BalanceDelta"
422
- },
423
- {
424
- "name": "hookData",
425
- "type": "bytes",
426
- "internalType": "bytes"
427
- }
428
- ],
429
- "outputs": [
430
- {
431
- "name": "",
432
- "type": "bytes4",
433
- "internalType": "bytes4"
434
- },
435
- {
436
- "name": "",
437
- "type": "int128",
438
- "internalType": "int128"
439
- }
440
- ],
441
- "stateMutability": "nonpayable"
442
- },
443
- {
444
- "type": "function",
445
- "name": "beforeAddLiquidity",
446
- "inputs": [
447
- {
448
- "name": "sender",
449
- "type": "address",
450
- "internalType": "address"
451
- },
452
- {
453
- "name": "key",
454
- "type": "tuple",
455
- "internalType": "struct PoolKey",
456
- "components": [
457
- {
458
- "name": "currency0",
459
- "type": "address",
460
- "internalType": "Currency"
461
- },
462
- {
463
- "name": "currency1",
464
- "type": "address",
465
- "internalType": "Currency"
466
- },
467
- {
468
- "name": "fee",
469
- "type": "uint24",
470
- "internalType": "uint24"
471
- },
472
- {
473
- "name": "tickSpacing",
474
- "type": "int24",
475
- "internalType": "int24"
476
- },
477
- {
478
- "name": "hooks",
479
- "type": "address",
480
- "internalType": "contract IHooks"
481
- }
482
- ]
483
- },
484
- {
485
- "name": "params",
486
- "type": "tuple",
487
- "internalType": "struct ModifyLiquidityParams",
488
- "components": [
489
- {
490
- "name": "tickLower",
491
- "type": "int24",
492
- "internalType": "int24"
493
- },
494
- {
495
- "name": "tickUpper",
496
- "type": "int24",
497
- "internalType": "int24"
498
- },
499
- {
500
- "name": "liquidityDelta",
501
- "type": "int256",
502
- "internalType": "int256"
503
- },
504
- {
505
- "name": "salt",
506
- "type": "bytes32",
507
- "internalType": "bytes32"
508
- }
509
- ]
510
- },
511
- {
512
- "name": "hookData",
513
- "type": "bytes",
514
- "internalType": "bytes"
515
- }
516
- ],
517
- "outputs": [
518
- {
519
- "name": "",
520
- "type": "bytes4",
521
- "internalType": "bytes4"
522
- }
523
- ],
524
- "stateMutability": "nonpayable"
525
- },
526
- {
527
- "type": "function",
528
- "name": "beforeDonate",
529
- "inputs": [
530
- {
531
- "name": "sender",
532
- "type": "address",
533
- "internalType": "address"
534
- },
535
- {
536
- "name": "key",
537
- "type": "tuple",
538
- "internalType": "struct PoolKey",
539
- "components": [
540
- {
541
- "name": "currency0",
542
- "type": "address",
543
- "internalType": "Currency"
544
- },
545
- {
546
- "name": "currency1",
547
- "type": "address",
548
- "internalType": "Currency"
549
- },
550
- {
551
- "name": "fee",
552
- "type": "uint24",
553
- "internalType": "uint24"
554
- },
555
- {
556
- "name": "tickSpacing",
557
- "type": "int24",
558
- "internalType": "int24"
559
- },
560
- {
561
- "name": "hooks",
562
- "type": "address",
563
- "internalType": "contract IHooks"
564
- }
565
- ]
566
- },
567
- {
568
- "name": "amount0",
569
- "type": "uint256",
570
- "internalType": "uint256"
571
- },
572
- {
573
- "name": "amount1",
574
- "type": "uint256",
575
- "internalType": "uint256"
576
- },
577
- {
578
- "name": "hookData",
579
- "type": "bytes",
580
- "internalType": "bytes"
581
- }
582
- ],
583
- "outputs": [
584
- {
585
- "name": "",
586
- "type": "bytes4",
587
- "internalType": "bytes4"
588
- }
589
- ],
590
- "stateMutability": "nonpayable"
591
- },
592
- {
593
- "type": "function",
594
- "name": "beforeInitialize",
595
- "inputs": [
596
- {
597
- "name": "sender",
598
- "type": "address",
599
- "internalType": "address"
600
- },
601
- {
602
- "name": "key",
603
- "type": "tuple",
604
- "internalType": "struct PoolKey",
605
- "components": [
606
- {
607
- "name": "currency0",
608
- "type": "address",
609
- "internalType": "Currency"
610
- },
611
- {
612
- "name": "currency1",
613
- "type": "address",
614
- "internalType": "Currency"
615
- },
616
- {
617
- "name": "fee",
618
- "type": "uint24",
619
- "internalType": "uint24"
620
- },
621
- {
622
- "name": "tickSpacing",
623
- "type": "int24",
624
- "internalType": "int24"
625
- },
626
- {
627
- "name": "hooks",
628
- "type": "address",
629
- "internalType": "contract IHooks"
630
- }
631
- ]
632
- },
633
- {
634
- "name": "sqrtPriceX96",
635
- "type": "uint160",
636
- "internalType": "uint160"
637
- }
638
- ],
639
- "outputs": [
640
- {
641
- "name": "",
642
- "type": "bytes4",
643
- "internalType": "bytes4"
644
- }
645
- ],
646
- "stateMutability": "nonpayable"
647
- },
648
- {
649
- "type": "function",
650
- "name": "beforeRemoveLiquidity",
651
- "inputs": [
652
- {
653
- "name": "sender",
654
- "type": "address",
655
- "internalType": "address"
656
- },
657
- {
658
- "name": "key",
659
- "type": "tuple",
660
- "internalType": "struct PoolKey",
661
- "components": [
662
- {
663
- "name": "currency0",
664
- "type": "address",
665
- "internalType": "Currency"
666
- },
667
- {
668
- "name": "currency1",
669
- "type": "address",
670
- "internalType": "Currency"
671
- },
672
- {
673
- "name": "fee",
674
- "type": "uint24",
675
- "internalType": "uint24"
676
- },
677
- {
678
- "name": "tickSpacing",
679
- "type": "int24",
680
- "internalType": "int24"
681
- },
682
- {
683
- "name": "hooks",
684
- "type": "address",
685
- "internalType": "contract IHooks"
686
- }
687
- ]
688
- },
689
- {
690
- "name": "params",
691
- "type": "tuple",
692
- "internalType": "struct ModifyLiquidityParams",
693
- "components": [
694
- {
695
- "name": "tickLower",
696
- "type": "int24",
697
- "internalType": "int24"
698
- },
699
- {
700
- "name": "tickUpper",
701
- "type": "int24",
702
- "internalType": "int24"
703
- },
704
- {
705
- "name": "liquidityDelta",
706
- "type": "int256",
707
- "internalType": "int256"
708
- },
709
- {
710
- "name": "salt",
711
- "type": "bytes32",
712
- "internalType": "bytes32"
713
- }
714
- ]
715
- },
716
- {
717
- "name": "hookData",
718
- "type": "bytes",
719
- "internalType": "bytes"
720
- }
721
- ],
722
- "outputs": [
723
- {
724
- "name": "",
725
- "type": "bytes4",
726
- "internalType": "bytes4"
727
- }
728
- ],
729
- "stateMutability": "nonpayable"
730
- },
731
- {
732
- "type": "function",
733
- "name": "beforeSwap",
734
- "inputs": [
735
- {
736
- "name": "sender",
737
- "type": "address",
738
- "internalType": "address"
739
- },
740
- {
741
- "name": "key",
742
- "type": "tuple",
743
- "internalType": "struct PoolKey",
744
- "components": [
745
- {
746
- "name": "currency0",
747
- "type": "address",
748
- "internalType": "Currency"
749
- },
750
- {
751
- "name": "currency1",
752
- "type": "address",
753
- "internalType": "Currency"
754
- },
755
- {
756
- "name": "fee",
757
- "type": "uint24",
758
- "internalType": "uint24"
759
- },
760
- {
761
- "name": "tickSpacing",
762
- "type": "int24",
763
- "internalType": "int24"
764
- },
765
- {
766
- "name": "hooks",
767
- "type": "address",
768
- "internalType": "contract IHooks"
769
- }
770
- ]
771
- },
772
- {
773
- "name": "params",
774
- "type": "tuple",
775
- "internalType": "struct SwapParams",
776
- "components": [
777
- {
778
- "name": "zeroForOne",
779
- "type": "bool",
780
- "internalType": "bool"
781
- },
782
- {
783
- "name": "amountSpecified",
784
- "type": "int256",
785
- "internalType": "int256"
786
- },
787
- {
788
- "name": "sqrtPriceLimitX96",
789
- "type": "uint160",
790
- "internalType": "uint160"
791
- }
792
- ]
793
- },
794
- {
795
- "name": "hookData",
796
- "type": "bytes",
797
- "internalType": "bytes"
798
- }
799
- ],
800
- "outputs": [
801
- {
802
- "name": "",
803
- "type": "bytes4",
804
- "internalType": "bytes4"
805
- },
806
- {
807
- "name": "",
808
- "type": "int256",
809
- "internalType": "BeforeSwapDelta"
810
- },
811
- {
812
- "name": "",
813
- "type": "uint24",
814
- "internalType": "uint24"
815
- }
816
- ],
817
- "stateMutability": "nonpayable"
818
- },
819
- {
820
- "type": "function",
821
- "name": "contractVersion",
822
- "inputs": [],
823
- "outputs": [
824
- {
825
- "name": "",
826
- "type": "string",
827
- "internalType": "string"
828
- }
829
- ],
830
- "stateMutability": "pure"
831
- },
832
- {
833
- "type": "function",
834
- "name": "getHookPermissions",
835
- "inputs": [],
836
- "outputs": [
837
- {
838
- "name": "",
839
- "type": "tuple",
840
- "internalType": "struct Hooks.Permissions",
841
- "components": [
842
- {
843
- "name": "beforeInitialize",
844
- "type": "bool",
845
- "internalType": "bool"
846
- },
847
- {
848
- "name": "afterInitialize",
849
- "type": "bool",
850
- "internalType": "bool"
851
- },
852
- {
853
- "name": "beforeAddLiquidity",
854
- "type": "bool",
855
- "internalType": "bool"
856
- },
857
- {
858
- "name": "afterAddLiquidity",
859
- "type": "bool",
860
- "internalType": "bool"
861
- },
862
- {
863
- "name": "beforeRemoveLiquidity",
864
- "type": "bool",
865
- "internalType": "bool"
866
- },
867
- {
868
- "name": "afterRemoveLiquidity",
869
- "type": "bool",
870
- "internalType": "bool"
871
- },
872
- {
873
- "name": "beforeSwap",
874
- "type": "bool",
875
- "internalType": "bool"
876
- },
877
- {
878
- "name": "afterSwap",
879
- "type": "bool",
880
- "internalType": "bool"
881
- },
882
- {
883
- "name": "beforeDonate",
884
- "type": "bool",
885
- "internalType": "bool"
886
- },
887
- {
888
- "name": "afterDonate",
889
- "type": "bool",
890
- "internalType": "bool"
891
- },
892
- {
893
- "name": "beforeSwapReturnDelta",
894
- "type": "bool",
895
- "internalType": "bool"
896
- },
897
- {
898
- "name": "afterSwapReturnDelta",
899
- "type": "bool",
900
- "internalType": "bool"
901
- },
902
- {
903
- "name": "afterAddLiquidityReturnDelta",
904
- "type": "bool",
905
- "internalType": "bool"
906
- },
907
- {
908
- "name": "afterRemoveLiquidityReturnDelta",
909
- "type": "bool",
910
- "internalType": "bool"
911
- }
912
- ]
913
- }
914
- ],
915
- "stateMutability": "pure"
916
- },
917
- {
918
- "type": "function",
919
- "name": "getPoolCoin",
920
- "inputs": [
921
- {
922
- "name": "key",
923
- "type": "tuple",
924
- "internalType": "struct PoolKey",
925
- "components": [
926
- {
927
- "name": "currency0",
928
- "type": "address",
929
- "internalType": "Currency"
930
- },
931
- {
932
- "name": "currency1",
933
- "type": "address",
934
- "internalType": "Currency"
935
- },
936
- {
937
- "name": "fee",
938
- "type": "uint24",
939
- "internalType": "uint24"
940
- },
941
- {
942
- "name": "tickSpacing",
943
- "type": "int24",
944
- "internalType": "int24"
945
- },
946
- {
947
- "name": "hooks",
948
- "type": "address",
949
- "internalType": "contract IHooks"
950
- }
951
- ]
952
- }
953
- ],
954
- "outputs": [
955
- {
956
- "name": "",
957
- "type": "tuple",
958
- "internalType": "struct IZoraV4CoinHook.PoolCoin",
959
- "components": [
960
- {
961
- "name": "coin",
962
- "type": "address",
963
- "internalType": "address"
964
- },
965
- {
966
- "name": "positions",
967
- "type": "tuple[]",
968
- "internalType": "struct LpPosition[]",
969
- "components": [
970
- {
971
- "name": "tickLower",
972
- "type": "int24",
973
- "internalType": "int24"
974
- },
975
- {
976
- "name": "tickUpper",
977
- "type": "int24",
978
- "internalType": "int24"
979
- },
980
- {
981
- "name": "liquidity",
982
- "type": "uint128",
983
- "internalType": "uint128"
984
- }
985
- ]
986
- }
987
- ]
988
- }
989
- ],
990
- "stateMutability": "view"
991
- },
992
- {
993
- "type": "function",
994
- "name": "getPoolCoinByHash",
995
- "inputs": [
996
- {
997
- "name": "poolKeyHash",
998
- "type": "bytes32",
999
- "internalType": "bytes32"
1000
- }
1001
- ],
1002
- "outputs": [
1003
- {
1004
- "name": "",
1005
- "type": "tuple",
1006
- "internalType": "struct IZoraV4CoinHook.PoolCoin",
1007
- "components": [
1008
- {
1009
- "name": "coin",
1010
- "type": "address",
1011
- "internalType": "address"
1012
- },
1013
- {
1014
- "name": "positions",
1015
- "type": "tuple[]",
1016
- "internalType": "struct LpPosition[]",
1017
- "components": [
1018
- {
1019
- "name": "tickLower",
1020
- "type": "int24",
1021
- "internalType": "int24"
1022
- },
1023
- {
1024
- "name": "tickUpper",
1025
- "type": "int24",
1026
- "internalType": "int24"
1027
- },
1028
- {
1029
- "name": "liquidity",
1030
- "type": "uint128",
1031
- "internalType": "uint128"
1032
- }
1033
- ]
1034
- }
1035
- ]
1036
- }
1037
- ],
1038
- "stateMutability": "view"
1039
- },
1040
- {
1041
- "type": "function",
1042
- "name": "initializeFromMigration",
1043
- "inputs": [
1044
- {
1045
- "name": "poolKey",
1046
- "type": "tuple",
1047
- "internalType": "struct PoolKey",
1048
- "components": [
1049
- {
1050
- "name": "currency0",
1051
- "type": "address",
1052
- "internalType": "Currency"
1053
- },
1054
- {
1055
- "name": "currency1",
1056
- "type": "address",
1057
- "internalType": "Currency"
1058
- },
1059
- {
1060
- "name": "fee",
1061
- "type": "uint24",
1062
- "internalType": "uint24"
1063
- },
1064
- {
1065
- "name": "tickSpacing",
1066
- "type": "int24",
1067
- "internalType": "int24"
1068
- },
1069
- {
1070
- "name": "hooks",
1071
- "type": "address",
1072
- "internalType": "contract IHooks"
1073
- }
1074
- ]
1075
- },
1076
- {
1077
- "name": "coin",
1078
- "type": "address",
1079
- "internalType": "address"
1080
- },
1081
- {
1082
- "name": "sqrtPriceX96",
1083
- "type": "uint160",
1084
- "internalType": "uint160"
1085
- },
1086
- {
1087
- "name": "migratedLiquidity",
1088
- "type": "tuple[]",
1089
- "internalType": "struct BurnedPosition[]",
1090
- "components": [
1091
- {
1092
- "name": "tickLower",
1093
- "type": "int24",
1094
- "internalType": "int24"
1095
- },
1096
- {
1097
- "name": "tickUpper",
1098
- "type": "int24",
1099
- "internalType": "int24"
1100
- },
1101
- {
1102
- "name": "amount0Received",
1103
- "type": "uint128",
1104
- "internalType": "uint128"
1105
- },
1106
- {
1107
- "name": "amount1Received",
1108
- "type": "uint128",
1109
- "internalType": "uint128"
1110
- }
1111
- ]
1112
- },
1113
- {
1114
- "name": "",
1115
- "type": "bytes",
1116
- "internalType": "bytes"
1117
- }
1118
- ],
1119
- "outputs": [],
1120
- "stateMutability": "nonpayable"
1121
- },
1122
- {
1123
- "type": "function",
1124
- "name": "isTrustedMessageSender",
1125
- "inputs": [
1126
- {
1127
- "name": "sender",
1128
- "type": "address",
1129
- "internalType": "address"
1130
- }
1131
- ],
1132
- "outputs": [
1133
- {
1134
- "name": "",
1135
- "type": "bool",
1136
- "internalType": "bool"
1137
- }
1138
- ],
1139
- "stateMutability": "view"
1140
- },
1141
- {
1142
- "type": "function",
1143
- "name": "migrateLiquidity",
1144
- "inputs": [
1145
- {
1146
- "name": "newHook",
1147
- "type": "address",
1148
- "internalType": "address"
1149
- },
1150
- {
1151
- "name": "poolKey",
1152
- "type": "tuple",
1153
- "internalType": "struct PoolKey",
1154
- "components": [
1155
- {
1156
- "name": "currency0",
1157
- "type": "address",
1158
- "internalType": "Currency"
1159
- },
1160
- {
1161
- "name": "currency1",
1162
- "type": "address",
1163
- "internalType": "Currency"
1164
- },
1165
- {
1166
- "name": "fee",
1167
- "type": "uint24",
1168
- "internalType": "uint24"
1169
- },
1170
- {
1171
- "name": "tickSpacing",
1172
- "type": "int24",
1173
- "internalType": "int24"
1174
- },
1175
- {
1176
- "name": "hooks",
1177
- "type": "address",
1178
- "internalType": "contract IHooks"
1179
- }
1180
- ]
1181
- },
1182
- {
1183
- "name": "additionalData",
1184
- "type": "bytes",
1185
- "internalType": "bytes"
1186
- }
1187
- ],
1188
- "outputs": [
1189
- {
1190
- "name": "newPoolKey",
1191
- "type": "tuple",
1192
- "internalType": "struct PoolKey",
1193
- "components": [
1194
- {
1195
- "name": "currency0",
1196
- "type": "address",
1197
- "internalType": "Currency"
1198
- },
1199
- {
1200
- "name": "currency1",
1201
- "type": "address",
1202
- "internalType": "Currency"
1203
- },
1204
- {
1205
- "name": "fee",
1206
- "type": "uint24",
1207
- "internalType": "uint24"
1208
- },
1209
- {
1210
- "name": "tickSpacing",
1211
- "type": "int24",
1212
- "internalType": "int24"
1213
- },
1214
- {
1215
- "name": "hooks",
1216
- "type": "address",
1217
- "internalType": "contract IHooks"
1218
- }
1219
- ]
1220
- }
1221
- ],
1222
- "stateMutability": "nonpayable"
1223
- },
1224
- {
1225
- "type": "function",
1226
- "name": "poolManager",
1227
- "inputs": [],
1228
- "outputs": [
1229
- {
1230
- "name": "",
1231
- "type": "address",
1232
- "internalType": "contract IPoolManager"
1233
- }
1234
- ],
1235
- "stateMutability": "view"
1236
- },
1237
- {
1238
- "type": "function",
1239
- "name": "supportsInterface",
1240
- "inputs": [
1241
- {
1242
- "name": "interfaceId",
1243
- "type": "bytes4",
1244
- "internalType": "bytes4"
1245
- }
1246
- ],
1247
- "outputs": [
1248
- {
1249
- "name": "",
1250
- "type": "bool",
1251
- "internalType": "bool"
1252
- }
1253
- ],
1254
- "stateMutability": "view"
1255
- },
1256
- {
1257
- "type": "function",
1258
- "name": "unlockCallback",
1259
- "inputs": [
1260
- {
1261
- "name": "data",
1262
- "type": "bytes",
1263
- "internalType": "bytes"
1264
- }
1265
- ],
1266
- "outputs": [
1267
- {
1268
- "name": "",
1269
- "type": "bytes",
1270
- "internalType": "bytes"
1271
- }
1272
- ],
1273
- "stateMutability": "nonpayable"
1274
- },
1275
- {
1276
- "type": "event",
1277
- "name": "CoinMarketRewardsV4",
1278
- "inputs": [
1279
- {
1280
- "name": "coin",
1281
- "type": "address",
1282
- "indexed": false,
1283
- "internalType": "address"
1284
- },
1285
- {
1286
- "name": "currency",
1287
- "type": "address",
1288
- "indexed": false,
1289
- "internalType": "address"
1290
- },
1291
- {
1292
- "name": "payoutRecipient",
1293
- "type": "address",
1294
- "indexed": false,
1295
- "internalType": "address"
1296
- },
1297
- {
1298
- "name": "platformReferrer",
1299
- "type": "address",
1300
- "indexed": false,
1301
- "internalType": "address"
1302
- },
1303
- {
1304
- "name": "tradeReferrer",
1305
- "type": "address",
1306
- "indexed": false,
1307
- "internalType": "address"
1308
- },
1309
- {
1310
- "name": "protocolRewardRecipient",
1311
- "type": "address",
1312
- "indexed": false,
1313
- "internalType": "address"
1314
- },
1315
- {
1316
- "name": "dopplerRecipient",
1317
- "type": "address",
1318
- "indexed": false,
1319
- "internalType": "address"
1320
- },
1321
- {
1322
- "name": "marketRewards",
1323
- "type": "tuple",
1324
- "indexed": false,
1325
- "internalType": "struct IZoraV4CoinHook.MarketRewardsV4",
1326
- "components": [
1327
- {
1328
- "name": "creatorPayoutAmountCurrency",
1329
- "type": "uint256",
1330
- "internalType": "uint256"
1331
- },
1332
- {
1333
- "name": "creatorPayoutAmountCoin",
1334
- "type": "uint256",
1335
- "internalType": "uint256"
1336
- },
1337
- {
1338
- "name": "platformReferrerAmountCurrency",
1339
- "type": "uint256",
1340
- "internalType": "uint256"
1341
- },
1342
- {
1343
- "name": "platformReferrerAmountCoin",
1344
- "type": "uint256",
1345
- "internalType": "uint256"
1346
- },
1347
- {
1348
- "name": "tradeReferrerAmountCurrency",
1349
- "type": "uint256",
1350
- "internalType": "uint256"
1351
- },
1352
- {
1353
- "name": "tradeReferrerAmountCoin",
1354
- "type": "uint256",
1355
- "internalType": "uint256"
1356
- },
1357
- {
1358
- "name": "protocolAmountCurrency",
1359
- "type": "uint256",
1360
- "internalType": "uint256"
1361
- },
1362
- {
1363
- "name": "protocolAmountCoin",
1364
- "type": "uint256",
1365
- "internalType": "uint256"
1366
- },
1367
- {
1368
- "name": "dopplerAmountCurrency",
1369
- "type": "uint256",
1370
- "internalType": "uint256"
1371
- },
1372
- {
1373
- "name": "dopplerAmountCoin",
1374
- "type": "uint256",
1375
- "internalType": "uint256"
1376
- }
1377
- ]
1378
- }
1379
- ],
1380
- "anonymous": false
1381
- },
1382
- {
1383
- "type": "event",
1384
- "name": "LpReward",
1385
- "inputs": [
1386
- {
1387
- "name": "coin",
1388
- "type": "address",
1389
- "indexed": true,
1390
- "internalType": "address"
1391
- },
1392
- {
1393
- "name": "currency",
1394
- "type": "address",
1395
- "indexed": true,
1396
- "internalType": "address"
1397
- },
1398
- {
1399
- "name": "amountCurrency",
1400
- "type": "uint256",
1401
- "indexed": false,
1402
- "internalType": "uint256"
1403
- },
1404
- {
1405
- "name": "tick",
1406
- "type": "int24",
1407
- "indexed": false,
1408
- "internalType": "int24"
1409
- },
1410
- {
1411
- "name": "liquidity",
1412
- "type": "uint128",
1413
- "indexed": false,
1414
- "internalType": "uint128"
1415
- }
1416
- ],
1417
- "anonymous": false
1418
- },
1419
- {
1420
- "type": "event",
1421
- "name": "Swapped",
1422
- "inputs": [
1423
- {
1424
- "name": "sender",
1425
- "type": "address",
1426
- "indexed": true,
1427
- "internalType": "address"
1428
- },
1429
- {
1430
- "name": "swapSender",
1431
- "type": "address",
1432
- "indexed": true,
1433
- "internalType": "address"
1434
- },
1435
- {
1436
- "name": "isTrustedSwapSenderAddress",
1437
- "type": "bool",
1438
- "indexed": false,
1439
- "internalType": "bool"
1440
- },
1441
- {
1442
- "name": "key",
1443
- "type": "tuple",
1444
- "indexed": false,
1445
- "internalType": "struct PoolKey",
1446
- "components": [
1447
- {
1448
- "name": "currency0",
1449
- "type": "address",
1450
- "internalType": "Currency"
1451
- },
1452
- {
1453
- "name": "currency1",
1454
- "type": "address",
1455
- "internalType": "Currency"
1456
- },
1457
- {
1458
- "name": "fee",
1459
- "type": "uint24",
1460
- "internalType": "uint24"
1461
- },
1462
- {
1463
- "name": "tickSpacing",
1464
- "type": "int24",
1465
- "internalType": "int24"
1466
- },
1467
- {
1468
- "name": "hooks",
1469
- "type": "address",
1470
- "internalType": "contract IHooks"
1471
- }
1472
- ]
1473
- },
1474
- {
1475
- "name": "poolKeyHash",
1476
- "type": "bytes32",
1477
- "indexed": true,
1478
- "internalType": "bytes32"
1479
- },
1480
- {
1481
- "name": "params",
1482
- "type": "tuple",
1483
- "indexed": false,
1484
- "internalType": "struct SwapParams",
1485
- "components": [
1486
- {
1487
- "name": "zeroForOne",
1488
- "type": "bool",
1489
- "internalType": "bool"
1490
- },
1491
- {
1492
- "name": "amountSpecified",
1493
- "type": "int256",
1494
- "internalType": "int256"
1495
- },
1496
- {
1497
- "name": "sqrtPriceLimitX96",
1498
- "type": "uint160",
1499
- "internalType": "uint160"
1500
- }
1501
- ]
1502
- },
1503
- {
1504
- "name": "amount0",
1505
- "type": "int128",
1506
- "indexed": false,
1507
- "internalType": "int128"
1508
- },
1509
- {
1510
- "name": "amount1",
1511
- "type": "int128",
1512
- "indexed": false,
1513
- "internalType": "int128"
1514
- },
1515
- {
1516
- "name": "isCoinBuy",
1517
- "type": "bool",
1518
- "indexed": false,
1519
- "internalType": "bool"
1520
- },
1521
- {
1522
- "name": "hookData",
1523
- "type": "bytes",
1524
- "indexed": false,
1525
- "internalType": "bytes"
1526
- },
1527
- {
1528
- "name": "sqrtPriceX96",
1529
- "type": "uint160",
1530
- "indexed": false,
1531
- "internalType": "uint160"
1532
- }
1533
- ],
1534
- "anonymous": false
1535
- },
1536
- {
1537
- "type": "error",
1538
- "name": "AddressEmptyCode",
1539
- "inputs": [
1540
- {
1541
- "name": "target",
1542
- "type": "address",
1543
- "internalType": "address"
1544
- }
1545
- ]
1546
- },
1547
- {
1548
- "type": "error",
1549
- "name": "AddressInsufficientBalance",
1550
- "inputs": [
1551
- {
1552
- "name": "account",
1553
- "type": "address",
1554
- "internalType": "address"
1555
- }
1556
- ]
1557
- },
1558
- {
1559
- "type": "error",
1560
- "name": "CannotMintZeroLiquidity",
1561
- "inputs": []
1562
- },
1563
- {
1564
- "type": "error",
1565
- "name": "CoinVersionLookupCannotBeZeroAddress",
1566
- "inputs": []
1567
- },
1568
- {
1569
- "type": "error",
1570
- "name": "EthTransferFailed",
1571
- "inputs": []
1572
- },
1573
- {
1574
- "type": "error",
1575
- "name": "FailedInnerCall",
1576
- "inputs": []
1577
- },
1578
- {
1579
- "type": "error",
1580
- "name": "HookNotImplemented",
1581
- "inputs": []
1582
- },
1583
- {
1584
- "type": "error",
1585
- "name": "InvalidCallbackId",
1586
- "inputs": [
1587
- {
1588
- "name": "callbackId",
1589
- "type": "uint8",
1590
- "internalType": "uint8"
1591
- }
1592
- ]
1593
- },
1594
- {
1595
- "type": "error",
1596
- "name": "InvalidNewHook",
1597
- "inputs": [
1598
- {
1599
- "name": "newHook",
1600
- "type": "address",
1601
- "internalType": "address"
1602
- }
1603
- ]
1604
- },
1605
- {
1606
- "type": "error",
1607
- "name": "InvalidTickRangeMisordered",
1608
- "inputs": [
1609
- {
1610
- "name": "tickLower",
1611
- "type": "int24",
1612
- "internalType": "int24"
1613
- },
1614
- {
1615
- "name": "tickUpper",
1616
- "type": "int24",
1617
- "internalType": "int24"
1618
- }
1619
- ]
1620
- },
1621
- {
1622
- "type": "error",
1623
- "name": "NoCoinForHook",
1624
- "inputs": [
1625
- {
1626
- "name": "key",
1627
- "type": "tuple",
1628
- "internalType": "struct PoolKey",
1629
- "components": [
1630
- {
1631
- "name": "currency0",
1632
- "type": "address",
1633
- "internalType": "Currency"
1634
- },
1635
- {
1636
- "name": "currency1",
1637
- "type": "address",
1638
- "internalType": "Currency"
1639
- },
1640
- {
1641
- "name": "fee",
1642
- "type": "uint24",
1643
- "internalType": "uint24"
1644
- },
1645
- {
1646
- "name": "tickSpacing",
1647
- "type": "int24",
1648
- "internalType": "int24"
1649
- },
1650
- {
1651
- "name": "hooks",
1652
- "type": "address",
1653
- "internalType": "contract IHooks"
1654
- }
1655
- ]
1656
- }
1657
- ]
1658
- },
1659
- {
1660
- "type": "error",
1661
- "name": "NotACoin",
1662
- "inputs": [
1663
- {
1664
- "name": "coin",
1665
- "type": "address",
1666
- "internalType": "address"
1667
- }
1668
- ]
1669
- },
1670
- {
1671
- "type": "error",
1672
- "name": "NotPoolManager",
1673
- "inputs": []
1674
- },
1675
- {
1676
- "type": "error",
1677
- "name": "OnlyCoin",
1678
- "inputs": [
1679
- {
1680
- "name": "caller",
1681
- "type": "address",
1682
- "internalType": "address"
1683
- },
1684
- {
1685
- "name": "expectedCoin",
1686
- "type": "address",
1687
- "internalType": "address"
1688
- }
1689
- ]
1690
- },
1691
- {
1692
- "type": "error",
1693
- "name": "PathMustHaveAtLeastOneStep",
1694
- "inputs": []
1695
- },
1696
- {
1697
- "type": "error",
1698
- "name": "SafeCastOverflow",
1699
- "inputs": []
1700
- },
1701
- {
1702
- "type": "error",
1703
- "name": "SafeERC20FailedOperation",
1704
- "inputs": [
1705
- {
1706
- "name": "token",
1707
- "type": "address",
1708
- "internalType": "address"
1709
- }
1710
- ]
1711
- },
1712
- {
1713
- "type": "error",
1714
- "name": "UpgradeGateCannotBeZeroAddress",
1715
- "inputs": []
1716
- },
1717
- {
1718
- "type": "error",
1719
- "name": "UpgradePathNotRegistered",
1720
- "inputs": [
1721
- {
1722
- "name": "oldHook",
1723
- "type": "address",
1724
- "internalType": "address"
1725
- },
1726
- {
1727
- "name": "newHook",
1728
- "type": "address",
1729
- "internalType": "address"
1730
- }
1731
- ]
1732
- }
1733
- ]