@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
package/dist/index.js ADDED
@@ -0,0 +1,731 @@
1
+ // package/wagmiGenerated.ts
2
+ var iZoraLimitOrderBookCoinsInterfaceABI = [
3
+ {
4
+ type: "function",
5
+ inputs: [
6
+ {
7
+ name: "key",
8
+ internalType: "struct PoolKey",
9
+ type: "tuple",
10
+ components: [
11
+ { name: "currency0", internalType: "Currency", type: "address" },
12
+ { name: "currency1", internalType: "Currency", type: "address" },
13
+ { name: "fee", internalType: "uint24", type: "uint24" },
14
+ { name: "tickSpacing", internalType: "int24", type: "int24" },
15
+ { name: "hooks", internalType: "contract IHooks", type: "address" }
16
+ ]
17
+ },
18
+ { name: "isCurrency0", internalType: "bool", type: "bool" },
19
+ { name: "startTick", internalType: "int24", type: "int24" },
20
+ { name: "endTick", internalType: "int24", type: "int24" },
21
+ { name: "maxFillCount", internalType: "uint256", type: "uint256" },
22
+ { name: "fillReferral", internalType: "address", type: "address" }
23
+ ],
24
+ name: "fill",
25
+ outputs: [],
26
+ stateMutability: "nonpayable"
27
+ }
28
+ ];
29
+ var swapWithLimitOrdersABI = [
30
+ {
31
+ type: "constructor",
32
+ inputs: [
33
+ {
34
+ name: "poolManager_",
35
+ internalType: "contract IPoolManager",
36
+ type: "address"
37
+ },
38
+ {
39
+ name: "zoraLimitOrderBook_",
40
+ internalType: "contract IZoraLimitOrderBook",
41
+ type: "address"
42
+ },
43
+ {
44
+ name: "swapRouter_",
45
+ internalType: "contract ISwapRouter",
46
+ type: "address"
47
+ },
48
+ { name: "permit2_", internalType: "address", type: "address" }
49
+ ],
50
+ stateMutability: "nonpayable"
51
+ },
52
+ { type: "receive", stateMutability: "payable" },
53
+ {
54
+ type: "function",
55
+ inputs: [],
56
+ name: "getLimitOrderConfig",
57
+ outputs: [
58
+ {
59
+ name: "",
60
+ internalType: "struct LimitOrderConfig",
61
+ type: "tuple",
62
+ components: [
63
+ { name: "multiples", internalType: "uint256[]", type: "uint256[]" },
64
+ { name: "percentages", internalType: "uint256[]", type: "uint256[]" }
65
+ ]
66
+ }
67
+ ],
68
+ stateMutability: "view"
69
+ },
70
+ {
71
+ type: "function",
72
+ inputs: [],
73
+ name: "msgSender",
74
+ outputs: [{ name: "", internalType: "address", type: "address" }],
75
+ stateMutability: "view"
76
+ },
77
+ {
78
+ type: "function",
79
+ inputs: [],
80
+ name: "poolManager",
81
+ outputs: [
82
+ { name: "", internalType: "contract IPoolManager", type: "address" }
83
+ ],
84
+ stateMutability: "view"
85
+ },
86
+ {
87
+ type: "function",
88
+ inputs: [
89
+ {
90
+ name: "config",
91
+ internalType: "struct LimitOrderConfig",
92
+ type: "tuple",
93
+ components: [
94
+ { name: "multiples", internalType: "uint256[]", type: "uint256[]" },
95
+ { name: "percentages", internalType: "uint256[]", type: "uint256[]" }
96
+ ]
97
+ }
98
+ ],
99
+ name: "setLimitOrderConfig",
100
+ outputs: [],
101
+ stateMutability: "nonpayable"
102
+ },
103
+ {
104
+ type: "function",
105
+ inputs: [],
106
+ name: "swapRouter",
107
+ outputs: [
108
+ { name: "", internalType: "contract ISwapRouter", type: "address" }
109
+ ],
110
+ stateMutability: "view"
111
+ },
112
+ {
113
+ type: "function",
114
+ inputs: [
115
+ {
116
+ name: "params",
117
+ internalType: "struct SwapWithLimitOrders.SwapWithLimitOrdersParams",
118
+ type: "tuple",
119
+ components: [
120
+ { name: "recipient", internalType: "address", type: "address" },
121
+ {
122
+ name: "limitOrderConfig",
123
+ internalType: "struct LimitOrderConfig",
124
+ type: "tuple",
125
+ components: [
126
+ {
127
+ name: "multiples",
128
+ internalType: "uint256[]",
129
+ type: "uint256[]"
130
+ },
131
+ {
132
+ name: "percentages",
133
+ internalType: "uint256[]",
134
+ type: "uint256[]"
135
+ }
136
+ ]
137
+ },
138
+ { name: "inputCurrency", internalType: "address", type: "address" },
139
+ { name: "inputAmount", internalType: "uint256", type: "uint256" },
140
+ { name: "v3Route", internalType: "bytes", type: "bytes" },
141
+ {
142
+ name: "v4Route",
143
+ internalType: "struct PoolKey[]",
144
+ type: "tuple[]",
145
+ components: [
146
+ { name: "currency0", internalType: "Currency", type: "address" },
147
+ { name: "currency1", internalType: "Currency", type: "address" },
148
+ { name: "fee", internalType: "uint24", type: "uint24" },
149
+ { name: "tickSpacing", internalType: "int24", type: "int24" },
150
+ {
151
+ name: "hooks",
152
+ internalType: "contract IHooks",
153
+ type: "address"
154
+ }
155
+ ]
156
+ },
157
+ { name: "minAmountOut", internalType: "uint256", type: "uint256" }
158
+ ]
159
+ }
160
+ ],
161
+ name: "swapWithLimitOrders",
162
+ outputs: [{ name: "delta", internalType: "BalanceDelta", type: "int256" }],
163
+ stateMutability: "payable"
164
+ },
165
+ {
166
+ type: "function",
167
+ inputs: [{ name: "data", internalType: "bytes", type: "bytes" }],
168
+ name: "unlockCallback",
169
+ outputs: [{ name: "", internalType: "bytes", type: "bytes" }],
170
+ stateMutability: "nonpayable"
171
+ },
172
+ {
173
+ type: "function",
174
+ inputs: [],
175
+ name: "zoraLimitOrderBook",
176
+ outputs: [
177
+ {
178
+ name: "",
179
+ internalType: "contract IZoraLimitOrderBook",
180
+ type: "address"
181
+ }
182
+ ],
183
+ stateMutability: "view"
184
+ },
185
+ {
186
+ type: "event",
187
+ anonymous: false,
188
+ inputs: [
189
+ {
190
+ name: "multiples",
191
+ internalType: "uint256[]",
192
+ type: "uint256[]",
193
+ indexed: false
194
+ },
195
+ {
196
+ name: "percentages",
197
+ internalType: "uint256[]",
198
+ type: "uint256[]",
199
+ indexed: false
200
+ }
201
+ ],
202
+ name: "LimitOrderConfigUpdated"
203
+ },
204
+ {
205
+ type: "event",
206
+ anonymous: false,
207
+ inputs: [
208
+ {
209
+ name: "sender",
210
+ internalType: "address",
211
+ type: "address",
212
+ indexed: true
213
+ },
214
+ {
215
+ name: "recipient",
216
+ internalType: "address",
217
+ type: "address",
218
+ indexed: true
219
+ },
220
+ {
221
+ name: "poolKey",
222
+ internalType: "struct PoolKey",
223
+ type: "tuple",
224
+ components: [
225
+ { name: "currency0", internalType: "Currency", type: "address" },
226
+ { name: "currency1", internalType: "Currency", type: "address" },
227
+ { name: "fee", internalType: "uint24", type: "uint24" },
228
+ { name: "tickSpacing", internalType: "int24", type: "int24" },
229
+ { name: "hooks", internalType: "contract IHooks", type: "address" }
230
+ ],
231
+ indexed: false
232
+ },
233
+ {
234
+ name: "delta",
235
+ internalType: "BalanceDelta",
236
+ type: "int256",
237
+ indexed: false
238
+ },
239
+ {
240
+ name: "tickBeforeSwap",
241
+ internalType: "int24",
242
+ type: "int24",
243
+ indexed: false
244
+ },
245
+ {
246
+ name: "tickAfterSwap",
247
+ internalType: "int24",
248
+ type: "int24",
249
+ indexed: false
250
+ },
251
+ {
252
+ name: "orders",
253
+ internalType: "struct SwapWithLimitOrders.CreatedOrder[]",
254
+ type: "tuple[]",
255
+ components: [
256
+ { name: "orderId", internalType: "bytes32", type: "bytes32" },
257
+ { name: "multiple", internalType: "uint256", type: "uint256" },
258
+ { name: "percentage", internalType: "uint256", type: "uint256" }
259
+ ],
260
+ indexed: false
261
+ }
262
+ ],
263
+ name: "SwapWithLimitOrdersExecuted"
264
+ },
265
+ { type: "error", inputs: [], name: "EmptyV4Route" },
266
+ { type: "error", inputs: [], name: "FromAddressIsNotOwner" },
267
+ {
268
+ type: "error",
269
+ inputs: [
270
+ { name: "inputAmount", internalType: "uint256", type: "uint256" },
271
+ { name: "availableAmount", internalType: "uint256", type: "uint256" }
272
+ ],
273
+ name: "InsufficientInputCurrency"
274
+ },
275
+ { type: "error", inputs: [], name: "InsufficientOutputAmount" },
276
+ { type: "error", inputs: [], name: "InsufficientTransferFunds" },
277
+ { type: "error", inputs: [], name: "InvalidLimitOrderConfig" },
278
+ { type: "error", inputs: [], name: "InvalidMultiple" },
279
+ { type: "error", inputs: [], name: "InvalidPercent" },
280
+ { type: "error", inputs: [], name: "LengthMismatch" },
281
+ { type: "error", inputs: [], name: "OnlyAuthority" },
282
+ { type: "error", inputs: [], name: "OnlyPoolManager" },
283
+ { type: "error", inputs: [], name: "PercentOverflow" },
284
+ {
285
+ type: "error",
286
+ inputs: [{ name: "token", internalType: "address", type: "address" }],
287
+ name: "SafeERC20FailedOperation"
288
+ },
289
+ { type: "error", inputs: [], name: "UnsafeCast" },
290
+ { type: "error", inputs: [], name: "V3RouteDoesNotConnectToV4RouteStart" },
291
+ { type: "error", inputs: [], name: "ZeroSwapDelta" }
292
+ ];
293
+ var zoraLimitOrderBookABI = [
294
+ {
295
+ type: "constructor",
296
+ inputs: [
297
+ { name: "poolManager_", internalType: "address", type: "address" },
298
+ {
299
+ name: "zoraCoinVersionLookup_",
300
+ internalType: "address",
301
+ type: "address"
302
+ },
303
+ { name: "zoraHookRegistry_", internalType: "address", type: "address" },
304
+ { name: "authority_", internalType: "address", type: "address" }
305
+ ],
306
+ stateMutability: "nonpayable"
307
+ },
308
+ { type: "receive", stateMutability: "payable" },
309
+ {
310
+ type: "function",
311
+ inputs: [],
312
+ name: "authority",
313
+ outputs: [{ name: "", internalType: "address", type: "address" }],
314
+ stateMutability: "view"
315
+ },
316
+ {
317
+ type: "function",
318
+ inputs: [
319
+ { name: "maker", internalType: "address", type: "address" },
320
+ { name: "coin", internalType: "address", type: "address" }
321
+ ],
322
+ name: "balanceOf",
323
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
324
+ stateMutability: "view"
325
+ },
326
+ {
327
+ type: "function",
328
+ inputs: [
329
+ {
330
+ name: "key",
331
+ internalType: "struct PoolKey",
332
+ type: "tuple",
333
+ components: [
334
+ { name: "currency0", internalType: "Currency", type: "address" },
335
+ { name: "currency1", internalType: "Currency", type: "address" },
336
+ { name: "fee", internalType: "uint24", type: "uint24" },
337
+ { name: "tickSpacing", internalType: "int24", type: "int24" },
338
+ { name: "hooks", internalType: "contract IHooks", type: "address" }
339
+ ]
340
+ },
341
+ { name: "isCurrency0", internalType: "bool", type: "bool" },
342
+ { name: "orderSizes", internalType: "uint256[]", type: "uint256[]" },
343
+ { name: "orderTicks", internalType: "int24[]", type: "int24[]" },
344
+ { name: "maker", internalType: "address", type: "address" }
345
+ ],
346
+ name: "create",
347
+ outputs: [{ name: "", internalType: "bytes32[]", type: "bytes32[]" }],
348
+ stateMutability: "payable"
349
+ },
350
+ {
351
+ type: "function",
352
+ inputs: [
353
+ {
354
+ name: "key",
355
+ internalType: "struct PoolKey",
356
+ type: "tuple",
357
+ components: [
358
+ { name: "currency0", internalType: "Currency", type: "address" },
359
+ { name: "currency1", internalType: "Currency", type: "address" },
360
+ { name: "fee", internalType: "uint24", type: "uint24" },
361
+ { name: "tickSpacing", internalType: "int24", type: "int24" },
362
+ { name: "hooks", internalType: "contract IHooks", type: "address" }
363
+ ]
364
+ },
365
+ { name: "isCurrency0", internalType: "bool", type: "bool" },
366
+ { name: "startTick", internalType: "int24", type: "int24" },
367
+ { name: "endTick", internalType: "int24", type: "int24" },
368
+ { name: "maxFillCount", internalType: "uint256", type: "uint256" },
369
+ { name: "fillReferral", internalType: "address", type: "address" }
370
+ ],
371
+ name: "fill",
372
+ outputs: [],
373
+ stateMutability: "nonpayable"
374
+ },
375
+ {
376
+ type: "function",
377
+ inputs: [
378
+ {
379
+ name: "batches",
380
+ internalType: "struct IZoraLimitOrderBook.OrderBatch[]",
381
+ type: "tuple[]",
382
+ components: [
383
+ {
384
+ name: "key",
385
+ internalType: "struct PoolKey",
386
+ type: "tuple",
387
+ components: [
388
+ { name: "currency0", internalType: "Currency", type: "address" },
389
+ { name: "currency1", internalType: "Currency", type: "address" },
390
+ { name: "fee", internalType: "uint24", type: "uint24" },
391
+ { name: "tickSpacing", internalType: "int24", type: "int24" },
392
+ {
393
+ name: "hooks",
394
+ internalType: "contract IHooks",
395
+ type: "address"
396
+ }
397
+ ]
398
+ },
399
+ { name: "isCurrency0", internalType: "bool", type: "bool" },
400
+ { name: "orderIds", internalType: "bytes32[]", type: "bytes32[]" }
401
+ ]
402
+ },
403
+ { name: "fillReferral", internalType: "address", type: "address" }
404
+ ],
405
+ name: "fill",
406
+ outputs: [],
407
+ stateMutability: "nonpayable"
408
+ },
409
+ {
410
+ type: "function",
411
+ inputs: [],
412
+ name: "getMaxFillCount",
413
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
414
+ stateMutability: "view"
415
+ },
416
+ {
417
+ type: "function",
418
+ inputs: [],
419
+ name: "poolManager",
420
+ outputs: [
421
+ { name: "", internalType: "contract IPoolManager", type: "address" }
422
+ ],
423
+ stateMutability: "view"
424
+ },
425
+ {
426
+ type: "function",
427
+ inputs: [
428
+ { name: "newAuthority", internalType: "address", type: "address" }
429
+ ],
430
+ name: "setAuthority",
431
+ outputs: [],
432
+ stateMutability: "nonpayable"
433
+ },
434
+ {
435
+ type: "function",
436
+ inputs: [
437
+ { name: "maxFillCount", internalType: "uint256", type: "uint256" }
438
+ ],
439
+ name: "setMaxFillCount",
440
+ outputs: [],
441
+ stateMutability: "nonpayable"
442
+ },
443
+ {
444
+ type: "function",
445
+ inputs: [{ name: "data", internalType: "bytes", type: "bytes" }],
446
+ name: "unlockCallback",
447
+ outputs: [{ name: "", internalType: "bytes", type: "bytes" }],
448
+ stateMutability: "nonpayable"
449
+ },
450
+ {
451
+ type: "function",
452
+ inputs: [
453
+ { name: "orderIds", internalType: "bytes32[]", type: "bytes32[]" },
454
+ { name: "coin", internalType: "address", type: "address" },
455
+ { name: "minAmountOut", internalType: "uint256", type: "uint256" },
456
+ { name: "recipient", internalType: "address", type: "address" }
457
+ ],
458
+ name: "withdraw",
459
+ outputs: [],
460
+ stateMutability: "nonpayable"
461
+ },
462
+ {
463
+ type: "function",
464
+ inputs: [],
465
+ name: "zoraCoinVersionLookup",
466
+ outputs: [
467
+ {
468
+ name: "",
469
+ internalType: "contract IDeployedCoinVersionLookup",
470
+ type: "address"
471
+ }
472
+ ],
473
+ stateMutability: "view"
474
+ },
475
+ {
476
+ type: "function",
477
+ inputs: [],
478
+ name: "zoraHookRegistry",
479
+ outputs: [
480
+ { name: "", internalType: "contract IZoraHookRegistry", type: "address" }
481
+ ],
482
+ stateMutability: "view"
483
+ },
484
+ {
485
+ type: "event",
486
+ anonymous: false,
487
+ inputs: [
488
+ {
489
+ name: "authority",
490
+ internalType: "address",
491
+ type: "address",
492
+ indexed: false
493
+ }
494
+ ],
495
+ name: "AuthorityUpdated"
496
+ },
497
+ {
498
+ type: "event",
499
+ anonymous: false,
500
+ inputs: [
501
+ {
502
+ name: "maker",
503
+ internalType: "address",
504
+ type: "address",
505
+ indexed: true
506
+ },
507
+ { name: "coin", internalType: "address", type: "address", indexed: true },
508
+ {
509
+ name: "poolKeyHash",
510
+ internalType: "bytes32",
511
+ type: "bytes32",
512
+ indexed: false
513
+ },
514
+ {
515
+ name: "isCurrency0",
516
+ internalType: "bool",
517
+ type: "bool",
518
+ indexed: false
519
+ },
520
+ {
521
+ name: "orderTick",
522
+ internalType: "int24",
523
+ type: "int24",
524
+ indexed: false
525
+ },
526
+ {
527
+ name: "currentTick",
528
+ internalType: "int24",
529
+ type: "int24",
530
+ indexed: false
531
+ },
532
+ {
533
+ name: "orderSize",
534
+ internalType: "uint128",
535
+ type: "uint128",
536
+ indexed: false
537
+ },
538
+ {
539
+ name: "orderId",
540
+ internalType: "bytes32",
541
+ type: "bytes32",
542
+ indexed: false
543
+ }
544
+ ],
545
+ name: "LimitOrderCreated"
546
+ },
547
+ {
548
+ type: "event",
549
+ anonymous: false,
550
+ inputs: [
551
+ {
552
+ name: "maker",
553
+ internalType: "address",
554
+ type: "address",
555
+ indexed: true
556
+ },
557
+ {
558
+ name: "coinIn",
559
+ internalType: "address",
560
+ type: "address",
561
+ indexed: true
562
+ },
563
+ {
564
+ name: "coinOut",
565
+ internalType: "address",
566
+ type: "address",
567
+ indexed: false
568
+ },
569
+ {
570
+ name: "amountIn",
571
+ internalType: "uint128",
572
+ type: "uint128",
573
+ indexed: false
574
+ },
575
+ {
576
+ name: "amountOut",
577
+ internalType: "uint128",
578
+ type: "uint128",
579
+ indexed: false
580
+ },
581
+ {
582
+ name: "fillReferral",
583
+ internalType: "address",
584
+ type: "address",
585
+ indexed: false
586
+ },
587
+ {
588
+ name: "fillReferralAmount",
589
+ internalType: "uint128",
590
+ type: "uint128",
591
+ indexed: false
592
+ },
593
+ {
594
+ name: "poolKeyHash",
595
+ internalType: "bytes32",
596
+ type: "bytes32",
597
+ indexed: false
598
+ },
599
+ { name: "tick", internalType: "int24", type: "int24", indexed: false },
600
+ {
601
+ name: "orderId",
602
+ internalType: "bytes32",
603
+ type: "bytes32",
604
+ indexed: false
605
+ }
606
+ ],
607
+ name: "LimitOrderFilled"
608
+ },
609
+ {
610
+ type: "event",
611
+ anonymous: false,
612
+ inputs: [
613
+ {
614
+ name: "maker",
615
+ internalType: "address",
616
+ type: "address",
617
+ indexed: true
618
+ },
619
+ { name: "coin", internalType: "address", type: "address", indexed: true },
620
+ {
621
+ name: "poolKeyHash",
622
+ internalType: "bytes32",
623
+ type: "bytes32",
624
+ indexed: false
625
+ },
626
+ {
627
+ name: "isCurrency0",
628
+ internalType: "bool",
629
+ type: "bool",
630
+ indexed: false
631
+ },
632
+ { name: "tick", internalType: "int24", type: "int24", indexed: false },
633
+ {
634
+ name: "orderSize",
635
+ internalType: "uint128",
636
+ type: "uint128",
637
+ indexed: false
638
+ },
639
+ {
640
+ name: "orderId",
641
+ internalType: "bytes32",
642
+ type: "bytes32",
643
+ indexed: false
644
+ },
645
+ {
646
+ name: "isCancelled",
647
+ internalType: "bool",
648
+ type: "bool",
649
+ indexed: false
650
+ }
651
+ ],
652
+ name: "LimitOrderUpdated"
653
+ },
654
+ {
655
+ type: "event",
656
+ anonymous: false,
657
+ inputs: [
658
+ {
659
+ name: "maker",
660
+ internalType: "address",
661
+ type: "address",
662
+ indexed: true
663
+ },
664
+ { name: "coin", internalType: "address", type: "address", indexed: true },
665
+ {
666
+ name: "newBalance",
667
+ internalType: "uint256",
668
+ type: "uint256",
669
+ indexed: false
670
+ }
671
+ ],
672
+ name: "MakerBalanceUpdated"
673
+ },
674
+ {
675
+ type: "error",
676
+ inputs: [{ name: "authority", internalType: "address", type: "address" }],
677
+ name: "AccessManagedInvalidAuthority"
678
+ },
679
+ { type: "error", inputs: [], name: "AccessManagedUnauthorized" },
680
+ { type: "error", inputs: [], name: "AddressZero" },
681
+ { type: "error", inputs: [], name: "ArrayLengthMismatch" },
682
+ {
683
+ type: "error",
684
+ inputs: [
685
+ { name: "orderId", internalType: "bytes32", type: "bytes32" },
686
+ { name: "expectedCoin", internalType: "address", type: "address" },
687
+ { name: "actualCoin", internalType: "address", type: "address" }
688
+ ],
689
+ name: "CoinMismatch"
690
+ },
691
+ { type: "error", inputs: [], name: "InsufficientForwardedFunds" },
692
+ { type: "error", inputs: [], name: "InsufficientTransferFunds" },
693
+ {
694
+ type: "error",
695
+ inputs: [
696
+ { name: "startTick", internalType: "int24", type: "int24" },
697
+ { name: "endTick", internalType: "int24", type: "int24" },
698
+ { name: "isCurrency0", internalType: "bool", type: "bool" }
699
+ ],
700
+ name: "InvalidFillWindow"
701
+ },
702
+ { type: "error", inputs: [], name: "InvalidOrder" },
703
+ { type: "error", inputs: [], name: "InvalidPoolKey" },
704
+ { type: "error", inputs: [], name: "MaxFillCountCannotBeZero" },
705
+ {
706
+ type: "error",
707
+ inputs: [
708
+ { name: "withdrawn", internalType: "uint256", type: "uint256" },
709
+ { name: "minAmountOut", internalType: "uint256", type: "uint256" }
710
+ ],
711
+ name: "MinAmountNotReached"
712
+ },
713
+ { type: "error", inputs: [], name: "NativeValueMismatch" },
714
+ { type: "error", inputs: [], name: "NotPoolManager" },
715
+ { type: "error", inputs: [], name: "OnlyZoraHook" },
716
+ { type: "error", inputs: [], name: "OrderClosed" },
717
+ { type: "error", inputs: [], name: "OrderNotMaker" },
718
+ { type: "error", inputs: [], name: "PathMustHaveAtLeastOneStep" },
719
+ { type: "error", inputs: [], name: "RouterMsgSenderInvalid" },
720
+ { type: "error", inputs: [], name: "UnknownCallback" },
721
+ { type: "error", inputs: [], name: "UnlockedFillNotAllowed" },
722
+ { type: "error", inputs: [], name: "ZeroMaker" },
723
+ { type: "error", inputs: [], name: "ZeroOrderSize" },
724
+ { type: "error", inputs: [], name: "ZeroRealizedOrder" }
725
+ ];
726
+ export {
727
+ iZoraLimitOrderBookCoinsInterfaceABI,
728
+ swapWithLimitOrdersABI,
729
+ zoraLimitOrderBookABI
730
+ };
731
+ //# sourceMappingURL=index.js.map