@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.
- package/.turbo/turbo-build$colon$js.log +85 -0
- package/AUDIT_NOTES.md +33 -0
- package/AUDIT_RFP.md +408 -0
- package/CHANGELOG.md +25 -0
- package/GAS_COMPARISON_RESULTS.md +194 -0
- package/LICENSE +21 -0
- package/README.md +650 -0
- package/SPEC.md +291 -0
- package/abis/BalanceDeltaLibrary.json +15 -0
- package/abis/BeforeSwapDeltaLibrary.json +15 -0
- package/abis/CurrencyLibrary.json +25 -0
- package/abis/CustomRevert.json +28 -0
- package/abis/IAllowanceTransfer.json +486 -0
- package/abis/IAuthority.json +31 -0
- package/abis/ICoin.json +1074 -0
- package/abis/IDeployedCoinVersionLookup.json +21 -0
- package/abis/IDopplerErrors.json +44 -0
- package/abis/IEIP712.json +15 -0
- package/abis/IERC1363.json +373 -0
- package/abis/IERC165.json +21 -0
- package/abis/IERC20.json +185 -0
- package/abis/IERC20Minimal.json +172 -0
- package/abis/IERC6909Claims.json +288 -0
- package/abis/IERC7572.json +21 -0
- package/abis/IExtsload.json +64 -0
- package/abis/IExttload.json +40 -0
- package/abis/IHasCoinType.json +15 -0
- package/abis/IHasPoolKey.json +42 -0
- package/abis/IHasRewardsRecipients.json +54 -0
- package/abis/IHasSwapPath.json +60 -0
- package/abis/IHasTotalSupplyForPositions.json +15 -0
- package/abis/IHooks.json +789 -0
- package/abis/IMsgSender.json +15 -0
- package/abis/IPoolManager.json +1286 -0
- package/abis/IProtocolFees.json +174 -0
- package/abis/ISupportsLimitOrderFill.json +15 -0
- package/abis/ISwapPathRouter.json +92 -0
- package/abis/ISwapRouter.json +219 -0
- package/abis/IUniswapV3SwapCallback.json +25 -0
- package/abis/IUpgradeableDestinationV4Hook.json +84 -0
- package/abis/IUpgradeableDestinationV4HookWithUpdateableFee.json +95 -0
- package/abis/IUpgradeableV4Hook.json +112 -0
- package/abis/IZoraHookRegistry.json +188 -0
- package/abis/IZoraLimitOrderBook.json +623 -0
- package/abis/IZoraLimitOrderBookCoinsInterface.json +67 -0
- package/abis/IZoraV4CoinHook.json +610 -0
- package/abis/Permit2Payments.json +7 -0
- package/abis/Position.json +7 -0
- package/abis/SafeCast.json +7 -0
- package/abis/SafeCast160.json +7 -0
- package/abis/SafeERC20.json +34 -0
- package/abis/SimpleAccessManaged.json +57 -0
- package/abis/SimpleAccessManager.json +351 -0
- package/abis/SqrtPriceMath.json +22 -0
- package/abis/StateLibrary.json +80 -0
- package/abis/SwapLimitOrders.json +22 -0
- package/abis/SwapWithLimitOrders.json +457 -0
- package/abis/TickBitmap.json +18 -0
- package/abis/TickMath.json +24 -0
- package/abis/V3ToV4SwapLib.json +28 -0
- package/abis/ZoraLimitOrderBook.json +771 -0
- package/cache/solidity-files-cache.json +1 -0
- package/dist/index.cjs +760 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +731 -0
- package/dist/index.js.map +1 -0
- package/dist/wagmiGenerated.d.ts +1012 -0
- package/dist/wagmiGenerated.d.ts.map +1 -0
- package/foundry.toml +29 -0
- package/gas_comparison.py +49 -0
- package/out/BalanceDelta.sol/BalanceDeltaLibrary.json +1 -0
- package/out/BeforeSwapDelta.sol/BeforeSwapDeltaLibrary.json +1 -0
- package/out/BitMath.sol/BitMath.json +1 -0
- package/out/BytesLib.sol/BytesLib.json +1 -0
- package/out/CoinCommon.sol/CoinCommon.json +1 -0
- package/out/CoinConfigurationVersions.sol/CoinConfigurationVersions.json +1 -0
- package/out/CoinConstants.sol/CoinConstants.json +1 -0
- package/out/Context.sol/Context.json +1 -0
- package/out/Currency.sol/CurrencyLibrary.json +1 -0
- package/out/CurrencyReserves.sol/CurrencyReserves.json +1 -0
- package/out/CustomRevert.sol/CustomRevert.json +1 -0
- package/out/DopplerMath.sol/DopplerMath.json +1 -0
- package/out/FixedPoint128.sol/FixedPoint128.json +1 -0
- package/out/FixedPoint96.sol/FixedPoint96.json +1 -0
- package/out/FullMath.sol/FullMath.json +1 -0
- package/out/IAllowanceTransfer.sol/IAllowanceTransfer.json +1 -0
- package/out/IAuthority.sol/IAuthority.json +1 -0
- package/out/ICoin.sol/ICoin.json +1 -0
- package/out/ICoin.sol/IHasCoinType.json +1 -0
- package/out/ICoin.sol/IHasPoolKey.json +1 -0
- package/out/ICoin.sol/IHasSwapPath.json +1 -0
- package/out/ICoin.sol/IHasTotalSupplyForPositions.json +1 -0
- package/out/IDeployedCoinVersionLookup.sol/IDeployedCoinVersionLookup.json +1 -0
- package/out/IDopplerErrors.sol/IDopplerErrors.json +1 -0
- package/out/IEIP712.sol/IEIP712.json +1 -0
- package/out/IERC1363.sol/IERC1363.json +1 -0
- package/out/IERC165.sol/IERC165.json +1 -0
- package/out/IERC20.sol/IERC20.json +1 -0
- package/out/IERC20Minimal.sol/IERC20Minimal.json +1 -0
- package/out/IERC6909Claims.sol/IERC6909Claims.json +1 -0
- package/out/IERC7572.sol/IERC7572.json +1 -0
- package/out/IExtsload.sol/IExtsload.json +1 -0
- package/out/IExttload.sol/IExttload.json +1 -0
- package/out/IHasRewardsRecipients.sol/IHasRewardsRecipients.json +1 -0
- package/out/IHooks.sol/IHooks.json +1 -0
- package/out/IMsgSender.sol/IMsgSender.json +1 -0
- package/out/IPoolManager.sol/IPoolManager.json +1 -0
- package/out/IProtocolFees.sol/IProtocolFees.json +1 -0
- package/out/ISupportsLimitOrderFill.sol/ISupportsLimitOrderFill.json +1 -0
- package/out/ISwapPathRouter.sol/ISwapPathRouter.json +1 -0
- package/out/ISwapRouter.sol/ISwapRouter.json +1 -0
- package/out/IUniswapV3SwapCallback.sol/IUniswapV3SwapCallback.json +1 -0
- package/out/IUpgradeableV4Hook.sol/IUpgradeableDestinationV4Hook.json +1 -0
- package/out/IUpgradeableV4Hook.sol/IUpgradeableDestinationV4HookWithUpdateableFee.json +1 -0
- package/out/IUpgradeableV4Hook.sol/IUpgradeableV4Hook.json +1 -0
- package/out/IZoraHookRegistry.sol/IZoraHookRegistry.json +1 -0
- package/out/IZoraLimitOrderBook.sol/IZoraLimitOrderBook.json +1 -0
- package/out/IZoraLimitOrderBookCoinsInterface.sol/IZoraLimitOrderBookCoinsInterface.json +1 -0
- package/out/IZoraV4CoinHook.sol/IZoraV4CoinHook.json +1 -0
- package/out/LimitOrderBitmap.sol/LimitOrderBitmap.json +1 -0
- package/out/LimitOrderCommon.sol/LimitOrderCommon.json +1 -0
- package/out/LimitOrderCreate.sol/LimitOrderCreate.json +1 -0
- package/out/LimitOrderFill.sol/LimitOrderFill.json +1 -0
- package/out/LimitOrderLiquidity.sol/LimitOrderLiquidity.json +1 -0
- package/out/LimitOrderQueues.sol/LimitOrderQueues.json +1 -0
- package/out/LimitOrderStorage.sol/LimitOrderStorage.json +1 -0
- package/out/LimitOrderTypes.sol/LimitOrderTypes.json +1 -0
- package/out/LimitOrderWithdraw.sol/LimitOrderWithdraw.json +1 -0
- package/out/LiquidityAmounts.sol/LiquidityAmounts.json +1 -0
- package/out/LiquidityMath.sol/LiquidityMath.json +1 -0
- package/out/Lock.sol/Lock.json +1 -0
- package/out/NonzeroDeltaCount.sol/NonzeroDeltaCount.json +1 -0
- package/out/Path.sol/Path.json +1 -0
- package/out/PathKey.sol/PathKeyLibrary.json +1 -0
- package/out/Permit2Payments.sol/Permit2Payments.json +1 -0
- package/out/PoolId.sol/PoolIdLibrary.json +1 -0
- package/out/Position.sol/Position.json +1 -0
- package/out/SafeCast.sol/SafeCast.json +1 -0
- package/out/SafeCast160.sol/SafeCast160.json +1 -0
- package/out/SafeERC20.sol/SafeERC20.json +1 -0
- package/out/SimpleAccessManaged.sol/SimpleAccessManaged.json +1 -0
- package/out/SimpleAccessManager.sol/SimpleAccessManager.json +1 -0
- package/out/SqrtPriceMath.sol/SqrtPriceMath.json +1 -0
- package/out/StateLibrary.sol/StateLibrary.json +1 -0
- package/out/SwapLimitOrders.sol/SwapLimitOrders.json +1 -0
- package/out/SwapWithLimitOrders.sol/SwapWithLimitOrders.json +1 -0
- package/out/TickBitmap.sol/TickBitmap.json +1 -0
- package/out/TickMath.sol/TickMath.json +1 -0
- package/out/TransientSlot.sol/TransientSlot.json +1 -0
- package/out/TransientStateLibrary.sol/TransientStateLibrary.json +1 -0
- package/out/UniV4SwapToCurrency.sol/UniV4SwapToCurrency.json +1 -0
- package/out/UnsafeMath.sol/UnsafeMath.json +1 -0
- package/out/V3ToV4SwapLib.sol/V3ToV4SwapLib.json +1 -0
- package/out/ZoraLimitOrderBook.sol/ZoraLimitOrderBook.json +1 -0
- package/out/build-info/69718f10d1dc37f0.json +1 -0
- package/out/uniswap/BitMath.sol/BitMath.json +1 -0
- package/out/uniswap/CustomRevert.sol/CustomRevert.json +1 -0
- package/out/uniswap/FullMath.sol/FullMath.json +1 -0
- package/out/uniswap/SafeCast.sol/SafeCast.json +1 -0
- package/out/uniswap/TickMath.sol/TickMath.json +1 -0
- package/package/index.ts +1 -0
- package/package/wagmiGenerated.ts +738 -0
- package/package.json +57 -0
- package/remappings.txt +11 -0
- package/src/IZoraLimitOrderBook.sol +195 -0
- package/src/ZoraLimitOrderBook.sol +220 -0
- package/src/access/SimpleAccessManaged.sol +76 -0
- package/src/access/SimpleAccessManager.sol +268 -0
- package/src/libs/LimitOrderBitmap.sol +84 -0
- package/src/libs/LimitOrderCommon.sol +91 -0
- package/src/libs/LimitOrderCreate.sol +277 -0
- package/src/libs/LimitOrderFill.sol +362 -0
- package/src/libs/LimitOrderLiquidity.sol +222 -0
- package/src/libs/LimitOrderQueues.sol +101 -0
- package/src/libs/LimitOrderStorage.sol +34 -0
- package/src/libs/LimitOrderTypes.sol +41 -0
- package/src/libs/LimitOrderWithdraw.sol +100 -0
- package/src/libs/Permit2Payments.sol +41 -0
- package/src/libs/SwapLimitOrders.sol +209 -0
- package/src/router/SwapWithLimitOrders.sol +454 -0
- package/test/LimitOrderAccessControl.t.sol +461 -0
- package/test/LimitOrderBitmap.t.sol +194 -0
- package/test/LimitOrderCreate.t.sol +348 -0
- package/test/LimitOrderFill.t.sol +1005 -0
- package/test/LimitOrderLibraries.t.sol +354 -0
- package/test/LimitOrderLiquidityPayouts.t.sol +333 -0
- package/test/LimitOrderV4Pools.t.sol +157 -0
- package/test/LimitOrderWithdraw.t.sol +653 -0
- package/test/SimpleAccessManager.t.sol +420 -0
- package/test/SwapWithLimitOrders.t.sol +107 -0
- package/test/SwapWithLimitOrdersRouter.t.sol +1073 -0
- package/test/gas/LimitOrderFillGas.t.sol +1008 -0
- package/test/gas/LimitOrderSwapGas.t.sol +403 -0
- package/test/gas/logs/gas_benchmarks_fill_20251201.log +30 -0
- package/test/gas/logs/gas_benchmarks_swap_20251201.log +27 -0
- package/test/unit/LimitOrderBitmapUnit.t.sol +276 -0
- package/test/unit/LimitOrderCreateUnit.t.sol +358 -0
- package/test/unit/SwapLimitOrdersUnit.t.sol +672 -0
- package/test/unit/SwapLimitOrdersValidation.t.sol +423 -0
- package/test/unit/SwapWithLimitOrdersUnit.t.sol +321 -0
- package/test/utils/BaseTest.sol +793 -0
- package/test/utils/TestableZoraLimitOrderBook.sol +54 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +9 -0
- package/tsup.config.ts +11 -0
- package/wagmi.config.ts +18 -0
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "balanceOf",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "maker",
|
|
8
|
+
"type": "address",
|
|
9
|
+
"internalType": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "coin",
|
|
13
|
+
"type": "address",
|
|
14
|
+
"internalType": "address"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"outputs": [
|
|
18
|
+
{
|
|
19
|
+
"name": "balance",
|
|
20
|
+
"type": "uint256",
|
|
21
|
+
"internalType": "uint256"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"stateMutability": "view"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "function",
|
|
28
|
+
"name": "create",
|
|
29
|
+
"inputs": [
|
|
30
|
+
{
|
|
31
|
+
"name": "key",
|
|
32
|
+
"type": "tuple",
|
|
33
|
+
"internalType": "struct PoolKey",
|
|
34
|
+
"components": [
|
|
35
|
+
{
|
|
36
|
+
"name": "currency0",
|
|
37
|
+
"type": "address",
|
|
38
|
+
"internalType": "Currency"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "currency1",
|
|
42
|
+
"type": "address",
|
|
43
|
+
"internalType": "Currency"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "fee",
|
|
47
|
+
"type": "uint24",
|
|
48
|
+
"internalType": "uint24"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "tickSpacing",
|
|
52
|
+
"type": "int24",
|
|
53
|
+
"internalType": "int24"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "hooks",
|
|
57
|
+
"type": "address",
|
|
58
|
+
"internalType": "contract IHooks"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "isCurrency0",
|
|
64
|
+
"type": "bool",
|
|
65
|
+
"internalType": "bool"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "orderSizes",
|
|
69
|
+
"type": "uint256[]",
|
|
70
|
+
"internalType": "uint256[]"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "orderTicks",
|
|
74
|
+
"type": "int24[]",
|
|
75
|
+
"internalType": "int24[]"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "maker",
|
|
79
|
+
"type": "address",
|
|
80
|
+
"internalType": "address"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"outputs": [
|
|
84
|
+
{
|
|
85
|
+
"name": "orderIds",
|
|
86
|
+
"type": "bytes32[]",
|
|
87
|
+
"internalType": "bytes32[]"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"stateMutability": "payable"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "function",
|
|
94
|
+
"name": "fill",
|
|
95
|
+
"inputs": [
|
|
96
|
+
{
|
|
97
|
+
"name": "key",
|
|
98
|
+
"type": "tuple",
|
|
99
|
+
"internalType": "struct PoolKey",
|
|
100
|
+
"components": [
|
|
101
|
+
{
|
|
102
|
+
"name": "currency0",
|
|
103
|
+
"type": "address",
|
|
104
|
+
"internalType": "Currency"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "currency1",
|
|
108
|
+
"type": "address",
|
|
109
|
+
"internalType": "Currency"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "fee",
|
|
113
|
+
"type": "uint24",
|
|
114
|
+
"internalType": "uint24"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "tickSpacing",
|
|
118
|
+
"type": "int24",
|
|
119
|
+
"internalType": "int24"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "hooks",
|
|
123
|
+
"type": "address",
|
|
124
|
+
"internalType": "contract IHooks"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "isCurrency0",
|
|
130
|
+
"type": "bool",
|
|
131
|
+
"internalType": "bool"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "startTick",
|
|
135
|
+
"type": "int24",
|
|
136
|
+
"internalType": "int24"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "endTick",
|
|
140
|
+
"type": "int24",
|
|
141
|
+
"internalType": "int24"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "maxFillCount",
|
|
145
|
+
"type": "uint256",
|
|
146
|
+
"internalType": "uint256"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "fillReferral",
|
|
150
|
+
"type": "address",
|
|
151
|
+
"internalType": "address"
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"outputs": [],
|
|
155
|
+
"stateMutability": "nonpayable"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"type": "function",
|
|
159
|
+
"name": "fill",
|
|
160
|
+
"inputs": [
|
|
161
|
+
{
|
|
162
|
+
"name": "batches",
|
|
163
|
+
"type": "tuple[]",
|
|
164
|
+
"internalType": "struct IZoraLimitOrderBook.OrderBatch[]",
|
|
165
|
+
"components": [
|
|
166
|
+
{
|
|
167
|
+
"name": "key",
|
|
168
|
+
"type": "tuple",
|
|
169
|
+
"internalType": "struct PoolKey",
|
|
170
|
+
"components": [
|
|
171
|
+
{
|
|
172
|
+
"name": "currency0",
|
|
173
|
+
"type": "address",
|
|
174
|
+
"internalType": "Currency"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "currency1",
|
|
178
|
+
"type": "address",
|
|
179
|
+
"internalType": "Currency"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "fee",
|
|
183
|
+
"type": "uint24",
|
|
184
|
+
"internalType": "uint24"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "tickSpacing",
|
|
188
|
+
"type": "int24",
|
|
189
|
+
"internalType": "int24"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "hooks",
|
|
193
|
+
"type": "address",
|
|
194
|
+
"internalType": "contract IHooks"
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "isCurrency0",
|
|
200
|
+
"type": "bool",
|
|
201
|
+
"internalType": "bool"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "orderIds",
|
|
205
|
+
"type": "bytes32[]",
|
|
206
|
+
"internalType": "bytes32[]"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "fillReferral",
|
|
212
|
+
"type": "address",
|
|
213
|
+
"internalType": "address"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"outputs": [],
|
|
217
|
+
"stateMutability": "nonpayable"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"type": "function",
|
|
221
|
+
"name": "getMaxFillCount",
|
|
222
|
+
"inputs": [],
|
|
223
|
+
"outputs": [
|
|
224
|
+
{
|
|
225
|
+
"name": "",
|
|
226
|
+
"type": "uint256",
|
|
227
|
+
"internalType": "uint256"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"stateMutability": "view"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"type": "function",
|
|
234
|
+
"name": "setMaxFillCount",
|
|
235
|
+
"inputs": [
|
|
236
|
+
{
|
|
237
|
+
"name": "maxFillCount",
|
|
238
|
+
"type": "uint256",
|
|
239
|
+
"internalType": "uint256"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"outputs": [],
|
|
243
|
+
"stateMutability": "nonpayable"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"type": "function",
|
|
247
|
+
"name": "withdraw",
|
|
248
|
+
"inputs": [
|
|
249
|
+
{
|
|
250
|
+
"name": "orderIds",
|
|
251
|
+
"type": "bytes32[]",
|
|
252
|
+
"internalType": "bytes32[]"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "coin",
|
|
256
|
+
"type": "address",
|
|
257
|
+
"internalType": "address"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "minAmountOut",
|
|
261
|
+
"type": "uint256",
|
|
262
|
+
"internalType": "uint256"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "recipient",
|
|
266
|
+
"type": "address",
|
|
267
|
+
"internalType": "address"
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"outputs": [],
|
|
271
|
+
"stateMutability": "nonpayable"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"type": "event",
|
|
275
|
+
"name": "LimitOrderCreated",
|
|
276
|
+
"inputs": [
|
|
277
|
+
{
|
|
278
|
+
"name": "maker",
|
|
279
|
+
"type": "address",
|
|
280
|
+
"indexed": true,
|
|
281
|
+
"internalType": "address"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "coin",
|
|
285
|
+
"type": "address",
|
|
286
|
+
"indexed": true,
|
|
287
|
+
"internalType": "address"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"name": "poolKeyHash",
|
|
291
|
+
"type": "bytes32",
|
|
292
|
+
"indexed": false,
|
|
293
|
+
"internalType": "bytes32"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "isCurrency0",
|
|
297
|
+
"type": "bool",
|
|
298
|
+
"indexed": false,
|
|
299
|
+
"internalType": "bool"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"name": "orderTick",
|
|
303
|
+
"type": "int24",
|
|
304
|
+
"indexed": false,
|
|
305
|
+
"internalType": "int24"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "currentTick",
|
|
309
|
+
"type": "int24",
|
|
310
|
+
"indexed": false,
|
|
311
|
+
"internalType": "int24"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"name": "orderSize",
|
|
315
|
+
"type": "uint128",
|
|
316
|
+
"indexed": false,
|
|
317
|
+
"internalType": "uint128"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "orderId",
|
|
321
|
+
"type": "bytes32",
|
|
322
|
+
"indexed": false,
|
|
323
|
+
"internalType": "bytes32"
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
"anonymous": false
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"type": "event",
|
|
330
|
+
"name": "LimitOrderFilled",
|
|
331
|
+
"inputs": [
|
|
332
|
+
{
|
|
333
|
+
"name": "maker",
|
|
334
|
+
"type": "address",
|
|
335
|
+
"indexed": true,
|
|
336
|
+
"internalType": "address"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"name": "coinIn",
|
|
340
|
+
"type": "address",
|
|
341
|
+
"indexed": true,
|
|
342
|
+
"internalType": "address"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "coinOut",
|
|
346
|
+
"type": "address",
|
|
347
|
+
"indexed": false,
|
|
348
|
+
"internalType": "address"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"name": "amountIn",
|
|
352
|
+
"type": "uint128",
|
|
353
|
+
"indexed": false,
|
|
354
|
+
"internalType": "uint128"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"name": "amountOut",
|
|
358
|
+
"type": "uint128",
|
|
359
|
+
"indexed": false,
|
|
360
|
+
"internalType": "uint128"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "fillReferral",
|
|
364
|
+
"type": "address",
|
|
365
|
+
"indexed": false,
|
|
366
|
+
"internalType": "address"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"name": "fillReferralAmount",
|
|
370
|
+
"type": "uint128",
|
|
371
|
+
"indexed": false,
|
|
372
|
+
"internalType": "uint128"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "poolKeyHash",
|
|
376
|
+
"type": "bytes32",
|
|
377
|
+
"indexed": false,
|
|
378
|
+
"internalType": "bytes32"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"name": "tick",
|
|
382
|
+
"type": "int24",
|
|
383
|
+
"indexed": false,
|
|
384
|
+
"internalType": "int24"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"name": "orderId",
|
|
388
|
+
"type": "bytes32",
|
|
389
|
+
"indexed": false,
|
|
390
|
+
"internalType": "bytes32"
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
"anonymous": false
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"type": "event",
|
|
397
|
+
"name": "LimitOrderUpdated",
|
|
398
|
+
"inputs": [
|
|
399
|
+
{
|
|
400
|
+
"name": "maker",
|
|
401
|
+
"type": "address",
|
|
402
|
+
"indexed": true,
|
|
403
|
+
"internalType": "address"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "coin",
|
|
407
|
+
"type": "address",
|
|
408
|
+
"indexed": true,
|
|
409
|
+
"internalType": "address"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "poolKeyHash",
|
|
413
|
+
"type": "bytes32",
|
|
414
|
+
"indexed": false,
|
|
415
|
+
"internalType": "bytes32"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "isCurrency0",
|
|
419
|
+
"type": "bool",
|
|
420
|
+
"indexed": false,
|
|
421
|
+
"internalType": "bool"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"name": "tick",
|
|
425
|
+
"type": "int24",
|
|
426
|
+
"indexed": false,
|
|
427
|
+
"internalType": "int24"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "orderSize",
|
|
431
|
+
"type": "uint128",
|
|
432
|
+
"indexed": false,
|
|
433
|
+
"internalType": "uint128"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"name": "orderId",
|
|
437
|
+
"type": "bytes32",
|
|
438
|
+
"indexed": false,
|
|
439
|
+
"internalType": "bytes32"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"name": "isCancelled",
|
|
443
|
+
"type": "bool",
|
|
444
|
+
"indexed": false,
|
|
445
|
+
"internalType": "bool"
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"anonymous": false
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"type": "event",
|
|
452
|
+
"name": "MakerBalanceUpdated",
|
|
453
|
+
"inputs": [
|
|
454
|
+
{
|
|
455
|
+
"name": "maker",
|
|
456
|
+
"type": "address",
|
|
457
|
+
"indexed": true,
|
|
458
|
+
"internalType": "address"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"name": "coin",
|
|
462
|
+
"type": "address",
|
|
463
|
+
"indexed": true,
|
|
464
|
+
"internalType": "address"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"name": "newBalance",
|
|
468
|
+
"type": "uint256",
|
|
469
|
+
"indexed": false,
|
|
470
|
+
"internalType": "uint256"
|
|
471
|
+
}
|
|
472
|
+
],
|
|
473
|
+
"anonymous": false
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"type": "error",
|
|
477
|
+
"name": "AddressZero",
|
|
478
|
+
"inputs": []
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"type": "error",
|
|
482
|
+
"name": "ArrayLengthMismatch",
|
|
483
|
+
"inputs": []
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"type": "error",
|
|
487
|
+
"name": "CoinMismatch",
|
|
488
|
+
"inputs": [
|
|
489
|
+
{
|
|
490
|
+
"name": "orderId",
|
|
491
|
+
"type": "bytes32",
|
|
492
|
+
"internalType": "bytes32"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"name": "expectedCoin",
|
|
496
|
+
"type": "address",
|
|
497
|
+
"internalType": "address"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "actualCoin",
|
|
501
|
+
"type": "address",
|
|
502
|
+
"internalType": "address"
|
|
503
|
+
}
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"type": "error",
|
|
508
|
+
"name": "InsufficientForwardedFunds",
|
|
509
|
+
"inputs": []
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"type": "error",
|
|
513
|
+
"name": "InsufficientTransferFunds",
|
|
514
|
+
"inputs": []
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"type": "error",
|
|
518
|
+
"name": "InvalidFillWindow",
|
|
519
|
+
"inputs": [
|
|
520
|
+
{
|
|
521
|
+
"name": "startTick",
|
|
522
|
+
"type": "int24",
|
|
523
|
+
"internalType": "int24"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"name": "endTick",
|
|
527
|
+
"type": "int24",
|
|
528
|
+
"internalType": "int24"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"name": "isCurrency0",
|
|
532
|
+
"type": "bool",
|
|
533
|
+
"internalType": "bool"
|
|
534
|
+
}
|
|
535
|
+
]
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"type": "error",
|
|
539
|
+
"name": "InvalidOrder",
|
|
540
|
+
"inputs": []
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
"type": "error",
|
|
544
|
+
"name": "InvalidPoolKey",
|
|
545
|
+
"inputs": []
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"type": "error",
|
|
549
|
+
"name": "MaxFillCountCannotBeZero",
|
|
550
|
+
"inputs": []
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"type": "error",
|
|
554
|
+
"name": "MinAmountNotReached",
|
|
555
|
+
"inputs": [
|
|
556
|
+
{
|
|
557
|
+
"name": "withdrawn",
|
|
558
|
+
"type": "uint256",
|
|
559
|
+
"internalType": "uint256"
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
"name": "minAmountOut",
|
|
563
|
+
"type": "uint256",
|
|
564
|
+
"internalType": "uint256"
|
|
565
|
+
}
|
|
566
|
+
]
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"type": "error",
|
|
570
|
+
"name": "NativeValueMismatch",
|
|
571
|
+
"inputs": []
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"type": "error",
|
|
575
|
+
"name": "NotPoolManager",
|
|
576
|
+
"inputs": []
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
"type": "error",
|
|
580
|
+
"name": "OnlyZoraHook",
|
|
581
|
+
"inputs": []
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"type": "error",
|
|
585
|
+
"name": "OrderClosed",
|
|
586
|
+
"inputs": []
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"type": "error",
|
|
590
|
+
"name": "OrderNotMaker",
|
|
591
|
+
"inputs": []
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"type": "error",
|
|
595
|
+
"name": "RouterMsgSenderInvalid",
|
|
596
|
+
"inputs": []
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"type": "error",
|
|
600
|
+
"name": "UnknownCallback",
|
|
601
|
+
"inputs": []
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"type": "error",
|
|
605
|
+
"name": "UnlockedFillNotAllowed",
|
|
606
|
+
"inputs": []
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"type": "error",
|
|
610
|
+
"name": "ZeroMaker",
|
|
611
|
+
"inputs": []
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"type": "error",
|
|
615
|
+
"name": "ZeroOrderSize",
|
|
616
|
+
"inputs": []
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"type": "error",
|
|
620
|
+
"name": "ZeroRealizedOrder",
|
|
621
|
+
"inputs": []
|
|
622
|
+
}
|
|
623
|
+
]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "fill",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "key",
|
|
8
|
+
"type": "tuple",
|
|
9
|
+
"internalType": "struct PoolKey",
|
|
10
|
+
"components": [
|
|
11
|
+
{
|
|
12
|
+
"name": "currency0",
|
|
13
|
+
"type": "address",
|
|
14
|
+
"internalType": "Currency"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "currency1",
|
|
18
|
+
"type": "address",
|
|
19
|
+
"internalType": "Currency"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "fee",
|
|
23
|
+
"type": "uint24",
|
|
24
|
+
"internalType": "uint24"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "tickSpacing",
|
|
28
|
+
"type": "int24",
|
|
29
|
+
"internalType": "int24"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "hooks",
|
|
33
|
+
"type": "address",
|
|
34
|
+
"internalType": "contract IHooks"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "isCurrency0",
|
|
40
|
+
"type": "bool",
|
|
41
|
+
"internalType": "bool"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "startTick",
|
|
45
|
+
"type": "int24",
|
|
46
|
+
"internalType": "int24"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "endTick",
|
|
50
|
+
"type": "int24",
|
|
51
|
+
"internalType": "int24"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "maxFillCount",
|
|
55
|
+
"type": "uint256",
|
|
56
|
+
"internalType": "uint256"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "fillReferral",
|
|
60
|
+
"type": "address",
|
|
61
|
+
"internalType": "address"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"outputs": [],
|
|
65
|
+
"stateMutability": "nonpayable"
|
|
66
|
+
}
|
|
67
|
+
]
|