@zoralabs/limit-orders 0.2.0 → 0.2.1

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 (84) hide show
  1. package/.turbo/turbo-build$colon$js.log +47 -45
  2. package/CHANGELOG.md +61 -0
  3. package/abis/IWETH.json +118 -0
  4. package/abis/IZoraLimitOrderBook.json +5 -0
  5. package/abis/LimitOrderLiquidity.json +7 -0
  6. package/abis/LimitOrderViews.json +62 -0
  7. package/abis/SwapWithLimitOrders.json +18 -11
  8. package/abis/ZoraLimitOrderBook.json +28 -0
  9. package/cache/solidity-files-cache.json +1 -1
  10. package/dist/index.cjs +29 -8
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.js +29 -8
  13. package/dist/index.js.map +1 -1
  14. package/dist/wagmiGenerated.d.ts +37 -9
  15. package/dist/wagmiGenerated.d.ts.map +1 -1
  16. package/out/BytesLib.sol/BytesLib.json +1 -1
  17. package/out/CoinCommon.sol/CoinCommon.json +1 -1
  18. package/out/CoinConfigurationVersions.sol/CoinConfigurationVersions.json +1 -1
  19. package/out/CoinConstants.sol/CoinConstants.json +1 -1
  20. package/out/DopplerMath.sol/DopplerMath.json +1 -1
  21. package/out/FixedPoint96.sol/FixedPoint96.json +1 -1
  22. package/out/ISwapRouter.sol/ISwapRouter.json +1 -1
  23. package/out/IUniswapV3SwapCallback.sol/IUniswapV3SwapCallback.json +1 -1
  24. package/out/IWETH.sol/IWETH.json +1 -0
  25. package/out/IZoraHookRegistry.sol/IZoraHookRegistry.json +1 -1
  26. package/out/IZoraLimitOrderBook.sol/IZoraLimitOrderBook.json +1 -1
  27. package/out/IZoraLimitOrderBookCoinsInterface.sol/IZoraLimitOrderBookCoinsInterface.json +1 -1
  28. package/out/IZoraV4CoinHook.sol/IZoraV4CoinHook.json +1 -1
  29. package/out/LimitOrderBitmap.sol/LimitOrderBitmap.json +1 -1
  30. package/out/LimitOrderCommon.sol/LimitOrderCommon.json +1 -1
  31. package/out/LimitOrderCreate.sol/LimitOrderCreate.json +1 -1
  32. package/out/LimitOrderFill.sol/LimitOrderFill.json +1 -1
  33. package/out/LimitOrderLiquidity.sol/LimitOrderLiquidity.json +1 -1
  34. package/out/LimitOrderQueues.sol/LimitOrderQueues.json +1 -1
  35. package/out/LimitOrderStorage.sol/LimitOrderStorage.json +1 -1
  36. package/out/LimitOrderTypes.sol/LimitOrderTypes.json +1 -1
  37. package/out/LimitOrderViews.sol/LimitOrderViews.json +1 -0
  38. package/out/LimitOrderWithdraw.sol/LimitOrderWithdraw.json +1 -1
  39. package/out/LiquidityAmounts.sol/LiquidityAmounts.json +1 -1
  40. package/out/Path.sol/Path.json +1 -1
  41. package/out/Permit2Payments.sol/Permit2Payments.json +1 -1
  42. package/out/SimpleAccessManaged.sol/SimpleAccessManaged.json +1 -1
  43. package/out/SimpleAccessManager.sol/SimpleAccessManager.json +1 -1
  44. package/out/SqrtPriceMath.sol/SqrtPriceMath.json +1 -1
  45. package/out/SwapLimitOrders.sol/SwapLimitOrders.json +1 -1
  46. package/out/SwapWithLimitOrders.sol/SwapWithLimitOrders.json +1 -1
  47. package/out/UniV4SwapToCurrency.sol/UniV4SwapToCurrency.json +1 -1
  48. package/out/UnsafeMath.sol/UnsafeMath.json +1 -1
  49. package/out/V3ToV4SwapLib.sol/V3ToV4SwapLib.json +1 -1
  50. package/out/ZoraLimitOrderBook.sol/ZoraLimitOrderBook.json +1 -1
  51. package/out/build-info/{69718f10d1dc37f0.json → 876cc09bc44cc8a7.json} +1 -1
  52. package/out/uniswap/BitMath.sol/BitMath.json +1 -1
  53. package/out/uniswap/CustomRevert.sol/CustomRevert.json +1 -1
  54. package/out/uniswap/FullMath.sol/FullMath.json +1 -1
  55. package/out/uniswap/SafeCast.sol/SafeCast.json +1 -1
  56. package/out/uniswap/TickMath.sol/TickMath.json +1 -1
  57. package/package/wagmiGenerated.ts +28 -7
  58. package/package.json +1 -1
  59. package/src/IZoraLimitOrderBook.sol +2 -0
  60. package/src/ZoraLimitOrderBook.sol +22 -8
  61. package/src/libs/LimitOrderBitmap.sol +0 -51
  62. package/src/libs/LimitOrderCommon.sol +48 -30
  63. package/src/libs/LimitOrderCreate.sol +5 -18
  64. package/src/libs/LimitOrderFill.sol +32 -161
  65. package/src/libs/LimitOrderLiquidity.sol +92 -71
  66. package/src/libs/LimitOrderViews.sol +168 -0
  67. package/src/libs/LimitOrderWithdraw.sol +13 -4
  68. package/src/libs/SwapLimitOrders.sol +14 -7
  69. package/src/router/SwapWithLimitOrders.sol +40 -26
  70. package/test/LimitOrderBitmap.t.sol +13 -7
  71. package/test/LimitOrderFill.t.sol +43 -0
  72. package/test/LimitOrderLibraries.t.sol +18 -10
  73. package/test/LimitOrderLiquidityPayouts.t.sol +280 -3
  74. package/test/LimitOrderWithdraw.t.sol +28 -1
  75. package/test/SwapWithLimitOrders.t.sol +3 -3
  76. package/test/SwapWithLimitOrdersRouter.t.sol +108 -11
  77. package/test/unit/LimitOrderBitmapUnit.t.sol +0 -134
  78. package/test/unit/LimitOrderCreateUnit.t.sol +32 -0
  79. package/test/unit/SwapLimitOrdersUnit.t.sol +231 -33
  80. package/test/unit/SwapLimitOrdersValidation.t.sol +20 -34
  81. package/test/unit/SwapWithLimitOrdersUnit.t.sol +21 -88
  82. package/test/utils/BaseTest.sol +29 -8
  83. package/test/utils/MockWETH.sol +39 -0
  84. package/test/utils/TestableZoraLimitOrderBook.sol +5 -7
