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