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