@@ -1,17 +1,17 @@
1
1
 
2
- > @zoralabs/limit-orders@0.2.0 build:js /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
2
+ > @zoralabs/limit-orders@0.2.1 build:js /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
3
3
  > pnpm run wagmi:generate && pnpm run copy-abis && pnpm run prettier:write && tsup
4
4
 
5
5
 
6
- > @zoralabs/limit-orders@0.2.0 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
6
+ > @zoralabs/limit-orders@0.2.1 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
7
7
  > pnpm run build:contracts:minimal && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts
8
8
 
9
9
 
10
- > @zoralabs/limit-orders@0.2.0 build:contracts:minimal /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
10
+ > @zoralabs/limit-orders@0.2.1 build:contracts:minimal /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
11
11
  > forge build src/ --no-metadata
12
12
 
13
- Compiling 90 files with Solc 0.8.28
14
- Solc 0.8.28 finished in 7.62s
13
+ Compiling 92 files with Solc 0.8.28
14
+ Solc 0.8.28 finished in 8.26s
15
15
  Compiler run successful!
16
16
  - Validating plugins
17
17
  ✔ Validating plugins
@@ -26,48 +26,50 @@ Compiler run successful!
26
26
  ✅ Updated ./package/wagmiGenerated.ts (3 replacements)
27
27
  ✨ All files processed successfully!
28
28
 
29
- > @zoralabs/limit-orders@0.2.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
29
+ > @zoralabs/limit-orders@0.2.1 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
30
30
  > pnpm exec bundle-abis
31
31
 
32
32
 
33
- > @zoralabs/limit-orders@0.2.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
33
+ > @zoralabs/limit-orders@0.2.1 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/limit-orders
34
34
  > prettier --write 'src/**/*.sol' 'test/**/*.sol'
35
35
 
