@zoralabs/limit-orders 0.2.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 (208) hide show
  1. package/.turbo/turbo-build$colon$js.log +85 -0
  2. package/AUDIT_NOTES.md +33 -0
  3. package/AUDIT_RFP.md +408 -0
  4. package/CHANGELOG.md +25 -0
  5. package/GAS_COMPARISON_RESULTS.md +194 -0
  6. package/LICENSE +21 -0
  7. package/README.md +650 -0
  8. package/SPEC.md +291 -0
  9. package/abis/BalanceDeltaLibrary.json +15 -0
  10. package/abis/BeforeSwapDeltaLibrary.json +15 -0
  11. package/abis/CurrencyLibrary.json +25 -0
  12. package/abis/CustomRevert.json +28 -0
  13. package/abis/IAllowanceTransfer.json +486 -0
  14. package/abis/IAuthority.json +31 -0
  15. package/abis/ICoin.json +1074 -0
  16. package/abis/IDeployedCoinVersionLookup.json +21 -0
  17. package/abis/IDopplerErrors.json +44 -0
  18. package/abis/IEIP712.json +15 -0
  19. package/abis/IERC1363.json +373 -0
  20. package/abis/IERC165.json +21 -0
  21. package/abis/IERC20.json +185 -0
  22. package/abis/IERC20Minimal.json +172 -0
  23. package/abis/IERC6909Claims.json +288 -0
  24. package/abis/IERC7572.json +21 -0
  25. package/abis/IExtsload.json +64 -0
  26. package/abis/IExttload.json +40 -0
  27. package/abis/IHasCoinType.json +15 -0
  28. package/abis/IHasPoolKey.json +42 -0
  29. package/abis/IHasRewardsRecipients.json +54 -0
  30. package/abis/IHasSwapPath.json +60 -0
  31. package/abis/IHasTotalSupplyForPositions.json +15 -0
  32. package/abis/IHooks.json +789 -0
  33. package/abis/IMsgSender.json +15 -0
  34. package/abis/IPoolManager.json +1286 -0
  35. package/abis/IProtocolFees.json +174 -0
  36. package/abis/ISupportsLimitOrderFill.json +15 -0
  37. package/abis/ISwapPathRouter.json +92 -0
  38. package/abis/ISwapRouter.json +219 -0
  39. package/abis/IUniswapV3SwapCallback.json +25 -0
  40. package/abis/IUpgradeableDestinationV4Hook.json +84 -0
  41. package/abis/IUpgradeableDestinationV4HookWithUpdateableFee.json +95 -0
  42. package/abis/IUpgradeableV4Hook.json +112 -0
  43. package/abis/IZoraHookRegistry.json +188 -0
  44. package/abis/IZoraLimitOrderBook.json +623 -0
  45. package/abis/IZoraLimitOrderBookCoinsInterface.json +67 -0
  46. package/abis/IZoraV4CoinHook.json +610 -0
  47. package/abis/Permit2Payments.json +7 -0
  48. package/abis/Position.json +7 -0
  49. package/abis/SafeCast.json +7 -0
  50. package/abis/SafeCast160.json +7 -0
  51. package/abis/SafeERC20.json +34 -0
  52. package/abis/SimpleAccessManaged.json +57 -0
  53. package/abis/SimpleAccessManager.json +351 -0
  54. package/abis/SqrtPriceMath.json +22 -0
  55. package/abis/StateLibrary.json +80 -0
  56. package/abis/SwapLimitOrders.json +22 -0
  57. package/abis/SwapWithLimitOrders.json +457 -0
  58. package/abis/TickBitmap.json +18 -0
  59. package/abis/TickMath.json +24 -0
  60. package/abis/V3ToV4SwapLib.json +28 -0
  61. package/abis/ZoraLimitOrderBook.json +771 -0
  62. package/cache/solidity-files-cache.json +1 -0
  63. package/dist/index.cjs +760 -0
  64. package/dist/index.cjs.map +1 -0
  65. package/dist/index.d.ts +2 -0
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/index.js +731 -0
  68. package/dist/index.js.map +1 -0
  69. package/dist/wagmiGenerated.d.ts +1012 -0
  70. package/dist/wagmiGenerated.d.ts.map +1 -0
  71. package/foundry.toml +29 -0
  72. package/gas_comparison.py +49 -0
  73. package/out/BalanceDelta.sol/BalanceDeltaLibrary.json +1 -0
  74. package/out/BeforeSwapDelta.sol/BeforeSwapDeltaLibrary.json +1 -0
  75. package/out/BitMath.sol/BitMath.json +1 -0
  76. package/out/BytesLib.sol/BytesLib.json +1 -0
  77. package/out/CoinCommon.sol/CoinCommon.json +1 -0
  78. package/out/CoinConfigurationVersions.sol/CoinConfigurationVersions.json +1 -0
  79. package/out/CoinConstants.sol/CoinConstants.json +1 -0
  80. package/out/Context.sol/Context.json +1 -0
  81. package/out/Currency.sol/CurrencyLibrary.json +1 -0
  82. package/out/CurrencyReserves.sol/CurrencyReserves.json +1 -0
  83. package/out/CustomRevert.sol/CustomRevert.json +1 -0
  84. package/out/DopplerMath.sol/DopplerMath.json +1 -0
  85. package/out/FixedPoint128.sol/FixedPoint128.json +1 -0
  86. package/out/FixedPoint96.sol/FixedPoint96.json +1 -0
  87. package/out/FullMath.sol/FullMath.json +1 -0
  88. package/out/IAllowanceTransfer.sol/IAllowanceTransfer.json +1 -0
  89. package/out/IAuthority.sol/IAuthority.json +1 -0
  90. package/out/ICoin.sol/ICoin.json +1 -0
  91. package/out/ICoin.sol/IHasCoinType.json +1 -0
  92. package/out/ICoin.sol/IHasPoolKey.json +1 -0
  93. package/out/ICoin.sol/IHasSwapPath.json +1 -0
  94. package/out/ICoin.sol/IHasTotalSupplyForPositions.json +1 -0
  95. package/out/IDeployedCoinVersionLookup.sol/IDeployedCoinVersionLookup.json +1 -0
  96. package/out/IDopplerErrors.sol/IDopplerErrors.json +1 -0
  97. package/out/IEIP712.sol/IEIP712.json +1 -0
  98. package/out/IERC1363.sol/IERC1363.json +1 -0
  99. package/out/IERC165.sol/IERC165.json +1 -0
  100. package/out/IERC20.sol/IERC20.json +1 -0
  101. package/out/IERC20Minimal.sol/IERC20Minimal.json +1 -0
  102. package/out/IERC6909Claims.sol/IERC6909Claims.json +1 -0
  103. package/out/IERC7572.sol/IERC7572.json +1 -0
  104. package/out/IExtsload.sol/IExtsload.json +1 -0
  105. package/out/IExttload.sol/IExttload.json +1 -0
  106. package/out/IHasRewardsRecipients.sol/IHasRewardsRecipients.json +1 -0
  107. package/out/IHooks.sol/IHooks.json +1 -0
  108. package/out/IMsgSender.sol/IMsgSender.json +1 -0
  109. package/out/IPoolManager.sol/IPoolManager.json +1 -0
  110. package/out/IProtocolFees.sol/IProtocolFees.json +1 -0
  111. package/out/ISupportsLimitOrderFill.sol/ISupportsLimitOrderFill.json +1 -0
  112. package/out/ISwapPathRouter.sol/ISwapPathRouter.json +1 -0
  113. package/out/ISwapRouter.sol/ISwapRouter.json +1 -0
  114. package/out/IUniswapV3SwapCallback.sol/IUniswapV3SwapCallback.json +1 -0
  115. package/out/IUpgradeableV4Hook.sol/IUpgradeableDestinationV4Hook.json +1 -0
  116. package/out/IUpgradeableV4Hook.sol/IUpgradeableDestinationV4HookWithUpdateableFee.json +1 -0
  117. package/out/IUpgradeableV4Hook.sol/IUpgradeableV4Hook.json +1 -0
  118. package/out/IZoraHookRegistry.sol/IZoraHookRegistry.json +1 -0
  119. package/out/IZoraLimitOrderBook.sol/IZoraLimitOrderBook.json +1 -0
  120. package/out/IZoraLimitOrderBookCoinsInterface.sol/IZoraLimitOrderBookCoinsInterface.json +1 -0
  121. package/out/IZoraV4CoinHook.sol/IZoraV4CoinHook.json +1 -0
  122. package/out/LimitOrderBitmap.sol/LimitOrderBitmap.json +1 -0
  123. package/out/LimitOrderCommon.sol/LimitOrderCommon.json +1 -0
  124. package/out/LimitOrderCreate.sol/LimitOrderCreate.json +1 -0
  125. package/out/LimitOrderFill.sol/LimitOrderFill.json +1 -0
  126. package/out/LimitOrderLiquidity.sol/LimitOrderLiquidity.json +1 -0
  127. package/out/LimitOrderQueues.sol/LimitOrderQueues.json +1 -0
  128. package/out/LimitOrderStorage.sol/LimitOrderStorage.json +1 -0
  129. package/out/LimitOrderTypes.sol/LimitOrderTypes.json +1 -0
  130. package/out/LimitOrderWithdraw.sol/LimitOrderWithdraw.json +1 -0
  131. package/out/LiquidityAmounts.sol/LiquidityAmounts.json +1 -0
  132. package/out/LiquidityMath.sol/LiquidityMath.json +1 -0
  133. package/out/Lock.sol/Lock.json +1 -0
  134. package/out/NonzeroDeltaCount.sol/NonzeroDeltaCount.json +1 -0
  135. package/out/Path.sol/Path.json +1 -0
  136. package/out/PathKey.sol/PathKeyLibrary.json +1 -0
  137. package/out/Permit2Payments.sol/Permit2Payments.json +1 -0
  138. package/out/PoolId.sol/PoolIdLibrary.json +1 -0
  139. package/out/Position.sol/Position.json +1 -0
  140. package/out/SafeCast.sol/SafeCast.json +1 -0
  141. package/out/SafeCast160.sol/SafeCast160.json +1 -0
  142. package/out/SafeERC20.sol/SafeERC20.json +1 -0
  143. package/out/SimpleAccessManaged.sol/SimpleAccessManaged.json +1 -0
  144. package/out/SimpleAccessManager.sol/SimpleAccessManager.json +1 -0
  145. package/out/SqrtPriceMath.sol/SqrtPriceMath.json +1 -0
  146. package/out/StateLibrary.sol/StateLibrary.json +1 -0
  147. package/out/SwapLimitOrders.sol/SwapLimitOrders.json +1 -0
  148. package/out/SwapWithLimitOrders.sol/SwapWithLimitOrders.json +1 -0
  149. package/out/TickBitmap.sol/TickBitmap.json +1 -0
  150. package/out/TickMath.sol/TickMath.json +1 -0
  151. package/out/TransientSlot.sol/TransientSlot.json +1 -0
  152. package/out/TransientStateLibrary.sol/TransientStateLibrary.json +1 -0
  153. package/out/UniV4SwapToCurrency.sol/UniV4SwapToCurrency.json +1 -0
  154. package/out/UnsafeMath.sol/UnsafeMath.json +1 -0
  155. package/out/V3ToV4SwapLib.sol/V3ToV4SwapLib.json +1 -0
  156. package/out/ZoraLimitOrderBook.sol/ZoraLimitOrderBook.json +1 -0
  157. package/out/build-info/69718f10d1dc37f0.json +1 -0
  158. package/out/uniswap/BitMath.sol/BitMath.json +1 -0
  159. package/out/uniswap/CustomRevert.sol/CustomRevert.json +1 -0
  160. package/out/uniswap/FullMath.sol/FullMath.json +1 -0
  161. package/out/uniswap/SafeCast.sol/SafeCast.json +1 -0
  162. package/out/uniswap/TickMath.sol/TickMath.json +1 -0
  163. package/package/index.ts +1 -0
  164. package/package/wagmiGenerated.ts +738 -0
  165. package/package.json +57 -0
  166. package/remappings.txt +11 -0
  167. package/src/IZoraLimitOrderBook.sol +195 -0
  168. package/src/ZoraLimitOrderBook.sol +220 -0
  169. package/src/access/SimpleAccessManaged.sol +76 -0
  170. package/src/access/SimpleAccessManager.sol +268 -0
  171. package/src/libs/LimitOrderBitmap.sol +84 -0
  172. package/src/libs/LimitOrderCommon.sol +91 -0
  173. package/src/libs/LimitOrderCreate.sol +277 -0
  174. package/src/libs/LimitOrderFill.sol +362 -0
  175. package/src/libs/LimitOrderLiquidity.sol +222 -0
  176. package/src/libs/LimitOrderQueues.sol +101 -0
  177. package/src/libs/LimitOrderStorage.sol +34 -0
  178. package/src/libs/LimitOrderTypes.sol +41 -0
  179. package/src/libs/LimitOrderWithdraw.sol +100 -0
  180. package/src/libs/Permit2Payments.sol +41 -0
  181. package/src/libs/SwapLimitOrders.sol +209 -0
  182. package/src/router/SwapWithLimitOrders.sol +454 -0
  183. package/test/LimitOrderAccessControl.t.sol +461 -0
  184. package/test/LimitOrderBitmap.t.sol +194 -0
  185. package/test/LimitOrderCreate.t.sol +348 -0
  186. package/test/LimitOrderFill.t.sol +1005 -0
  187. package/test/LimitOrderLibraries.t.sol +354 -0
  188. package/test/LimitOrderLiquidityPayouts.t.sol +333 -0
  189. package/test/LimitOrderV4Pools.t.sol +157 -0
  190. package/test/LimitOrderWithdraw.t.sol +653 -0
  191. package/test/SimpleAccessManager.t.sol +420 -0
  192. package/test/SwapWithLimitOrders.t.sol +107 -0
  193. package/test/SwapWithLimitOrdersRouter.t.sol +1073 -0
  194. package/test/gas/LimitOrderFillGas.t.sol +1008 -0
  195. package/test/gas/LimitOrderSwapGas.t.sol +403 -0
  196. package/test/gas/logs/gas_benchmarks_fill_20251201.log +30 -0
  197. package/test/gas/logs/gas_benchmarks_swap_20251201.log +27 -0
  198. package/test/unit/LimitOrderBitmapUnit.t.sol +276 -0
  199. package/test/unit/LimitOrderCreateUnit.t.sol +358 -0
  200. package/test/unit/SwapLimitOrdersUnit.t.sol +672 -0
  201. package/test/unit/SwapLimitOrdersValidation.t.sol +423 -0
  202. package/test/unit/SwapWithLimitOrdersUnit.t.sol +321 -0
  203. package/test/utils/BaseTest.sol +793 -0
  204. package/test/utils/TestableZoraLimitOrderBook.sol +54 -0
  205. package/tsconfig.build.json +10 -0
  206. package/tsconfig.json +9 -0
  207. package/tsup.config.ts +11 -0
  208. package/wagmi.config.ts +18 -0
