@zoralabs/limit-orders 0.2.6 → 0.2.7
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 +9 -7
- package/abis/ICoin.json +5 -0
- package/cache/solidity-files-cache.json +1 -1
- package/out/CoinConfigurationVersions.sol/CoinConfigurationVersions.json +1 -1
- package/out/CoinConstants.sol/CoinConstants.json +1 -1
- package/out/ContractVersionBase.sol/ContractVersionBase.json +1 -1
- package/out/DopplerMath.sol/DopplerMath.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/IZoraV4CoinHook.sol/IZoraV4CoinHook.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/LimitOrderWithdraw.sol/LimitOrderWithdraw.json +1 -1
- package/out/SwapLimitOrders.sol/SwapLimitOrders.json +1 -1
- package/out/SwapWithLimitOrders.sol/SwapWithLimitOrders.json +1 -1
- package/out/UniV4SwapToCurrency.sol/UniV4SwapToCurrency.json +1 -1
- package/out/ZoraLimitOrderBook.sol/ZoraLimitOrderBook.json +1 -1
- package/out/build-info/{b6efea4394bdeb7d.json → fcf3d601c2943dea.json} +1 -1
- package/package.json +2 -2
- 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.7 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.7 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.7 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.87s
|
|
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.7 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.7 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
|
|
36
|
+
[90msrc/access/PermittedCallers.sol[39m 479ms (unchanged)
|
|
37
|
+
[90msrc/IZoraLimitOrderBook.sol[39m 58ms (unchanged)
|
|
38
|
+
[90msrc/libs/LimitOrderBitmap.sol[39m 70ms (unchanged)
|
|
39
|
+
[90msrc/libs/LimitOrderCommon.sol[39m 292ms (unchanged)
|
|
40
|
+
[90msrc/libs/LimitOrderCreate.sol[39m 427ms (unchanged)
|
|
41
|
+
[90msrc/libs/LimitOrderFill.sol[39m 253ms (unchanged)
|
|
42
|
+
[90msrc/libs/LimitOrderLiquidity.sol[39m 267ms (unchanged)
|
|
43
|
+
[90msrc/libs/LimitOrderQueues.sol[39m 79ms (unchanged)
|
|
44
44
|
[90msrc/libs/LimitOrderStorage.sol[39m 15ms (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
|
-
|
|
54
|
-
[90mtest/gas/
|
|
55
|
-
[90mtest/
|
|
56
|
-
[90mtest/
|
|
46
|
+
[90msrc/libs/LimitOrderViews.sol[39m 117ms (unchanged)
|
|
47
|
+
[90msrc/libs/LimitOrderWithdraw.sol[39m 110ms (unchanged)
|
|
48
|
+
[90msrc/libs/Permit2Payments.sol[39m 19ms (unchanged)
|
|
49
|
+
[90msrc/libs/SwapLimitOrders.sol[39m 175ms (unchanged)
|
|
50
|
+
[90msrc/router/SwapWithLimitOrders.sol[39m 296ms (unchanged)
|
|
51
|
+
[90msrc/version/ContractVersionBase.sol[39m 8ms (unchanged)
|
|
52
|
+
[90msrc/ZoraLimitOrderBook.sol[39m 174ms (unchanged)
|
|
53
|
+
test/DebugSwapWithLimitOrders.t.sol 166ms
|
|
54
|
+
[90mtest/gas/LimitOrderFillGas.t.sol[39m 909ms (unchanged)
|
|
55
|
+
[90mtest/gas/LimitOrderSwapGas.t.sol[39m 326ms (unchanged)
|
|
56
|
+
[90mtest/LimitOrderAccessControl.t.sol[39m 398ms (unchanged)
|
|
57
|
+
[90mtest/LimitOrderBitmap.t.sol[39m 221ms (unchanged)
|
|
57
58
|
[90mtest/LimitOrderCreate.t.sol[39m 398ms (unchanged)
|
|
58
|
-
[90mtest/LimitOrderFill.t.sol[39m
|
|
59
|
-
[90mtest/LimitOrderLibraries.t.sol[39m
|
|
60
|
-
[90mtest/LimitOrderLiquidityPayouts.t.sol[39m
|
|
61
|
-
[90mtest/LimitOrderV4Pools.t.sol[39m
|
|
62
|
-
[90mtest/LimitOrderWithdraw.t.sol[39m
|
|
63
|
-
[90mtest/SwapWithLimitOrders.t.sol[39m
|
|
64
|
-
[90mtest/SwapWithLimitOrdersRouter.t.sol[39m
|
|
65
|
-
[90mtest/unit/LimitOrderBitmapUnit.t.sol[39m
|
|
66
|
-
[90mtest/unit/LimitOrderCreateUnit.t.sol[39m
|
|
67
|
-
[90mtest/unit/SwapLimitOrdersUnit.t.sol[39m
|
|
68
|
-
[90mtest/unit/SwapLimitOrdersValidation.t.sol[39m
|
|
69
|
-
[90mtest/unit/SwapWithLimitOrdersUnit.t.sol[39m
|
|
70
|
-
[90mtest/utils/BaseTest.sol[39m
|
|
71
|
-
[90mtest/utils/MockWETH.sol[39m
|
|
72
|
-
[90mtest/utils/TestableZoraLimitOrderBook.sol[39m
|
|
59
|
+
[90mtest/LimitOrderFill.t.sol[39m 1178ms (unchanged)
|
|
60
|
+
[90mtest/LimitOrderLibraries.t.sol[39m 422ms (unchanged)
|
|
61
|
+
[90mtest/LimitOrderLiquidityPayouts.t.sol[39m 417ms (unchanged)
|
|
62
|
+
[90mtest/LimitOrderV4Pools.t.sol[39m 142ms (unchanged)
|
|
63
|
+
[90mtest/LimitOrderWithdraw.t.sol[39m 677ms (unchanged)
|
|
64
|
+
[90mtest/SwapWithLimitOrders.t.sol[39m 91ms (unchanged)
|
|
65
|
+
[90mtest/SwapWithLimitOrdersRouter.t.sol[39m 646ms (unchanged)
|
|
66
|
+
[90mtest/unit/LimitOrderBitmapUnit.t.sol[39m 87ms (unchanged)
|
|
67
|
+
[90mtest/unit/LimitOrderCreateUnit.t.sol[39m 177ms (unchanged)
|
|
68
|
+
[90mtest/unit/SwapLimitOrdersUnit.t.sol[39m 686ms (unchanged)
|
|
69
|
+
[90mtest/unit/SwapLimitOrdersValidation.t.sol[39m 256ms (unchanged)
|
|
70
|
+
[90mtest/unit/SwapWithLimitOrdersUnit.t.sol[39m 72ms (unchanged)
|
|
71
|
+
[90mtest/utils/BaseTest.sol[39m 669ms (unchanged)
|
|
72
|
+
[90mtest/utils/MockWETH.sol[39m 39ms (unchanged)
|
|
73
|
+
[90mtest/utils/TestableZoraLimitOrderBook.sol[39m 35ms (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
|
|
@@ -78,9 +79,9 @@ Compiler run successful!
|
|
|
78
79
|
[34mCLI[39m Cleaning output folder
|
|
79
80
|
[34mCJS[39m Build start
|
|
80
81
|
[34mESM[39m Build start
|
|
81
|
-
[32mESM[39m [1mdist/index.js [22m[32m24.82 KB[39m
|
|
82
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m44.67 KB[39m
|
|
83
|
-
[32mESM[39m ⚡️ Build success in 42ms
|
|
84
82
|
[32mCJS[39m [1mdist/index.cjs [22m[32m25.99 KB[39m
|
|
85
83
|
[32mCJS[39m [1mdist/index.cjs.map [22m[32m44.79 KB[39m
|
|
86
|
-
[32mCJS[39m ⚡️ Build success in
|
|
84
|
+
[32mCJS[39m ⚡️ Build success in 38ms
|
|
85
|
+
[32mESM[39m [1mdist/index.js [22m[32m24.82 KB[39m
|
|
86
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m44.67 KB[39m
|
|
87
|
+
[32mESM[39m ⚡️ Build success in 37ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
# @zoralabs/limit-orders
|
|
2
2
|
|
|
3
|
+
## 0.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ee8921b7: Fix multi-hop payout path for content coin limit orders
|
|
8
|
+
- Pass `coinIn` instead of `coinOut` to `burnAndPayout` in `LimitOrderFill._fillOrder`
|
|
9
|
+
- This ensures content coin orders pay out in the ultimate backing currency (ZORA) via the multi-hop path
|
|
10
|
+
- Previously, content coin orders would fall back to single-hop and pay out in creator coin instead of ZORA
|
|
11
|
+
|
|
3
12
|
## 0.2.6
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
6
15
|
|
|
7
16
|
- df0b0a1d: Add ContractVersionBase inheritance to ZoraLimitOrderBook and SwapWithLimitOrders
|
|
8
|
-
|
|
9
17
|
- Both contracts now inherit from ContractVersionBase for consistent version tracking
|
|
10
18
|
- Implements IVersionedContract interface with contractVersion() returning "0.2.5"
|
|
11
19
|
|
|
@@ -31,7 +39,6 @@
|
|
|
31
39
|
### Patch Changes
|
|
32
40
|
|
|
33
41
|
- 98e02520: Fix dual positive deltas consolidation in burnAndRefund
|
|
34
|
-
|
|
35
42
|
- Consolidate payouts to single currency when burning limit orders with dual positive deltas
|
|
36
43
|
- Extract path-building logic into reusable `_buildSingleHopPath` helper function
|
|
37
44
|
- Ensure users receive proceeds in their original deposit currency by swapping counter-assets
|
|
@@ -47,7 +54,6 @@
|
|
|
47
54
|
### Patch Changes
|
|
48
55
|
|
|
49
56
|
- bb2c2b76: Replace AccessManager with PermittedCallers + Ownable2Step for access control in ZoraLimitOrderBook and SwapWithLimitOrders contracts.
|
|
50
|
-
|
|
51
57
|
- Remove AccessManager and SimpleAccessManaged pattern
|
|
52
58
|
- Use OpenZeppelin Ownable2Step for two-step ownership transfer
|
|
53
59
|
- Add `permittedCallers` mapping to gate `create()` access (public by default, owner can restrict)
|
|
@@ -92,7 +98,6 @@
|
|
|
92
98
|
- 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
99
|
- 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
100
|
- 83726a0e: Remove unused settle negative deltas logic
|
|
95
|
-
|
|
96
101
|
- Remove redundant `_settleNegativeDeltas` function that was never executed
|
|
97
102
|
- Simplify limit order closure logic by removing unnecessary delta settlement
|
|
98
103
|
|
|
@@ -122,19 +127,16 @@
|
|
|
122
127
|
- c59a6fac: Initial release of limit orders protocol
|
|
123
128
|
|
|
124
129
|
Introduces a limit order system built on top of Uniswap V4 concentrated liquidity positions:
|
|
125
|
-
|
|
126
130
|
- **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
131
|
- **FIFO Queue System**: Orders are organized in queues by `(poolKeyHash, coin, tick)` with bitmap-based tick tracking for efficient iteration
|
|
128
132
|
- **Epoch-Based Fill Protection**: Orders cannot be filled in the same epoch they were created, preventing same-transaction manipulation
|
|
129
133
|
|
|
130
134
|
**Fill Integration Modes:**
|
|
131
|
-
|
|
132
135
|
- **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
136
|
- **Router Fallback**: For legacy hooks, the router can call `fill()` post-swap
|
|
134
137
|
- **Third-party Fill**: Anyone can call `fill()` when the PoolManager is locked, incentivized by LP fee collection
|
|
135
138
|
|
|
136
139
|
**Fee Model:**
|
|
137
|
-
|
|
138
140
|
- Fill referrals receive accrued LP fees from filled positions
|
|
139
141
|
- Makers receive full proceeds on withdrawal
|
|
140
142
|
- Makers can cancel their limit orders to withdraw the backing currency
|