36
- src/access/SimpleAccessManaged.sol 357ms (unchanged)
37
- src/access/SimpleAccessManager.sol 269ms (unchanged)
38
- src/IZoraLimitOrderBook.sol 59ms (unchanged)
39
- src/libs/LimitOrderBitmap.sol 153ms (unchanged)
40
- src/libs/LimitOrderCommon.sol 171ms (unchanged)
41
- src/libs/LimitOrderCreate.sol 359ms (unchanged)
42
- src/libs/LimitOrderFill.sol 360ms (unchanged)
43
- src/libs/LimitOrderLiquidity.sol 224ms (unchanged)
44
- src/libs/LimitOrderQueues.sol 44ms (unchanged)
45
- src/libs/LimitOrderStorage.sol 15ms (unchanged)
36
+ src/access/SimpleAccessManaged.sol 345ms (unchanged)
37
+ src/access/SimpleAccessManager.sol 253ms (unchanged)
38
+ src/IZoraLimitOrderBook.sol 62ms (unchanged)
39
+ src/libs/LimitOrderBitmap.sol 66ms (unchanged)
40
+ src/libs/LimitOrderCommon.sol 207ms (unchanged)
41
+ src/libs/LimitOrderCreate.sol 482ms (unchanged)
42
+ src/libs/LimitOrderFill.sol 243ms (unchanged)
43
+ src/libs/LimitOrderLiquidity.sol 232ms (unchanged)
44
+ src/libs/LimitOrderQueues.sol 37ms (unchanged)
45
+ src/libs/LimitOrderStorage.sol 16ms (unchanged)
46
46
  src/libs/LimitOrderTypes.sol 2ms (unchanged)
47
- src/libs/LimitOrderWithdraw.sol 100ms (unchanged)
48
- src/libs/Permit2Payments.sol 23ms (unchanged)
49
- src/libs/SwapLimitOrders.sol 151ms (unchanged)
50
- src/router/SwapWithLimitOrders.sol 265ms (unchanged)
51
- src/ZoraLimitOrderBook.sol 121ms (unchanged)
52
- test/gas/LimitOrderFillGas.t.sol 821ms (unchanged)
53
- test/gas/LimitOrderSwapGas.t.sol 318ms (unchanged)
54
- test/LimitOrderAccessControl.t.sol 390ms (unchanged)
47
+ src/libs/LimitOrderViews.sol 132ms (unchanged)
48
+ src/libs/LimitOrderWithdraw.sol 91ms (unchanged)
49
+ src/libs/Permit2Payments.sol 32ms (unchanged)
50
+ src/libs/SwapLimitOrders.sol 161ms (unchanged)
51
+ src/router/SwapWithLimitOrders.sol 269ms (unchanged)
52
+ src/ZoraLimitOrderBook.sol 136ms (unchanged)
53
+ test/gas/LimitOrderFillGas.t.sol 851ms (unchanged)
54
+ test/gas/LimitOrderSwapGas.t.sol 310ms (unchanged)
55
+ test/LimitOrderAccessControl.t.sol 402ms (unchanged)
55
56
  test/LimitOrderBitmap.t.sol 217ms (unchanged)
56
- test/LimitOrderCreate.t.sol 395ms (unchanged)
57
- test/LimitOrderFill.t.sol 1038ms (unchanged)
58
- test/LimitOrderLibraries.t.sol 393ms (unchanged)
59
- test/LimitOrderLiquidityPayouts.t.sol 264ms (unchanged)
60
- test/LimitOrderV4Pools.t.sol 149ms (unchanged)
61
- test/LimitOrderWithdraw.t.sol 639ms (unchanged)
62
- test/SimpleAccessManager.t.sol 328ms (unchanged)
57
+ test/LimitOrderCreate.t.sol 392ms (unchanged)
58
+ test/LimitOrderFill.t.sol 1071ms (unchanged)
59
+ test/LimitOrderLibraries.t.sol 381ms (unchanged)
60
+ test/LimitOrderLiquidityPayouts.t.sol 436ms (unchanged)
61
+ test/LimitOrderV4Pools.t.sol 147ms (unchanged)
62
+ test/LimitOrderWithdraw.t.sol 677ms (unchanged)
63
+ test/SimpleAccessManager.t.sol 303ms (unchanged)
63
64
  test/SwapWithLimitOrders.t.sol 125ms (unchanged)