@@ -0,0 +1,789 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "afterAddLiquidity",
5
+ "inputs": [
6
+ {
7
+ "name": "sender",
8
+ "type": "address",
9
+ "internalType": "address"
10
+ },
11
+ {
12
+ "name": "key",
13
+ "type": "tuple",
14
+ "internalType": "struct PoolKey",
15
+ "components": [
16
+ {
17
+ "name": "currency0",
18
+ "type": "address",
19
+ "internalType": "Currency"
20
+ },
21
+ {
22
+ "name": "currency1",
23
+ "type": "address",
24
+ "internalType": "Currency"
25
+ },
26
+ {
27
+ "name": "fee",
28
+ "type": "uint24",
29
+ "internalType": "uint24"
30
+ },
31
+ {
32
+ "name": "tickSpacing",
33
+ "type": "int24",
34
+ "internalType": "int24"
35
+ },
36
+ {
37
+ "name": "hooks",
38
+ "type": "address",
39
+ "internalType": "contract IHooks"
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "name": "params",
45
+ "type": "tuple",
46
+ "internalType": "struct ModifyLiquidityParams",
47
+ "components": [
48
+ {
49
+ "name": "tickLower",
50
+ "type": "int24",
51
+ "internalType": "int24"
52
+ },
53
+ {
54
+ "name": "tickUpper",
55
+ "type": "int24",
56
+ "internalType": "int24"
57
+ },
58
+ {
59
+ "name": "liquidityDelta",
60
+ "type": "int256",
61
+ "internalType": "int256"
62
+ },
63
+ {
64
+ "name": "salt",
65
+ "type": "bytes32",
66
+ "internalType": "bytes32"
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "name": "delta",
72
+ "type": "int256",
73
+ "internalType": "BalanceDelta"
74
+ },
75
+ {
76
+ "name": "feesAccrued",
77
+ "type": "int256",
78
+ "internalType": "BalanceDelta"
79
+ },
80
+ {
81
+ "name": "hookData",
82
+ "type": "bytes",
83
+ "internalType": "bytes"
84
+ }
85
+ ],
86
+ "outputs": [
87
+ {
88
+ "name": "",
89
+ "type": "bytes4",
90
+ "internalType": "bytes4"
91
+ },
92
+ {
93
+ "name": "",
94
+ "type": "int256",
95
+ "internalType": "BalanceDelta"
96
+ }
97
+ ],
98
+ "stateMutability": "nonpayable"
99
+ },
100
+ {
101
+ "type": "function",
102
+ "name": "afterDonate",
103
+ "inputs": [
104
+ {
105
+ "name": "sender",
106
+ "type": "address",
107
+ "internalType": "address"
108
+ },
109
+ {
110
+ "name": "key",
111
+ "type": "tuple",
112
+ "internalType": "struct PoolKey",
113
+ "components": [
114
+ {
115
+ "name": "currency0",
116
+ "type": "address",
117
+ "internalType": "Currency"
118
+ },
119
+ {
120
+ "name": "currency1",
121
+ "type": "address",
122
+ "internalType": "Currency"
123
+ },
124
+ {
125
+ "name": "fee",
126
+ "type": "uint24",
127
+ "internalType": "uint24"
128
+ },
129
+ {
130
+ "name": "tickSpacing",
131
+ "type": "int24",
132
+ "internalType": "int24"
133
+ },
134
+ {
135
+ "name": "hooks",
136
+ "type": "address",
137
+ "internalType": "contract IHooks"
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "name": "amount0",
143
+ "type": "uint256",
144
+ "internalType": "uint256"
145
+ },
146
+ {
147
+ "name": "amount1",
148
+ "type": "uint256",
149
+ "internalType": "uint256"
150
+ },
151
+ {
152
+ "name": "hookData",
153
+ "type": "bytes",
154
+ "internalType": "bytes"
155
+ }
156
+ ],
157
+ "outputs": [
158
+ {
159
+ "name": "",
160
+ "type": "bytes4",
161
+ "internalType": "bytes4"
162
+ }
163
+ ],
164
+ "stateMutability": "nonpayable"
165
+ },
166
+ {
167
+ "type": "function",
168
+ "name": "afterInitialize",
169
+ "inputs": [
170
+ {
171
+ "name": "sender",
172
+ "type": "address",
173
+ "internalType": "address"
174
+ },
175
+ {
176
+ "name": "key",
177
+ "type": "tuple",
178
+ "internalType": "struct PoolKey",
179
+ "components": [
180
+ {
181
+ "name": "currency0",
182
+ "type": "address",
183
+ "internalType": "Currency"
184
+ },
185
+ {
186
+ "name": "currency1",
187
+ "type": "address",
188
+ "internalType": "Currency"
189
+ },
190
+ {
191
+ "name": "fee",
192
+ "type": "uint24",
193
+ "internalType": "uint24"
194
+ },
195
+ {
196
+ "name": "tickSpacing",
197
+ "type": "int24",
198
+ "internalType": "int24"
199
+ },
200
+ {
201
+ "name": "hooks",
202
+ "type": "address",
203
+ "internalType": "contract IHooks"
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ "name": "sqrtPriceX96",
209
+ "type": "uint160",
210
+ "internalType": "uint160"
211
+ },
212
+ {
213
+ "name": "tick",
214
+ "type": "int24",
215
+ "internalType": "int24"
216
+ }
217
+ ],
218
+ "outputs": [
219
+ {
220
+ "name": "",
221
+ "type": "bytes4",
222
+ "internalType": "bytes4"
223
+ }
224
+ ],
225
+ "stateMutability": "nonpayable"
226
+ },
227
+ {
228
+ "type": "function",
229
+ "name": "afterRemoveLiquidity",
230
+ "inputs": [
231
+ {
232
+ "name": "sender",
233
+ "type": "address",
234
+ "internalType": "address"
235
+ },
236
+ {
237
+ "name": "key",
238
+ "type": "tuple",
239
+ "internalType": "struct PoolKey",
240
+ "components": [
241
+ {
242
+ "name": "currency0",
243
+ "type": "address",
244
+ "internalType": "Currency"
245
+ },
246
+ {
247
+ "name": "currency1",
248
+ "type": "address",
249
+ "internalType": "Currency"
250
+ },
251
+ {
252
+ "name": "fee",
253
+ "type": "uint24",
254
+ "internalType": "uint24"
255
+ },
256
+ {
257
+ "name": "tickSpacing",
258
+ "type": "int24",
259
+ "internalType": "int24"
260
+ },
261
+ {
262
+ "name": "hooks",
263
+ "type": "address",
264
+ "internalType": "contract IHooks"
265
+ }
266
+ ]
267
+ },
268
+ {
269
+ "name": "params",
270
+ "type": "tuple",
271
+ "internalType": "struct ModifyLiquidityParams",
272
+ "components": [
273
+ {
274
+ "name": "tickLower",
275
+ "type": "int24",
276
+ "internalType": "int24"
277
+ },
278
+ {
279
+ "name": "tickUpper",
280
+ "type": "int24",
281
+ "internalType": "int24"
282
+ },
283
+ {
284
+ "name": "liquidityDelta",
285
+ "type": "int256",
286
+ "internalType": "int256"
287
+ },
288
+ {
289
+ "name": "salt",
290
+ "type": "bytes32",
291
+ "internalType": "bytes32"
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "name": "delta",
297
+ "type": "int256",
298
+ "internalType": "BalanceDelta"
299
+ },
300
+ {
301
+ "name": "feesAccrued",
302
+ "type": "int256",
303
+ "internalType": "BalanceDelta"
304
+ },
305
+ {
306
+ "name": "hookData",
307
+ "type": "bytes",
308
+ "internalType": "bytes"
309
+ }
310
+ ],
311
+ "outputs": [
312
+ {
313
+ "name": "",
314
+ "type": "bytes4",
315
+ "internalType": "bytes4"
316
+ },
317
+ {
318
+ "name": "",
319
+ "type": "int256",
320
+ "internalType": "BalanceDelta"
321
+ }
322
+ ],
323
+ "stateMutability": "nonpayable"
324
+ },
325
+ {
326
+ "type": "function",
327
+ "name": "afterSwap",
328
+ "inputs": [
329
+ {
330
+ "name": "sender",
331
+ "type": "address",
332
+ "internalType": "address"
333
+ },
334
+ {
335
+ "name": "key",
336
+ "type": "tuple",
337
+ "internalType": "struct PoolKey",
338
+ "components": [
339
+ {
340
+ "name": "currency0",
341
+ "type": "address",
342
+ "internalType": "Currency"
343
+ },
344
+ {
345
+ "name": "currency1",
346
+ "type": "address",
347
+ "internalType": "Currency"
348
+ },
349
+ {
350
+ "name": "fee",
351
+ "type": "uint24",
352
+ "internalType": "uint24"
353
+ },
354
+ {
355
+ "name": "tickSpacing",
356
+ "type": "int24",
357
+ "internalType": "int24"
358
+ },
359
+ {
360
+ "name": "hooks",
361
+ "type": "address",
362
+ "internalType": "contract IHooks"
363
+ }
364
+ ]
365
+ },
366
+ {
367
+ "name": "params",
368
+ "type": "tuple",
369
+ "internalType": "struct SwapParams",
370
+ "components": [
371
+ {
372
+ "name": "zeroForOne",
373
+ "type": "bool",
374
+ "internalType": "bool"
375
+ },
376
+ {
377
+ "name": "amountSpecified",
378
+ "type": "int256",
379
+ "internalType": "int256"
380
+ },
381
+ {
382
+ "name": "sqrtPriceLimitX96",
383
+ "type": "uint160",
384
+ "internalType": "uint160"
385
+ }
386
+ ]
387
+ },
388
+ {
389
+ "name": "delta",
390
+ "type": "int256",
391
+ "internalType": "BalanceDelta"
392
+ },
393
+ {
394
+ "name": "hookData",
395
+ "type": "bytes",
396
+ "internalType": "bytes"
397
+ }
398
+ ],
399
+ "outputs": [
400
+ {
401
+ "name": "",
402
+ "type": "bytes4",
403
+ "internalType": "bytes4"
404
+ },
405
+ {
406
+ "name": "",
407
+ "type": "int128",
408
+ "internalType": "int128"
409
+ }
410
+ ],
411
+ "stateMutability": "nonpayable"
412
+ },
413
+ {
414
+ "type": "function",
415
+ "name": "beforeAddLiquidity",
416
+ "inputs": [
417
+ {
418
+ "name": "sender",
419
+ "type": "address",
420
+ "internalType": "address"
421
+ },
422
+ {
423
+ "name": "key",
424
+ "type": "tuple",
425
+ "internalType": "struct PoolKey",
426
+ "components": [
427
+ {
428
+ "name": "currency0",
429
+ "type": "address",
430
+ "internalType": "Currency"
431
+ },
432
+ {
433
+ "name": "currency1",
434
+ "type": "address",
435
+ "internalType": "Currency"
436
+ },
437
+ {
438
+ "name": "fee",
439
+ "type": "uint24",
440
+ "internalType": "uint24"
441
+ },
442
+ {
443
+ "name": "tickSpacing",
444
+ "type": "int24",
445
+ "internalType": "int24"
446
+ },
447
+ {
448
+ "name": "hooks",
449
+ "type": "address",
450
+ "internalType": "contract IHooks"
451
+ }
452
+ ]
453
+ },
454
+ {
455
+ "name": "params",
456
+ "type": "tuple",
457
+ "internalType": "struct ModifyLiquidityParams",
458
+ "components": [
459
+ {
460
+ "name": "tickLower",
461
+ "type": "int24",
462
+ "internalType": "int24"
463
+ },
464
+ {
465
+ "name": "tickUpper",
466
+ "type": "int24",
467
+ "internalType": "int24"
468
+ },
469
+ {
470
+ "name": "liquidityDelta",
471
+ "type": "int256",
472
+ "internalType": "int256"
473
+ },
474
+ {
475
+ "name": "salt",
476
+ "type": "bytes32",
477
+ "internalType": "bytes32"
478
+ }
479
+ ]
480
+ },
481
+ {
482
+ "name": "hookData",
483
+ "type": "bytes",
484
+ "internalType": "bytes"
485
+ }
486
+ ],
487
+ "outputs": [
488
+ {
489
+ "name": "",
490
+ "type": "bytes4",
491
+ "internalType": "bytes4"
492
+ }
493
+ ],
494
+ "stateMutability": "nonpayable"
495
+ },
496
+ {
497
+ "type": "function",
498
+ "name": "beforeDonate",
499
+ "inputs": [
500
+ {
501
+ "name": "sender",
502
+ "type": "address",
503
+ "internalType": "address"
504
+ },
505
+ {
506
+ "name": "key",
507
+ "type": "tuple",
508
+ "internalType": "struct PoolKey",
509
+ "components": [
510
+ {
511
+ "name": "currency0",
512
+ "type": "address",
513
+ "internalType": "Currency"
514
+ },
515
+ {
516
+ "name": "currency1",
517
+ "type": "address",
518
+ "internalType": "Currency"
519
+ },
520
+ {
521
+ "name": "fee",
522
+ "type": "uint24",
523
+ "internalType": "uint24"
524
+ },
525
+ {
526
+ "name": "tickSpacing",
527
+ "type": "int24",
528
+ "internalType": "int24"
529
+ },
530
+ {
531
+ "name": "hooks",
532
+ "type": "address",
533
+ "internalType": "contract IHooks"
534
+ }
535
+ ]
536
+ },
537
+ {
538
+ "name": "amount0",
539
+ "type": "uint256",
540
+ "internalType": "uint256"
541
+ },
542
+ {
543
+ "name": "amount1",
544
+ "type": "uint256",
545
+ "internalType": "uint256"
546
+ },
547
+ {
548
+ "name": "hookData",
549
+ "type": "bytes",
550
+ "internalType": "bytes"
551
+ }
552
+ ],
553
+ "outputs": [
554
+ {
555
+ "name": "",
556
+ "type": "bytes4",
557
+ "internalType": "bytes4"
558
+ }
559
+ ],
560
+ "stateMutability": "nonpayable"
561
+ },
562
+ {
563
+ "type": "function",
564
+ "name": "beforeInitialize",
565
+ "inputs": [
566
+ {
567
+ "name": "sender",
568
+ "type": "address",
569
+ "internalType": "address"
570
+ },
571
+ {
572
+ "name": "key",
573
+ "type": "tuple",
574
+ "internalType": "struct PoolKey",
575
+ "components": [
576
+ {
577
+ "name": "currency0",
578
+ "type": "address",
579
+ "internalType": "Currency"
580
+ },
581
+ {
582
+ "name": "currency1",
583
+ "type": "address",
584
+ "internalType": "Currency"
585
+ },
586
+ {
587
+ "name": "fee",
588
+ "type": "uint24",
589
+ "internalType": "uint24"
590
+ },
591
+ {
592
+ "name": "tickSpacing",
593
+ "type": "int24",
594
+ "internalType": "int24"
595
+ },
596
+ {
597
+ "name": "hooks",
598
+ "type": "address",
599
+ "internalType": "contract IHooks"
600
+ }
601
+ ]
602
+ },
603
+ {
604
+ "name": "sqrtPriceX96",
605
+ "type": "uint160",
606
+ "internalType": "uint160"
607
+ }
608
+ ],
609
+ "outputs": [
610
+ {
611
+ "name": "",
612
+ "type": "bytes4",
613
+ "internalType": "bytes4"
614
+ }
615
+ ],
616
+ "stateMutability": "nonpayable"
617
+ },
618
+ {
619
+ "type": "function",
620
+ "name": "beforeRemoveLiquidity",
621
+ "inputs": [
622
+ {
623
+ "name": "sender",
624
+ "type": "address",
625
+ "internalType": "address"
626
+ },
627
+ {
628
+ "name": "key",
629
+ "type": "tuple",
630
+ "internalType": "struct PoolKey",
631
+ "components": [
632
+ {
633
+ "name": "currency0",
634
+ "type": "address",
635
+ "internalType": "Currency"
636
+ },
637
+ {
638
+ "name": "currency1",
639
+ "type": "address",
640
+ "internalType": "Currency"
641
+ },
642
+ {
643
+ "name": "fee",
644
+ "type": "uint24",
645
+ "internalType": "uint24"
646
+ },
647
+ {
648
+ "name": "tickSpacing",
649
+ "type": "int24",
650
+ "internalType": "int24"
651
+ },
652
+ {
653
+ "name": "hooks",
654
+ "type": "address",
655
+ "internalType": "contract IHooks"
656
+ }
657
+ ]
658
+ },
659
+ {
660
+ "name": "params",
661
+ "type": "tuple",
662
+ "internalType": "struct ModifyLiquidityParams",
663
+ "components": [
664
+ {
665
+ "name": "tickLower",
666
+ "type": "int24",
667
+ "internalType": "int24"
668
+ },
669
+ {
670
+ "name": "tickUpper",
671
+ "type": "int24",
672
+ "internalType": "int24"
673
+ },
674
+ {
675
+ "name": "liquidityDelta",
676
+ "type": "int256",
677
+ "internalType": "int256"
678
+ },
679
+ {
680
+ "name": "salt",
681
+ "type": "bytes32",
682
+ "internalType": "bytes32"
683
+ }
684
+ ]
685
+ },
686
+ {
687
+ "name": "hookData",
688
+ "type": "bytes",
689
+ "internalType": "bytes"
690
+ }
691
+ ],
692
+ "outputs": [
693
+ {
694
+ "name": "",
695
+ "type": "bytes4",
696
+ "internalType": "bytes4"
697
+ }
698
+ ],
699
+ "stateMutability": "nonpayable"
700
+ },
701
+ {
702
+ "type": "function",
703
+ "name": "beforeSwap",
704
+ "inputs": [
705
+ {
706
+ "name": "sender",
707
+ "type": "address",
708
+ "internalType": "address"
709
+ },
710
+ {
711
+ "name": "key",
712
+ "type": "tuple",
713
+ "internalType": "struct PoolKey",
714
+ "components": [
715
+ {
716
+ "name": "currency0",
717
+ "type": "address",
718
+ "internalType": "Currency"
719
+ },
720
+ {
721
+ "name": "currency1",
722
+ "type": "address",
723
+ "internalType": "Currency"
724
+ },
725
+ {
726
+ "name": "fee",
727
+ "type": "uint24",
728
+ "internalType": "uint24"
729
+ },
730
+ {
731
+ "name": "tickSpacing",
732
+ "type": "int24",
733
+ "internalType": "int24"
734
+ },
735
+ {
736
+ "name": "hooks",
737
+ "type": "address",
738
+ "internalType": "contract IHooks"
739
+ }
740
+ ]
741
+ },
742
+ {
743
+ "name": "params",
744
+ "type": "tuple",
745
+ "internalType": "struct SwapParams",
746
+ "components": [
747
+ {
748
+ "name": "zeroForOne",
749
+ "type": "bool",
750
+ "internalType": "bool"
751
+ },
752
+ {
753
+ "name": "amountSpecified",
754
+ "type": "int256",
755
+ "internalType": "int256"
756
+ },
757
+ {
758
+ "name": "sqrtPriceLimitX96",
759
+ "type": "uint160",
760
+ "internalType": "uint160"
761
+ }
762
+ ]
763
+ },
764
+ {
765
+ "name": "hookData",
766
+ "type": "bytes",
767
+ "internalType": "bytes"
768
+ }
769
+ ],
770
+ "outputs": [
771
+ {
772
+ "name": "",
773
+ "type": "bytes4",
774
+ "internalType": "bytes4"
775
+ },
776
+ {
777
+ "name": "",
778
+ "type": "int256",
779
+ "internalType": "BeforeSwapDelta"
780
+ },
781
+ {
782
+ "name": "",
783
+ "type": "uint24",
784
+ "internalType": "uint24"
785
+ }
786
+ ],
787
+ "stateMutability": "nonpayable"
788
+ }
789
+ ]