@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,610 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "getPoolCoin",
5
+ "inputs": [
6
+ {
7
+ "name": "key",
8
+ "type": "tuple",
9
+ "internalType": "struct PoolKey",
10
+ "components": [
11
+ {
12
+ "name": "currency0",
13
+ "type": "address",
14
+ "internalType": "Currency"
15
+ },
16
+ {
17
+ "name": "currency1",
18
+ "type": "address",
19
+ "internalType": "Currency"
20
+ },
21
+ {
22
+ "name": "fee",
23
+ "type": "uint24",
24
+ "internalType": "uint24"
25
+ },
26
+ {
27
+ "name": "tickSpacing",
28
+ "type": "int24",
29
+ "internalType": "int24"
30
+ },
31
+ {
32
+ "name": "hooks",
33
+ "type": "address",
34
+ "internalType": "contract IHooks"
35
+ }
36
+ ]
37
+ }
38
+ ],
39
+ "outputs": [
40
+ {
41
+ "name": "",
42
+ "type": "tuple",
43
+ "internalType": "struct IZoraV4CoinHook.PoolCoin",
44
+ "components": [
45
+ {
46
+ "name": "coin",
47
+ "type": "address",
48
+ "internalType": "address"
49
+ },
50
+ {
51
+ "name": "positions",
52
+ "type": "tuple[]",
53
+ "internalType": "struct LpPosition[]",
54
+ "components": [
55
+ {
56
+ "name": "tickLower",
57
+ "type": "int24",
58
+ "internalType": "int24"
59
+ },
60
+ {
61
+ "name": "tickUpper",
62
+ "type": "int24",
63
+ "internalType": "int24"
64
+ },
65
+ {
66
+ "name": "liquidity",
67
+ "type": "uint128",
68
+ "internalType": "uint128"
69
+ }
70
+ ]
71
+ }
72
+ ]
73
+ }
74
+ ],
75
+ "stateMutability": "view"
76
+ },
77
+ {
78
+ "type": "function",
79
+ "name": "getPoolCoinByHash",
80
+ "inputs": [
81
+ {
82
+ "name": "poolKeyHash",
83
+ "type": "bytes32",
84
+ "internalType": "bytes32"
85
+ }
86
+ ],
87
+ "outputs": [
88
+ {
89
+ "name": "",
90
+ "type": "tuple",
91
+ "internalType": "struct IZoraV4CoinHook.PoolCoin",
92
+ "components": [
93
+ {
94
+ "name": "coin",
95
+ "type": "address",
96
+ "internalType": "address"
97
+ },
98
+ {
99
+ "name": "positions",
100
+ "type": "tuple[]",
101
+ "internalType": "struct LpPosition[]",
102
+ "components": [
103
+ {
104
+ "name": "tickLower",
105
+ "type": "int24",
106
+ "internalType": "int24"
107
+ },
108
+ {
109
+ "name": "tickUpper",
110
+ "type": "int24",
111
+ "internalType": "int24"
112
+ },
113
+ {
114
+ "name": "liquidity",
115
+ "type": "uint128",
116
+ "internalType": "uint128"
117
+ }
118
+ ]
119
+ }
120
+ ]
121
+ }
122
+ ],
123
+ "stateMutability": "view"
124
+ },
125
+ {
126
+ "type": "function",
127
+ "name": "isTrustedMessageSender",
128
+ "inputs": [
129
+ {
130
+ "name": "sender",
131
+ "type": "address",
132
+ "internalType": "address"
133
+ }
134
+ ],
135
+ "outputs": [
136
+ {
137
+ "name": "",
138
+ "type": "bool",
139
+ "internalType": "bool"
140
+ }
141
+ ],
142
+ "stateMutability": "view"
143
+ },
144
+ {
145
+ "type": "function",
146
+ "name": "migrateLiquidity",
147
+ "inputs": [
148
+ {
149
+ "name": "newHook",
150
+ "type": "address",
151
+ "internalType": "address"
152
+ },
153
+ {
154
+ "name": "poolKey",
155
+ "type": "tuple",
156
+ "internalType": "struct PoolKey",
157
+ "components": [
158
+ {
159
+ "name": "currency0",
160
+ "type": "address",
161
+ "internalType": "Currency"
162
+ },
163
+ {
164
+ "name": "currency1",
165
+ "type": "address",
166
+ "internalType": "Currency"
167
+ },
168
+ {
169
+ "name": "fee",
170
+ "type": "uint24",
171
+ "internalType": "uint24"
172
+ },
173
+ {
174
+ "name": "tickSpacing",
175
+ "type": "int24",
176
+ "internalType": "int24"
177
+ },
178
+ {
179
+ "name": "hooks",
180
+ "type": "address",
181
+ "internalType": "contract IHooks"
182
+ }
183
+ ]
184
+ },
185
+ {
186
+ "name": "additionalData",
187
+ "type": "bytes",
188
+ "internalType": "bytes"
189
+ }
190
+ ],
191
+ "outputs": [
192
+ {
193
+ "name": "newPoolKey",
194
+ "type": "tuple",
195
+ "internalType": "struct PoolKey",
196
+ "components": [
197
+ {
198
+ "name": "currency0",
199
+ "type": "address",
200
+ "internalType": "Currency"
201
+ },
202
+ {
203
+ "name": "currency1",
204
+ "type": "address",
205
+ "internalType": "Currency"
206
+ },
207
+ {
208
+ "name": "fee",
209
+ "type": "uint24",
210
+ "internalType": "uint24"
211
+ },
212
+ {
213
+ "name": "tickSpacing",
214
+ "type": "int24",
215
+ "internalType": "int24"
216
+ },
217
+ {
218
+ "name": "hooks",
219
+ "type": "address",
220
+ "internalType": "contract IHooks"
221
+ }
222
+ ]
223
+ }
224
+ ],
225
+ "stateMutability": "nonpayable"
226
+ },
227
+ {
228
+ "type": "event",
229
+ "name": "CoinMarketRewardsV4",
230
+ "inputs": [
231
+ {
232
+ "name": "coin",
233
+ "type": "address",
234
+ "indexed": false,
235
+ "internalType": "address"
236
+ },
237
+ {
238
+ "name": "currency",
239
+ "type": "address",
240
+ "indexed": false,
241
+ "internalType": "address"
242
+ },
243
+ {
244
+ "name": "payoutRecipient",
245
+ "type": "address",
246
+ "indexed": false,
247
+ "internalType": "address"
248
+ },
249
+ {
250
+ "name": "platformReferrer",
251
+ "type": "address",
252
+ "indexed": false,
253
+ "internalType": "address"
254
+ },
255
+ {
256
+ "name": "tradeReferrer",
257
+ "type": "address",
258
+ "indexed": false,
259
+ "internalType": "address"
260
+ },
261
+ {
262
+ "name": "protocolRewardRecipient",
263
+ "type": "address",
264
+ "indexed": false,
265
+ "internalType": "address"
266
+ },
267
+ {
268
+ "name": "dopplerRecipient",
269
+ "type": "address",
270
+ "indexed": false,
271
+ "internalType": "address"
272
+ },
273
+ {
274
+ "name": "marketRewards",
275
+ "type": "tuple",
276
+ "indexed": false,
277
+ "internalType": "struct IZoraV4CoinHook.MarketRewardsV4",
278
+ "components": [
279
+ {
280
+ "name": "creatorPayoutAmountCurrency",
281
+ "type": "uint256",
282
+ "internalType": "uint256"
283
+ },
284
+ {
285
+ "name": "creatorPayoutAmountCoin",
286
+ "type": "uint256",
287
+ "internalType": "uint256"
288
+ },
289
+ {
290
+ "name": "platformReferrerAmountCurrency",
291
+ "type": "uint256",
292
+ "internalType": "uint256"
293
+ },
294
+ {
295
+ "name": "platformReferrerAmountCoin",
296
+ "type": "uint256",
297
+ "internalType": "uint256"
298
+ },
299
+ {
300
+ "name": "tradeReferrerAmountCurrency",
301
+ "type": "uint256",
302
+ "internalType": "uint256"
303
+ },
304
+ {
305
+ "name": "tradeReferrerAmountCoin",
306
+ "type": "uint256",
307
+ "internalType": "uint256"
308
+ },
309
+ {
310
+ "name": "protocolAmountCurrency",
311
+ "type": "uint256",
312
+ "internalType": "uint256"
313
+ },
314
+ {
315
+ "name": "protocolAmountCoin",
316
+ "type": "uint256",
317
+ "internalType": "uint256"
318
+ },
319
+ {
320
+ "name": "dopplerAmountCurrency",
321
+ "type": "uint256",
322
+ "internalType": "uint256"
323
+ },
324
+ {
325
+ "name": "dopplerAmountCoin",
326
+ "type": "uint256",
327
+ "internalType": "uint256"
328
+ }
329
+ ]
330
+ }
331
+ ],
332
+ "anonymous": false
333
+ },
334
+ {
335
+ "type": "event",
336
+ "name": "LpReward",
337
+ "inputs": [
338
+ {
339
+ "name": "coin",
340
+ "type": "address",
341
+ "indexed": true,
342
+ "internalType": "address"
343
+ },
344
+ {
345
+ "name": "currency",
346
+ "type": "address",
347
+ "indexed": true,
348
+ "internalType": "address"
349
+ },
350
+ {
351
+ "name": "amountCurrency",
352
+ "type": "uint256",
353
+ "indexed": false,
354
+ "internalType": "uint256"
355
+ },
356
+ {
357
+ "name": "tick",
358
+ "type": "int24",
359
+ "indexed": false,
360
+ "internalType": "int24"
361
+ },
362
+ {
363
+ "name": "liquidity",
364
+ "type": "uint128",
365
+ "indexed": false,
366
+ "internalType": "uint128"
367
+ }
368
+ ],
369
+ "anonymous": false
370
+ },
371
+ {
372
+ "type": "event",
373
+ "name": "Swapped",
374
+ "inputs": [
375
+ {
376
+ "name": "sender",
377
+ "type": "address",
378
+ "indexed": true,
379
+ "internalType": "address"
380
+ },
381
+ {
382
+ "name": "swapSender",
383
+ "type": "address",
384
+ "indexed": true,
385
+ "internalType": "address"
386
+ },
387
+ {
388
+ "name": "isTrustedSwapSenderAddress",
389
+ "type": "bool",
390
+ "indexed": false,
391
+ "internalType": "bool"
392
+ },
393
+ {
394
+ "name": "key",
395
+ "type": "tuple",
396
+ "indexed": false,
397
+ "internalType": "struct PoolKey",
398
+ "components": [
399
+ {
400
+ "name": "currency0",
401
+ "type": "address",
402
+ "internalType": "Currency"
403
+ },
404
+ {
405
+ "name": "currency1",
406
+ "type": "address",
407
+ "internalType": "Currency"
408
+ },
409
+ {
410
+ "name": "fee",
411
+ "type": "uint24",
412
+ "internalType": "uint24"
413
+ },
414
+ {
415
+ "name": "tickSpacing",
416
+ "type": "int24",
417
+ "internalType": "int24"
418
+ },
419
+ {
420
+ "name": "hooks",
421
+ "type": "address",
422
+ "internalType": "contract IHooks"
423
+ }
424
+ ]
425
+ },
426
+ {
427
+ "name": "poolKeyHash",
428
+ "type": "bytes32",
429
+ "indexed": true,
430
+ "internalType": "bytes32"
431
+ },
432
+ {
433
+ "name": "params",
434
+ "type": "tuple",
435
+ "indexed": false,
436
+ "internalType": "struct SwapParams",
437
+ "components": [
438
+ {
439
+ "name": "zeroForOne",
440
+ "type": "bool",
441
+ "internalType": "bool"
442
+ },
443
+ {
444
+ "name": "amountSpecified",
445
+ "type": "int256",
446
+ "internalType": "int256"
447
+ },
448
+ {
449
+ "name": "sqrtPriceLimitX96",
450
+ "type": "uint160",
451
+ "internalType": "uint160"
452
+ }
453
+ ]
454
+ },
455
+ {
456
+ "name": "amount0",
457
+ "type": "int128",
458
+ "indexed": false,
459
+ "internalType": "int128"
460
+ },
461
+ {
462
+ "name": "amount1",
463
+ "type": "int128",
464
+ "indexed": false,
465
+ "internalType": "int128"
466
+ },
467
+ {
468
+ "name": "isCoinBuy",
469
+ "type": "bool",
470
+ "indexed": false,
471
+ "internalType": "bool"
472
+ },
473
+ {
474
+ "name": "hookData",
475
+ "type": "bytes",
476
+ "indexed": false,
477
+ "internalType": "bytes"
478
+ },
479
+ {
480
+ "name": "sqrtPriceX96",
481
+ "type": "uint160",
482
+ "indexed": false,
483
+ "internalType": "uint160"
484
+ }
485
+ ],
486
+ "anonymous": false
487
+ },
488
+ {
489
+ "type": "error",
490
+ "name": "CoinVersionLookupCannotBeZeroAddress",
491
+ "inputs": []
492
+ },
493
+ {
494
+ "type": "error",
495
+ "name": "InvalidNewHook",
496
+ "inputs": [
497
+ {
498
+ "name": "newHook",
499
+ "type": "address",
500
+ "internalType": "address"
501
+ }
502
+ ]
503
+ },
504
+ {
505
+ "type": "error",
506
+ "name": "NoCoinForHook",
507
+ "inputs": [
508
+ {
509
+ "name": "key",
510
+ "type": "tuple",
511
+ "internalType": "struct PoolKey",
512
+ "components": [
513
+ {
514
+ "name": "currency0",
515
+ "type": "address",
516
+ "internalType": "Currency"
517
+ },
518
+ {
519
+ "name": "currency1",
520
+ "type": "address",
521
+ "internalType": "Currency"
522
+ },
523
+ {
524
+ "name": "fee",
525
+ "type": "uint24",
526
+ "internalType": "uint24"
527
+ },
528
+ {
529
+ "name": "tickSpacing",
530
+ "type": "int24",
531
+ "internalType": "int24"
532
+ },
533
+ {
534
+ "name": "hooks",
535
+ "type": "address",
536
+ "internalType": "contract IHooks"
537
+ }
538
+ ]
539
+ }
540
+ ]
541
+ },
542
+ {
543
+ "type": "error",
544
+ "name": "NotACoin",
545
+ "inputs": [
546
+ {
547
+ "name": "coin",
548
+ "type": "address",
549
+ "internalType": "address"
550
+ }
551
+ ]
552
+ },
553
+ {
554
+ "type": "error",
555
+ "name": "OnlyCoin",
556
+ "inputs": [
557
+ {
558
+ "name": "caller",
559
+ "type": "address",
560
+ "internalType": "address"
561
+ },
562
+ {
563
+ "name": "expectedCoin",
564
+ "type": "address",
565
+ "internalType": "address"
566
+ }
567
+ ]
568
+ },
569
+ {
570
+ "type": "error",
571
+ "name": "PathMustHaveAtLeastOneStep",
572
+ "inputs": []
573
+ },
574
+ {
575
+ "type": "error",
576
+ "name": "TrustedMsgSenderLookupCannotBeZeroAddress",
577
+ "inputs": []
578
+ },
579
+ {
580
+ "type": "error",
581
+ "name": "UpgradeGateCannotBeZeroAddress",
582
+ "inputs": []
583
+ },
584
+ {
585
+ "type": "error",
586
+ "name": "UpgradePathNotRegistered",
587
+ "inputs": [
588
+ {
589
+ "name": "oldHook",
590
+ "type": "address",
591
+ "internalType": "address"
592
+ },
593
+ {
594
+ "name": "newHook",
595
+ "type": "address",
596
+ "internalType": "address"
597
+ }
598
+ ]
599
+ },
600
+ {
601
+ "type": "error",
602
+ "name": "ZoraHookRegistryCannotBeZeroAddress",
603
+ "inputs": []
604
+ },
605
+ {
606
+ "type": "error",
607
+ "name": "ZoraLimitOrderBookCannotBeZeroAddress",
608
+ "inputs": []
609
+ }
610
+ ]
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "FromAddressIsNotOwner",
5
+ "inputs": []
6
+ }
7
+ ]
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "CannotUpdateEmptyPosition",
5
+ "inputs": []
6
+ }
7
+ ]
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "SafeCastOverflow",
5
+ "inputs": []
6
+ }
7
+ ]
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "UnsafeCast",
5
+ "inputs": []
6
+ }
7
+ ]
@@ -0,0 +1,34 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "SafeERC20FailedDecreaseAllowance",
5
+ "inputs": [
6
+ {
7
+ "name": "spender",
8
+ "type": "address",
9
+ "internalType": "address"
10
+ },
11
+ {
12
+ "name": "currentAllowance",
13
+ "type": "uint256",
14
+ "internalType": "uint256"
15
+ },
16
+ {
17
+ "name": "requestedDecrease",
18
+ "type": "uint256",
19
+ "internalType": "uint256"
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "type": "error",
25
+ "name": "SafeERC20FailedOperation",
26
+ "inputs": [
27
+ {
28
+ "name": "token",
29
+ "type": "address",
30
+ "internalType": "address"
31
+ }
32
+ ]
33
+ }
34
+ ]