64
- test/SwapWithLimitOrdersRouter.t.sol 554ms (unchanged)
65
- test/unit/LimitOrderBitmapUnit.t.sol 176ms (unchanged)
66
- test/unit/LimitOrderCreateUnit.t.sol 151ms (unchanged)
67
- test/unit/SwapLimitOrdersUnit.t.sol 525ms (unchanged)
68
- test/unit/SwapLimitOrdersValidation.t.sol 253ms (unchanged)
69
- test/unit/SwapWithLimitOrdersUnit.t.sol 96ms (unchanged)
70
- test/utils/BaseTest.sol 606ms (unchanged)
65
+ test/SwapWithLimitOrdersRouter.t.sol 636ms (unchanged)
66
+ test/unit/LimitOrderBitmapUnit.t.sol 86ms
67
+ test/unit/LimitOrderCreateUnit.t.sol 172ms (unchanged)
68
+ test/unit/SwapLimitOrdersUnit.t.sol 637ms (unchanged)
69
+ test/unit/SwapLimitOrdersValidation.t.sol 229ms (unchanged)
70
+ test/unit/SwapWithLimitOrdersUnit.t.sol 69ms (unchanged)
71
+ test/utils/BaseTest.sol 635ms (unchanged)
72
+ test/utils/MockWETH.sol 33ms (unchanged)
71
73
  test/utils/TestableZoraLimitOrderBook.sol 37ms (unchanged)
72
74
  CLI Building entry: package/index.ts
73
75
  CLI Using tsconfig: tsconfig.json
@@ -77,9 +79,9 @@ test/utils/TestableZoraLimitOrderBook.sol 37ms (unchanged)
77
79
  CLI Cleaning output folder
78
80
  CJS Build start
79
81
  ESM Build start
