@zoralabs/limit-orders 0.2.6 → 0.2.8
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.
- package/.turbo/turbo-build$colon$js.log +45 -44
- package/CHANGELOG.md +17 -7
- package/abis/ICoin.json +5 -0
- package/cache/solidity-files-cache.json +1 -1
- package/foundry.toml +1 -0
- package/out/BalanceDelta.sol/BalanceDeltaLibrary.json +1 -1
- package/out/BeforeSwapDelta.sol/BeforeSwapDeltaLibrary.json +1 -1
- package/out/BitMath.sol/BitMath.json +1 -1
- package/out/BytesLib.sol/BytesLib.json +1 -1
- package/out/CoinCommon.sol/CoinCommon.json +1 -1
- package/out/CoinConfigurationVersions.sol/CoinConfigurationVersions.json +1 -1
- package/out/CoinConstants.sol/CoinConstants.json +1 -1
- package/out/Context.sol/Context.json +1 -1
- package/out/ContractVersionBase.sol/ContractVersionBase.json +1 -1
- package/out/Currency.sol/CurrencyLibrary.json +1 -1
- package/out/CurrencyReserves.sol/CurrencyReserves.json +1 -1
- package/out/CustomRevert.sol/CustomRevert.json +1 -1
- package/out/DopplerMath.sol/DopplerMath.json +1 -1
- package/out/FixedPoint128.sol/FixedPoint128.json +1 -1
- package/out/FixedPoint96.sol/FixedPoint96.json +1 -1
- package/out/FullMath.sol/FullMath.json +1 -1
- package/out/IAllowanceTransfer.sol/IAllowanceTransfer.json +1 -1
- package/out/ICoin.sol/ICoin.json +1 -1
- package/out/ICoin.sol/IHasCoinType.json +1 -1
- package/out/ICoin.sol/IHasPoolKey.json +1 -1
- package/out/ICoin.sol/IHasSwapPath.json +1 -1
- package/out/ICoin.sol/IHasTotalSupplyForPositions.json +1 -1
- package/out/IDeployedCoinVersionLookup.sol/IDeployedCoinVersionLookup.json +1 -1
- package/out/IDopplerErrors.sol/IDopplerErrors.json +1 -1
- package/out/IEIP712.sol/IEIP712.json +1 -1
- package/out/IERC1363.sol/IERC1363.json +1 -1
- package/out/IERC165.sol/IERC165.json +1 -1
- package/out/IERC20.sol/IERC20.json +1 -1
- package/out/IERC20Minimal.sol/IERC20Minimal.json +1 -1
- package/out/IERC6909Claims.sol/IERC6909Claims.json +1 -1
- package/out/IERC7572.sol/IERC7572.json +1 -1
- package/out/IExtsload.sol/IExtsload.json +1 -1
- package/out/IExttload.sol/IExttload.json +1 -1
- package/out/IHasRewardsRecipients.sol/IHasRewardsRecipients.json +1 -1
- package/out/IHooks.sol/IHooks.json +1 -1
- package/out/IMsgSender.sol/IMsgSender.json +1 -1
- package/out/IPoolManager.sol/IPoolManager.json +1 -1
- package/out/IProtocolFees.sol/IProtocolFees.json +1 -1
- package/out/ISupportsLimitOrderFill.sol/ISupportsLimitOrderFill.json +1 -1
- package/out/ISwapPathRouter.sol/ISwapPathRouter.json +1 -1
- package/out/ISwapRouter.sol/ISwapRouter.json +1 -1
- package/out/IUniswapV3SwapCallback.sol/IUniswapV3SwapCallback.json +1 -1
- package/out/IUpgradeableV4Hook.sol/IUpgradeableDestinationV4Hook.json +1 -1
- package/out/IUpgradeableV4Hook.sol/IUpgradeableDestinationV4HookWithUpdateableFee.json +1 -1
- package/out/IUpgradeableV4Hook.sol/IUpgradeableV4Hook.json +1 -1
- package/out/IVersionedContract.sol/IVersionedContract.json +1 -1
- package/out/IWETH.sol/IWETH.json +1 -1
- package/out/IZoraHookRegistry.sol/IZoraHookRegistry.json +1 -1
- package/out/IZoraLimitOrderBook.sol/IZoraLimitOrderBook.json +1 -1
- package/out/IZoraLimitOrderBookCoinsInterface.sol/IZoraLimitOrderBookCoinsInterface.json +1 -1
- package/out/IZoraV4CoinHook.sol/IZoraV4CoinHook.json +1 -1
- package/out/LimitOrderBitmap.sol/LimitOrderBitmap.json +1 -1
- package/out/LimitOrderCommon.sol/LimitOrderCommon.json +1 -1
- package/out/LimitOrderCreate.sol/LimitOrderCreate.json +1 -1
- package/out/LimitOrderFill.sol/LimitOrderFill.json +1 -1
- package/out/LimitOrderLiquidity.sol/LimitOrderLiquidity.json +1 -1
- package/out/LimitOrderQueues.sol/LimitOrderQueues.json +1 -1
- package/out/LimitOrderStorage.sol/LimitOrderStorage.json +1 -1
- package/out/LimitOrderTypes.sol/LimitOrderTypes.json +1 -1
- package/out/LimitOrderViews.sol/LimitOrderViews.json +1 -1
- package/out/LimitOrderWithdraw.sol/LimitOrderWithdraw.json +1 -1
- package/out/LiquidityAmounts.sol/LiquidityAmounts.json +1 -1
- package/out/LiquidityMath.sol/LiquidityMath.json +1 -1
- package/out/Lock.sol/Lock.json +1 -1
- package/out/NonzeroDeltaCount.sol/NonzeroDeltaCount.json +1 -1
- package/out/Ownable.sol/Ownable.json +1 -1
- package/out/Ownable2Step.sol/Ownable2Step.json +1 -1
- package/out/Path.sol/Path.json +1 -1
- package/out/PathKey.sol/PathKeyLibrary.json +1 -1
- package/out/Permit2Payments.sol/Permit2Payments.json +1 -1
- package/out/PermittedCallers.sol/PermittedCallers.json +1 -1
- package/out/PoolId.sol/PoolIdLibrary.json +1 -1
- package/out/Position.sol/Position.json +1 -1
- package/out/SafeCast.sol/SafeCast.json +1 -1
- package/out/SafeCast160.sol/SafeCast160.json +1 -1
- package/out/SafeERC20.sol/SafeERC20.json +1 -1
- package/out/SqrtPriceMath.sol/SqrtPriceMath.json +1 -1
- package/out/StateLibrary.sol/StateLibrary.json +1 -1
- package/out/SwapLimitOrders.sol/SwapLimitOrders.json +1 -1
- package/out/SwapWithLimitOrders.sol/SwapWithLimitOrders.json +1 -1
- package/out/TickBitmap.sol/TickBitmap.json +1 -1
- package/out/TickMath.sol/TickMath.json +1 -1
- package/out/TransientSlot.sol/TransientSlot.json +1 -1
- package/out/TransientStateLibrary.sol/TransientStateLibrary.json +1 -1
- package/out/UniV4SwapToCurrency.sol/UniV4SwapToCurrency.json +1 -1
- package/out/UnsafeMath.sol/UnsafeMath.json +1 -1
- package/out/V3ToV4SwapLib.sol/V3ToV4SwapLib.json +1 -1
- package/out/ZoraLimitOrderBook.sol/ZoraLimitOrderBook.json +1 -1
- package/out/build-info/{b6efea4394bdeb7d.json → 2605948752e570d1.json} +1 -1
- package/out/uniswap/BitMath.sol/BitMath.json +1 -1
- package/out/uniswap/CustomRevert.sol/CustomRevert.json +1 -1
- package/out/uniswap/FullMath.sol/FullMath.json +1 -1
- package/out/uniswap/SafeCast.sol/SafeCast.json +1 -1
- package/out/uniswap/TickMath.sol/TickMath.json +1 -1
- package/package.json +3 -3
- package/src/libs/LimitOrderFill.sol +4 -5
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/DebugSwapWithLimitOrders.t.sol +196 -0
- package/test/LimitOrderFill.t.sol +118 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @zoralabs/limit-orders@0.2.
|
|
2
|
+
> @zoralabs/limit-orders@0.2.8 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.
|
|
6
|
+
> @zoralabs/limit-orders@0.2.8 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.
|
|
10
|
+
> @zoralabs/limit-orders@0.2.8 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
13
|
Compiling 94 files with Solc 0.8.28
|
|
14
|
-
Solc 0.8.28 finished in
|
|
14
|
+
Solc 0.8.28 finished in 7.49s
|
|
15
15
|
Compiler run successful!
|
|
16
16
|
[33m-[39m Validating plugins
|
|
17
17
|
[32m✔[39m Validating plugins
|
|
@@ -26,50 +26,51 @@ 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.
|
|
29
|
+
> @zoralabs/limit-orders@0.2.8 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.
|
|
33
|
+
> @zoralabs/limit-orders@0.2.8 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
|
-
[90msrc/access/PermittedCallers.sol[39m
|
|
37
|
-
[90msrc/IZoraLimitOrderBook.sol[39m
|
|
38
|
-
[90msrc/libs/LimitOrderBitmap.sol[39m
|
|
39
|
-
[90msrc/libs/LimitOrderCommon.sol[39m
|
|
40
|
-
[90msrc/libs/LimitOrderCreate.sol[39m
|
|
41
|
-
[90msrc/libs/LimitOrderFill.sol[39m
|
|
42
|
-
[90msrc/libs/LimitOrderLiquidity.sol[39m
|
|
43
|
-
[90msrc/libs/LimitOrderQueues.sol[39m
|
|
44
|
-
[90msrc/libs/LimitOrderStorage.sol[39m
|
|
36
|
+
[90msrc/access/PermittedCallers.sol[39m 465ms (unchanged)
|
|
37
|
+
[90msrc/IZoraLimitOrderBook.sol[39m 60ms (unchanged)
|
|
38
|
+
[90msrc/libs/LimitOrderBitmap.sol[39m 70ms (unchanged)
|
|
39
|
+
[90msrc/libs/LimitOrderCommon.sol[39m 225ms (unchanged)
|
|
40
|
+
[90msrc/libs/LimitOrderCreate.sol[39m 346ms (unchanged)
|
|
41
|
+
[90msrc/libs/LimitOrderFill.sol[39m 220ms (unchanged)
|
|
42
|
+
[90msrc/libs/LimitOrderLiquidity.sol[39m 239ms (unchanged)
|
|
43
|
+
[90msrc/libs/LimitOrderQueues.sol[39m 77ms (unchanged)
|
|
44
|
+
[90msrc/libs/LimitOrderStorage.sol[39m 14ms (unchanged)
|
|
45
45
|
[90msrc/libs/LimitOrderTypes.sol[39m 2ms (unchanged)
|
|
46
|
-
[90msrc/libs/LimitOrderViews.sol[39m
|
|
47
|
-
[90msrc/libs/LimitOrderWithdraw.sol[39m
|
|
48
|
-
[90msrc/libs/Permit2Payments.sol[39m
|
|
49
|
-
[90msrc/libs/SwapLimitOrders.sol[39m
|
|
50
|
-
[90msrc/router/SwapWithLimitOrders.sol[39m
|
|
51
|
-
[90msrc/version/ContractVersionBase.sol[39m
|
|
52
|
-
[90msrc/ZoraLimitOrderBook.sol[39m
|
|
53
|
-
[90mtest/
|
|
54
|
-
[90mtest/gas/
|
|
55
|
-
[90mtest/
|
|
56
|
-
[90mtest/
|
|
57
|
-
[90mtest/
|
|
58
|
-
[90mtest/
|
|
59
|
-
[90mtest/
|
|
60
|
-
[90mtest/
|
|
61
|
-
[90mtest/
|
|
62
|
-
[90mtest/
|
|
63
|
-
[90mtest/
|
|
64
|
-
[90mtest/
|
|
65
|
-
[90mtest/
|
|
66
|
-
[90mtest/unit/
|
|
67
|
-
[90mtest/unit/
|
|
68
|
-
[90mtest/unit/
|
|
69
|
-
[90mtest/unit/
|
|
70
|
-
[90mtest/
|
|
71
|
-
[90mtest/utils/
|
|
72
|
-
[90mtest/utils/
|
|
46
|
+
[90msrc/libs/LimitOrderViews.sol[39m 105ms (unchanged)
|
|
47
|
+
[90msrc/libs/LimitOrderWithdraw.sol[39m 105ms (unchanged)
|
|
48
|
+
[90msrc/libs/Permit2Payments.sol[39m 16ms (unchanged)
|
|
49
|
+
[90msrc/libs/SwapLimitOrders.sol[39m 145ms (unchanged)
|
|
50
|
+
[90msrc/router/SwapWithLimitOrders.sol[39m 263ms (unchanged)
|
|
51
|
+
[90msrc/version/ContractVersionBase.sol[39m 6ms (unchanged)
|
|
52
|
+
[90msrc/ZoraLimitOrderBook.sol[39m 144ms (unchanged)
|
|
53
|
+
[90mtest/DebugSwapWithLimitOrders.t.sol[39m 132ms (unchanged)
|
|
54
|
+
[90mtest/gas/LimitOrderFillGas.t.sol[39m 773ms (unchanged)
|
|
55
|
+
[90mtest/gas/LimitOrderSwapGas.t.sol[39m 298ms (unchanged)
|
|
56
|
+
[90mtest/LimitOrderAccessControl.t.sol[39m 366ms (unchanged)
|
|
57
|
+
[90mtest/LimitOrderBitmap.t.sol[39m 201ms (unchanged)
|
|
58
|
+
[90mtest/LimitOrderCreate.t.sol[39m 364ms (unchanged)
|
|
59
|
+
[90mtest/LimitOrderFill.t.sol[39m 1072ms (unchanged)
|
|
60
|
+
[90mtest/LimitOrderLibraries.t.sol[39m 374ms (unchanged)
|
|
61
|
+
[90mtest/LimitOrderLiquidityPayouts.t.sol[39m 373ms (unchanged)
|
|
62
|
+
[90mtest/LimitOrderV4Pools.t.sol[39m 131ms (unchanged)
|
|
63
|
+
[90mtest/LimitOrderWithdraw.t.sol[39m 623ms (unchanged)
|
|
64
|
+
[90mtest/SwapWithLimitOrders.t.sol[39m 88ms (unchanged)
|
|
65
|
+
[90mtest/SwapWithLimitOrdersRouter.t.sol[39m 590ms (unchanged)
|
|
66
|
+
[90mtest/unit/LimitOrderBitmapUnit.t.sol[39m 85ms (unchanged)
|
|
67
|
+
[90mtest/unit/LimitOrderCreateUnit.t.sol[39m 161ms (unchanged)
|
|
68
|
+
[90mtest/unit/SwapLimitOrdersUnit.t.sol[39m 662ms (unchanged)
|
|
69
|
+
[90mtest/unit/SwapLimitOrdersValidation.t.sol[39m 240ms (unchanged)
|
|
70
|
+
[90mtest/unit/SwapWithLimitOrdersUnit.t.sol[39m 72ms (unchanged)
|
|
71
|
+
[90mtest/utils/BaseTest.sol[39m 596ms (unchanged)
|
|
72
|
+
[90mtest/utils/MockWETH.sol[39m 32ms (unchanged)
|
|
73
|
+
[90mtest/utils/TestableZoraLimitOrderBook.sol[39m 37ms (unchanged)
|
|
73
74
|
[34mCLI[39m Building entry: package/index.ts
|
|
74
75
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
75
76
|
[34mCLI[39m tsup v8.5.1
|
|
@@ -80,7 +81,7 @@ Compiler run successful!
|
|
|
80
81
|
[34mESM[39m Build start
|
|
81
82
|
[32mESM[39m [1mdist/index.js [22m[32m24.82 KB[39m
|
|
82
83
|
[32mESM[39m [1mdist/index.js.map [22m[32m44.67 KB[39m
|
|
83
|
-
[32mESM[39m ⚡️ Build success in
|
|
84
|
+
[32mESM[39m ⚡️ Build success in 36ms
|
|
84
85
|
[32mCJS[39m [1mdist/index.cjs [22m[32m25.99 KB[39m
|
|
85
86
|
[32mCJS[39m [1mdist/index.cjs.map [22m[32m44.79 KB[39m
|
|
86
|
-
[32mCJS[39m ⚡️ Build success in
|
|
87
|
+
[32mCJS[39m ⚡️ Build success in 38ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
# @zoralabs/limit-orders
|
|
2
2
|
|
|
3
|
+
## 0.2.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fbb389583: Bump viem to 2.53.1
|
|
8
|
+
|
|
9
|
+
Raise the pinned viem version from 2.22.12 to 2.53.1 across the monorepo to pick up newer chain definitions and support the latest x402 v2 client packages.
|
|
10
|
+
|
|
11
|
+
## 0.2.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- ee8921b7: Fix multi-hop payout path for content coin limit orders
|
|
16
|
+
- Pass `coinIn` instead of `coinOut` to `burnAndPayout` in `LimitOrderFill._fillOrder`
|
|
17
|
+
- This ensures content coin orders pay out in the ultimate backing currency (ZORA) via the multi-hop path
|
|
18
|
+
- Previously, content coin orders would fall back to single-hop and pay out in creator coin instead of ZORA
|
|
19
|
+
|
|
3
20
|
## 0.2.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
6
23
|
|
|
7
24
|
- df0b0a1d: Add ContractVersionBase inheritance to ZoraLimitOrderBook and SwapWithLimitOrders
|
|
8
|
-
|
|
9
25
|
- Both contracts now inherit from ContractVersionBase for consistent version tracking
|
|
10
26
|
- Implements IVersionedContract interface with contractVersion() returning "0.2.5"
|
|
11
27
|
|
|
@@ -31,7 +47,6 @@
|
|
|
31
47
|
### Patch Changes
|
|
32
48
|
|
|
33
49
|
- 98e02520: Fix dual positive deltas consolidation in burnAndRefund
|
|
34
|
-
|
|
35
50
|
- Consolidate payouts to single currency when burning limit orders with dual positive deltas
|
|
36
51
|
- Extract path-building logic into reusable `_buildSingleHopPath` helper function
|
|
37
52
|
- Ensure users receive proceeds in their original deposit currency by swapping counter-assets
|
|
@@ -47,7 +62,6 @@
|
|
|
47
62
|
### Patch Changes
|
|
48
63
|
|
|
49
64
|
- bb2c2b76: Replace AccessManager with PermittedCallers + Ownable2Step for access control in ZoraLimitOrderBook and SwapWithLimitOrders contracts.
|
|
50
|
-
|
|
51
65
|
- Remove AccessManager and SimpleAccessManaged pattern
|
|
52
66
|
- Use OpenZeppelin Ownable2Step for two-step ownership transfer
|
|
53
67
|
- Add `permittedCallers` mapping to gate `create()` access (public by default, owner can restrict)
|
|
@@ -92,7 +106,6 @@
|
|
|
92
106
|
- 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.
|
|
93
107
|
- 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.
|
|
94
108
|
- 83726a0e: Remove unused settle negative deltas logic
|
|
95
|
-
|
|
96
109
|
- Remove redundant `_settleNegativeDeltas` function that was never executed
|
|
97
110
|
- Simplify limit order closure logic by removing unnecessary delta settlement
|
|
98
111
|
|
|
@@ -122,19 +135,16 @@
|
|
|
122
135
|
- c59a6fac: Initial release of limit orders protocol
|
|
123
136
|
|
|
124
137
|
Introduces a limit order system built on top of Uniswap V4 concentrated liquidity positions:
|
|
125
|
-
|
|
126
138
|
- **Orders as V4 Positions**: Each limit order is a single-tick-wide Uniswap V4 liquidity position, enabling makers to place orders at specific price points
|
|
127
139
|
- **FIFO Queue System**: Orders are organized in queues by `(poolKeyHash, coin, tick)` with bitmap-based tick tracking for efficient iteration
|
|
128
140
|
- **Epoch-Based Fill Protection**: Orders cannot be filled in the same epoch they were created, preventing same-transaction manipulation
|
|
129
141
|
|
|
130
142
|
**Fill Integration Modes:**
|
|
131
|
-
|
|
132
143
|
- **Auto-fill via Hook**: The Zora hook now calls `fill()` on the limit order book during `afterSwap`, automatically filling orders as swaps cross through their tick ranges
|
|
133
144
|
- **Router Fallback**: For legacy hooks, the router can call `fill()` post-swap
|
|
134
145
|
- **Third-party Fill**: Anyone can call `fill()` when the PoolManager is locked, incentivized by LP fee collection
|
|
135
146
|
|
|
136
147
|
**Fee Model:**
|
|
137
|
-
|
|
138
148
|
- Fill referrals receive accrued LP fees from filled positions
|
|
139
149
|
- Makers receive full proceeds on withdrawal
|
|
140
150
|
- Makers can cancel their limit orders to withdraw the backing currency
|