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