80
- ESM dist/index.js 20.36 KB
81
- ESM dist/index.js.map 36.51 KB
82
- ESM ⚡️ Build success in 34ms
83
- CJS dist/index.cjs 21.52 KB
84
- CJS dist/index.cjs.map 36.63 KB
85
- CJS ⚡️ Build success in 38ms
82
+ CJS dist/index.cjs 22.04 KB
83
+ CJS dist/index.cjs.map 37.57 KB
84
+ CJS ⚡️ Build success in 24ms
85
+ ESM dist/index.js 20.87 KB
86
+ ESM dist/index.js.map 37.45 KB
87
+ ESM ⚡️ Build success in 25ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # @zoralabs/limit-orders
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - dd012477: Add swap price data fields to SwapWithLimitOrdersExecuted event. The event now includes actual swap amounts (amount0 and amount1) and final sqrt price (sqrtPriceX96), while removing the redundant delta field. This breaking change provides more detailed swap information for indexers and frontends to track swaps with limit orders without requiring additional RPC calls.
8
+ - 517d3f74: Fix security vulnerability that allowed withdrawal of fillable limit orders. When a limit order becomes fillable due to market price crossing the limit price, users are now prevented from withdrawing the order and must execute it instead. This enforces proper market behavior and prevents users from backing out of orders that should be filled based on current market conditions.
9
+ - 0b183d5e: Improve payout swap path validation in limit order fulfillment. The `_resolvePayoutPath` function now validates that multi-hop swap paths from coins have their first hop matching the expected payout currency. If validation fails, the system automatically falls back to constructing a simple single-hop path, ensuring correct payouts regardless of the coin's swap path configuration.
10
+ - e84a6902: Fix CEI violation in limit order filling by moving order removal before external liquidity calls to prevent potential reentrancy issues
11
+ - 17bf2b5e: Fix limit order fill direction to derive from actual tick movement
12
+
13
+ Fixed limit order filling in `ZoraV4CoinHook` by deriving the fill direction from actual tick movement instead of using the swap direction parameter. The hook now only attempts to fill limit orders when there's an actual tick change, and determines the currency direction based on the comparison between before and after swap ticks. This ensures orders are filled correctly regardless of swap direction.
14
+
15
+ - 928b4f65: Fix limit order execution logic for correct tick queue placement
16
+
17
+ Fixed critical bug where limit orders were being enqueued at incorrect ticks, preventing proper execution. Currency0 orders now correctly execute when price rises to the upper tick, and Currency1 orders execute when price falls to the lower tick.
18
+
19
+ - 3d0bb73c: Fix router-based limit order fills to use correct currency direction
20
+
21
+ Fixed bug in SwapWithLimitOrders where router fallback incorrectly inverted the currency direction parameter when calling `_fillOrders`. This caused orders to be skipped when the hook doesn't support limit order fills. The router now correctly passes `isCoinCurrency0` instead of `!isCoinCurrency0`, ensuring fills occur in the proper direction.
22
+
23
+ - a61e0250: Remove duplicate validateOrderInputs call in handleCreateCallback
24
+
25
+ Eliminates redundant validation that was occurring in both \_prepareCreateData and handleCreateCallback functions, reducing gas costs while maintaining input validation security.
26
+
27
+ - 14f1314a: Fix tick misalignment in minAway calculation
28
+
29
+ Align baseTick to tick spacing before calculating minAway in \_tickForMultiple(). This prevents order creation from reverting when the current pool tick is not aligned to the pool's tick spacing.
30
+
31
+ - d2703bab: Fix stack too deep compilation error with internal refactoring of limit order creation.
32
+ - 851ca567: Fix router to fill pre-existing limit orders even when no new orders are created in the current swap
33
+
34
+ Previously, the router would skip filling crossed limit orders if `orders.length == 0` (no new orders created in current transaction). This prevented legitimate fills of pre-existing orders that were crossed by the swap. The fix removes this incorrect condition, allowing the router to properly fill any orders crossed during the swap, regardless of whether new orders were also created.
35
+
36
+ - 4ce5e4b6: Fix maxFillCount bounds checking to always cap it at the default max fill count, event if a higher value is passed.
37
+ - 9486742f: Rename liqDelta to callerDelta for clearer naming fixes #19
38
+ - 2cb9cb30: Remove fixed MIN_LIMIT_ORDER_SIZE threshold that made many tokens unusable. Limit orders now accept any positive amount instead of requiring at least 1e18 tokens, fixing compatibility issues with tokens using different decimal configurations.
39
+ - eec53af3: Remove unnecessary Permit2Payments inheritance and use direct PERMIT2 immutable reference instead. This simplifies the contract structure by eliminating unused inherited functions while maintaining identical functionality.
40
+ - 83726a0e: Remove unused settle negative deltas logic
41
+
42
+ - Remove redundant `_settleNegativeDeltas` function that was never executed
43
+ - Simplify limit order closure logic by removing unnecessary delta settlement
44
+
45
+ - 0a104aa2: Fix potential hash collision in order ID generation
46
+
47
+ Changed order ID derivation from `abi.encodePacked` to `abi.encode` to prevent potential hash collisions and ensure consistent hashing behavior. This security fix addresses audit finding MKT-47.
48
+
49
+ - b718117b: Fix limit order fulfillment to use correct currency when resolving payout paths
50
+
51
+ Limit order fulfillment now correctly consults the output currency's payout path configuration instead of the input currency's configuration. This ensures orders receive payouts based on the token being purchased rather than the token being sold, preventing potential currency mismatches when both tokens in a pair have different custom payout paths configured.
52
+
53
+ - d6323749: Simplify limit order filling logic by deriving fill direction from tick movement. The system now automatically determines the correct currency direction based on tick changes (increasing tick = currency0, decreasing tick = currency1) instead of using complex tick sorting logic. This fix resolves issues where limit orders would revert when ticks were in unexpected order.
54
+ - 2b054307: Fix limit order payout handling for dual positive deltas. Previously, when limit order positions accumulated fees in both tokens (dual positive deltas), the payout would revert with a `CurrencyNotSettled` error because only one currency was withdrawn from the pool manager. The fix swaps the non-payout currency to the payout currency and pays out the combined amount, properly settling both deltas.
55
+ - 05579fbc: Refetch pool tick before filling each order to ensure accurate tick validation
56
+
57
+ Improved the limit order filling logic to prevent orders from being filled with stale tick data. The fix adds a current tick refresh before checking if an order has crossed the current tick price during the execution loop. This ensures that orders are only filled when they have actually crossed the current tick price, preventing incorrect fills due to price movements during the fill operation.
58
+
59
+ - 5303b406: Fix native ETH settlement to prevent potential DoS by synchronizing pool manager state before settlement. This ensures accurate ETH balance tracking and prevents transaction failures when processing limit orders with native ETH.
60
+ - 16b3146c: Add WETH support for native ETH payouts in limit orders. When limit orders are filled or withdrawn with native ETH as the payout currency, the system now automatically wraps ETH into WETH before sending to recipients. This ensures compatibility with wallets and smart contracts that cannot receive native ETH directly, preventing transaction failures.
61
+
62
+ **Breaking Change**: The `ZoraLimitOrderBook` constructor now requires an additional `weth` parameter. This affects deployment scripts and deterministic address computation.
63
+
3
64
  ## 0.2.0
4
65
 
5
66
  ### Minor Changes
@@ -0,0 +1,118 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "approve",
5
+ "inputs": [
6
+ {
7
+ "name": "guy",
8
+ "type": "address",
9
+ "internalType": "address"
10
+ },
11
+ {
12
+ "name": "wad",
13
+ "type": "uint256",
14
+ "internalType": "uint256"
15
+ }
16
+ ],
17
+ "outputs": [
18
+ {
19
+ "name": "",
20
+ "type": "bool",
21
+ "internalType": "bool"
22
+ }
23
+ ],
24
+ "stateMutability": "nonpayable"
25
+ },
26
+ {
27
+ "type": "function",
28
+ "name": "balanceOf",
29
+ "inputs": [
30
+ {
31
+ "name": "guy",
32
+ "type": "address",
33
+ "internalType": "address"
34
+ }
35
+ ],
36
+ "outputs": [
37
+ {
38
+ "name": "",
39
+ "type": "uint256",
40
+ "internalType": "uint256"
41
+ }
42
+ ],
43
+ "stateMutability": "view"
44
+ },
45
+ {
46
+ "type": "function",
47
+ "name": "deposit",
48
+ "inputs": [],
49
+ "outputs": [],
50
+ "stateMutability": "payable"
51
+ },
52
+ {
53
+ "type": "function",
54
+ "name": "transfer",
55
+ "inputs": [
56
+ {
57
+ "name": "dst",
58
+ "type": "address",
59
+ "internalType": "address"
60
+ },
61
+ {
62
+ "name": "wad",
63
+ "type": "uint256",
64
+ "internalType": "uint256"
65
+ }
66
+ ],
67
+ "outputs": [
68
+ {
69
+ "name": "",
70
+ "type": "bool",
71
+ "internalType": "bool"
72
+ }
73
+ ],
74
+ "stateMutability": "nonpayable"
75
+ },
76
+ {
77
+ "type": "function",
78
+ "name": "transferFrom",
79
+ "inputs": [
80
+ {
81
+ "name": "src",
82
+ "type": "address",
83
+ "internalType": "address"
84
+ },
85
+ {
86
+ "name": "dst",
87
+ "type": "address",
88
+ "internalType": "address"
89
+ },
90
+ {
91
+ "name": "wad",
92
+ "type": "uint256",
93
+ "internalType": "uint256"
94
+ }
95
+ ],
96
+ "outputs": [
97
+ {
98
+ "name": "",
99
+ "type": "bool",
100
+ "internalType": "bool"
101
+ }
102
+ ],
103
+ "stateMutability": "nonpayable"
104
+ },
105
+ {
106
+ "type": "function",
107
+ "name": "withdraw",
108
+ "inputs": [
109
+ {
110
+ "name": "wad",
111
+ "type": "uint256",
112
+ "internalType": "uint256"
113
+ }
114
+ ],
115
+ "outputs": [],
116
+ "stateMutability": "nonpayable"
117
+ }
118
+ ]
@@ -585,6 +585,11 @@
585
585
  "name": "OrderClosed",
586
586
  "inputs": []
587
587
  },
588
+ {
589
+ "type": "error",
590
+ "name": "OrderFillable",
591
+ "inputs": []
592
+ },
588
593
  {
589
594
  "type": "error",
590
595
  "name": "OrderNotMaker",
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "WethTransferFailed",
5
+ "inputs": []
6
+ }
7
+ ]
@@ -0,0 +1,62 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "liquidityForOrder",
5
+ "inputs": [
6
+ {
7
+ "name": "isCurrency0",
8
+ "type": "bool",
9
+ "internalType": "bool"
10
+ },
11
+ {
12
+ "name": "size",
13
+ "type": "uint256",
14
+ "internalType": "uint256"
15
+ },
16
+ {
17
+ "name": "tickLower",
18
+ "type": "int24",
19
+ "internalType": "int24"
20
+ },
21
+ {
22
+ "name": "tickUpper",
23
+ "type": "int24",
24
+ "internalType": "int24"
25
+ }
26
+ ],
27
+ "outputs": [
28
+ {
29
+ "name": "",
30
+ "type": "uint128",
31
+ "internalType": "uint128"
32
+ }
33
+ ],
34
+ "stateMutability": "pure"
35
+ },
36
+ {
37
+ "type": "error",
38
+ "name": "InvalidFillWindow",
39
+ "inputs": [
40
+ {
41
+ "name": "startTick",
42
+ "type": "int24",
43
+ "internalType": "int24"
44
+ },
45
+ {
46
+ "name": "endTick",
47
+ "type": "int24",
48
+ "internalType": "int24"
49
+ },
50
+ {
51
+ "name": "isCurrency0",
52
+ "type": "bool",
53
+ "internalType": "bool"
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ "type": "error",
59
+ "name": "InvalidPoolKey",
60
+ "inputs": []
61
+ }
62
+ ]
@@ -313,12 +313,6 @@
313
313
  }
314
314
  ]
315
315
  },
316
- {
317
- "name": "delta",
318
- "type": "int256",
319
- "indexed": false,
320
- "internalType": "BalanceDelta"
321
- },
322
316
  {
323
317
  "name": "tickBeforeSwap",
324
318
  "type": "int24",
@@ -331,6 +325,24 @@
331
325
  "indexed": false,
332
326
  "internalType": "int24"
333
327
  },
328
+ {
329
+ "name": "amount0",
330
+ "type": "int128",
331
+ "indexed": false,
332
+ "internalType": "int128"
333
+ },
334
+ {
335
+ "name": "amount1",
336
+ "type": "int128",
337
+ "indexed": false,
338
+ "internalType": "int128"
339
+ },
340
+ {
341
+ "name": "sqrtPriceX96",
342
+ "type": "uint160",
343
+ "indexed": false,
344
+ "internalType": "uint160"
345
+ },
334
346
  {
335
347
  "name": "orders",
336
348
  "type": "tuple[]",
@@ -362,11 +374,6 @@
362
374
  "name": "EmptyV4Route",
363
375
  "inputs": []
364
376
  },
365
- {
366
- "type": "error",
367
- "name": "FromAddressIsNotOwner",
368
- "inputs": []
369
- },
370
377
  {
371
378
  "type": "error",
372
379
  "name": "InsufficientInputCurrency",
@@ -21,6 +21,11 @@
21
21
  "name": "authority_",
22
22
  "type": "address",
23
23
  "internalType": "address"
24
+ },
25
+ {
26
+ "name": "weth_",
27
+ "type": "address",
28
+ "internalType": "address"
24
29
  }
25
30
  ],
26
31
  "stateMutability": "nonpayable"
@@ -330,6 +335,19 @@
330
335
  ],
331
336
  "stateMutability": "nonpayable"
332
337
  },
338
+ {
339
+ "type": "function",
340
+ "name": "weth",
341
+ "inputs": [],
342
+ "outputs": [
343
+ {
344
+ "name": "",
345
+ "type": "address",
346
+ "internalType": "address"
347
+ }
348
+ ],
349
+ "stateMutability": "view"
350
+ },
333
351
  {
334
352
  "type": "function",
335
353
  "name": "withdraw",
@@ -728,6 +746,11 @@
728
746
  "name": "OrderClosed",
729
747
  "inputs": []
730
748
  },
749
+ {
750
+ "type": "error",
751
+ "name": "OrderFillable",
752
+ "inputs": []
753
+ },
731
754
  {
732
755
  "type": "error",
733
756
  "name": "OrderNotMaker",
@@ -753,6 +776,11 @@
753
776
  "name": "UnlockedFillNotAllowed",
754
777
  "inputs": []
755
778
  },
779
+ {
780
+ "type": "error",
781
+ "name": "WethTransferFailed",
782
+ "inputs": []
783
+ },
756
784
  {
757
785
  "type": "error",
758
786
  "name": "ZeroMaker",