@zoralabs/coins 2.4.0 → 2.5.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/.abi-stability +923 -0
- package/.turbo/turbo-build$colon$js.log +110 -116
- package/CHANGELOG.md +25 -0
- package/abis/Address.json +0 -16
- package/abis/BaseCoin.json +18 -0
- package/abis/BuySupplyWithSwapRouterHook.json +0 -27
- package/abis/BuySupplyWithV4SwapHook.json +0 -32
- package/abis/Clones.json +1 -1
- package/abis/CoinDopplerMultiCurve.json +109 -0
- package/abis/ContentCoin.json +18 -0
- package/abis/Create2.json +0 -21
- package/abis/CreatorCoin.json +18 -0
- package/abis/ERC1967Proxy.json +1 -1
- package/abis/ERC1967Utils.json +0 -45
- package/abis/{UpgradeCoinImpl.json → Errors.json} +14 -10
- package/abis/{MockERC20.json → IERC1363.json} +134 -104
- package/abis/IERC1967.json +47 -0
- package/abis/IERC20.json +0 -36
- package/abis/IHasCreationInfo.json +20 -0
- package/abis/IProtocolRewards.json +0 -258
- package/abis/{Script.json → ISupportsLimitOrderFill.json} +2 -2
- package/abis/IZoraLimitOrderBookCoinsInterface.json +67 -0
- package/abis/IZoraV4CoinHook.json +10 -0
- package/abis/ProxyShim.json +15 -16
- package/abis/SafeCast.json +51 -0
- package/abis/{AddressConstants.json → SafeCast160.json} +1 -1
- package/abis/Strings.json +10 -0
- package/abis/UUPSUpgradeable.json +1 -1
- package/abis/V3ToV4SwapLib.json +28 -0
- package/abis/ZoraFactory.json +1 -1
- package/abis/ZoraFactoryImpl.json +22 -6
- package/abis/ZoraV4CoinHook.json +20 -48
- package/dist/index.cjs +980 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +978 -41
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +1501 -76
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/wagmiGenerated.ts +981 -44
- package/package.json +11 -9
- package/remappings.txt +2 -1
- package/src/BaseCoin.sol +32 -2
- package/src/ZoraFactoryImpl.sol +8 -0
- package/src/deployment/ForkedCoinsAddresses.sol +54 -0
- package/src/hooks/ZoraV4CoinHook.sol +131 -20
- package/src/hooks/deployment/BuySupplyWithV4SwapHook.sol +20 -142
- package/src/interfaces/IHasCreationInfo.sol +12 -0
- package/src/interfaces/ISupportsLimitOrderFill.sol +11 -0
- package/src/interfaces/IZoraLimitOrderBookCoinsInterface.sol +21 -0
- package/src/interfaces/IZoraV4CoinHook.sol +6 -0
- package/src/libs/CoinConstants.sol +22 -0
- package/src/libs/CoinDopplerMultiCurve.sol +1 -1
- package/src/libs/CoinRewardsV4.sol +0 -1
- package/src/libs/CoinSetup.sol +7 -1
- package/src/libs/HooksDeployment.sol +20 -8
- package/src/libs/UniV4SwapHelper.sol +35 -0
- package/src/libs/V3ToV4SwapLib.sol +265 -0
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/BuySupplyWithV4SwapHook.t.sol +4 -3
- package/test/Coin.t.sol +7 -1
- package/test/CoinUniV4.t.sol +6 -1
- package/test/ContentCoinRewards.t.sol +6 -1
- package/test/CreatorCoin.t.sol +3 -1
- package/test/CreatorCoinRewards.t.sol +4 -1
- package/test/Factory.t.sol +20 -7
- package/test/HooksDeployment.t.sol +16 -3
- package/test/LaunchFee.t.sol +286 -0
- package/test/LiquidityMigration.t.sol +52 -44
- package/test/MultiOwnable.t.sol +2 -1
- package/test/Upgrades.t.sol +110 -81
- package/test/V4Liquidity.t.sol +1 -1
- package/test/mocks/MockSwapRouter.sol +33 -0
- package/test/mocks/MockZoraLimitOrderBook.sol +14 -0
- package/test/utils/BaseTest.sol +14 -448
- package/test/utils/FeeEstimatorHook.sol +6 -2
- package/test/utils/V4TestSetup.sol +595 -0
- package/wagmi.config.ts +1 -1
- package/abis/BaseTest.json +0 -718
- package/abis/DeterministicDeployerAndCaller.json +0 -315
- package/abis/DeterministicUUPSProxyDeployer.json +0 -167
- package/abis/EIP712.json +0 -67
- package/abis/ERC20.json +0 -310
- package/abis/FeeEstimatorHook.json +0 -1938
- package/abis/IERC721.json +0 -287
- package/abis/IERC721Enumerable.json +0 -343
- package/abis/IERC721Metadata.json +0 -332
- package/abis/IERC721TokenReceiver.json +0 -36
- package/abis/IImmutableCreate2Factory.json +0 -93
- package/abis/IMulticall3.json +0 -440
- package/abis/ISafe.json +0 -15
- package/abis/ISymbol.json +0 -15
- package/abis/IUniswapV4Router04.json +0 -484
- package/abis/IUniversalRouter.json +0 -61
- package/abis/IV4Quoter.json +0 -310
- package/abis/ImmutableCreate2FactoryUtils.json +0 -15
- package/abis/LibString.json +0 -7
- package/abis/Math.json +0 -7
- package/abis/MockAirlock.json +0 -39
- package/abis/MockERC721.json +0 -350
- package/abis/ProtocolRewards.json +0 -494
- package/abis/ShortStrings.json +0 -18
- package/abis/SimpleERC20.json +0 -326
- package/abis/StdAssertions.json +0 -379
- package/abis/StdInvariant.json +0 -180
- package/abis/Test.json +0 -570
- package/abis/VmContractHelper235.json +0 -233
- package/abis/VmContractHelper242.json +0 -233
- package/abis/stdError.json +0 -119
- package/abis/stdStorageSafe.json +0 -52
- package/addresses/8453.json +0 -13
- package/addresses/84532.json +0 -10
- package/deterministicConfig/deployerAndCaller.json +0 -5
- package/deterministicConfig/zoraFactory.json +0 -8
- package/script/Deploy.s.sol +0 -23
- package/script/DeployAutoSwapper.s.sol +0 -30
- package/script/DeployDevFactory.s.sol +0 -21
- package/script/DeployPostDeploymentHooks.s.sol +0 -20
- package/script/DeployTrustedMsgSenderLookup.s.sol +0 -20
- package/script/DeployUpgradeGate.s.sol +0 -21
- package/script/GenerateDeterministicParams.s.sol +0 -43
- package/script/PrintRegisterUpgradePath.s.sol +0 -28
- package/script/PrintUpgradeCommand.s.sol +0 -13
- package/script/TestBackingCoinSwap.s.sol +0 -144
- package/script/TestV4Swap.s.sol +0 -133
- package/script/UpgradeCoinImpl.sol +0 -23
- package/script/UpgradeFactoryImpl.s.sol +0 -28
- package/script/UpgradeHooks.s.sol +0 -23
- package/src/deployment/CoinsDeployerBase.sol +0 -297
- /package/{test → src}/utils/ProxyShim.sol +0 -0
package/test/Upgrades.t.sol
CHANGED
|
@@ -4,10 +4,16 @@ import {Test} from "forge-std/Test.sol";
|
|
|
4
4
|
import {IZoraFactory} from "../src/interfaces/IZoraFactory.sol";
|
|
5
5
|
import {ZoraFactoryImpl} from "../src/ZoraFactoryImpl.sol";
|
|
6
6
|
import {BaseTest} from "./utils/BaseTest.sol";
|
|
7
|
-
import {
|
|
7
|
+
import {ForkedCoinsAddresses} from "../src/deployment/ForkedCoinsAddresses.sol";
|
|
8
8
|
import {CoinConfigurationVersions} from "../src/libs/CoinConfigurationVersions.sol";
|
|
9
9
|
import {ICoin} from "../src/interfaces/ICoin.sol";
|
|
10
10
|
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
11
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
12
|
+
import {IAirlock} from "../src/interfaces/IAirlock.sol";
|
|
13
|
+
import {IPermit2} from "permit2/src/interfaces/IPermit2.sol";
|
|
14
|
+
import {IUniversalRouter} from "@uniswap/universal-router/contracts/interfaces/IUniversalRouter.sol";
|
|
15
|
+
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
|
|
16
|
+
import {IV4Quoter} from "@uniswap/v4-periphery/src/interfaces/IV4Quoter.sol";
|
|
11
17
|
import {ISwapRouter} from "../src/interfaces/ISwapRouter.sol";
|
|
12
18
|
import {IWETH} from "../src/interfaces/IWETH.sol";
|
|
13
19
|
import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol";
|
|
@@ -37,9 +43,32 @@ contract BadImpl {
|
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
|
|
40
|
-
contract UpgradesTest is BaseTest,
|
|
46
|
+
contract UpgradesTest is BaseTest, ForkedCoinsAddresses {
|
|
41
47
|
ZoraFactoryImpl public factoryProxy;
|
|
42
48
|
|
|
49
|
+
function setUp() public override {
|
|
50
|
+
weth = IWETH(WETH_ADDRESS);
|
|
51
|
+
usdc = IERC20Metadata(USDC_ADDRESS);
|
|
52
|
+
zoraToken = IERC20Metadata(ZORA_TOKEN_ADDRESS);
|
|
53
|
+
swapRouter = ISwapRouter(SWAP_ROUTER);
|
|
54
|
+
airlock = IAirlock(DOPPLER_AIRLOCK);
|
|
55
|
+
permit2 = IPermit2(V4_PERMIT2);
|
|
56
|
+
router = IUniversalRouter(UNIVERSAL_ROUTER);
|
|
57
|
+
poolManager = IPoolManager(V4_POOL_MANAGER);
|
|
58
|
+
quoter = IV4Quoter(V4_QUOTER);
|
|
59
|
+
users = Users({
|
|
60
|
+
factoryOwner: makeAddr("factoryOwner"),
|
|
61
|
+
feeRecipient: makeAddr("feeRecipient"),
|
|
62
|
+
creator: makeAddr("creator"),
|
|
63
|
+
platformReferrer: makeAddr("platformReferrer"),
|
|
64
|
+
buyer: makeAddr("buyer"),
|
|
65
|
+
seller: makeAddr("seller"),
|
|
66
|
+
coinRecipient: makeAddr("coinRecipient"),
|
|
67
|
+
tradeReferrer: makeAddr("tradeReferrer"),
|
|
68
|
+
dopplerRecipient: makeAddr("dopplerRecipient")
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
43
72
|
function test_canUpgradeFromVersionWithoutContractName() public {
|
|
44
73
|
// this test that we can upgrade from the current version, which doesn't have a contract name
|
|
45
74
|
vm.createSelectFork("base", 29675508);
|
|
@@ -186,37 +215,36 @@ contract UpgradesTest is BaseTest, CoinsDeployerBase {
|
|
|
186
215
|
vm.stopPrank();
|
|
187
216
|
}
|
|
188
217
|
|
|
189
|
-
function test_canUpgradeBrokenContentCoinAndSwap() public {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
|
|
218
|
+
// function test_canUpgradeBrokenContentCoinAndSwap() public {
|
|
219
|
+
// vm.createSelectFork("base", 32613149);
|
|
193
220
|
|
|
194
|
-
|
|
221
|
+
// address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
|
|
195
222
|
|
|
196
|
-
|
|
223
|
+
// address contentCoin = 0xB9799C839818bF50240CE683363D00c43a2E23b8;
|
|
197
224
|
|
|
198
|
-
|
|
225
|
+
// address creatorCoin = ICoin(contentCoin).currency();
|
|
199
226
|
|
|
200
|
-
|
|
227
|
+
// uint256 amountIn = 0.000111 ether;
|
|
201
228
|
|
|
202
|
-
|
|
229
|
+
// ITrustedMsgSenderProviderLookup trustedMsgSenderLookup2 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
|
|
230
|
+
// bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup2, upgradeGate, address(mockZoraLimitOrderBook));
|
|
203
231
|
|
|
204
|
-
|
|
232
|
+
// (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
|
|
205
233
|
|
|
206
|
-
|
|
234
|
+
// address existingHook = address(ICoin(contentCoin).hooks());
|
|
207
235
|
|
|
208
|
-
|
|
209
|
-
|
|
236
|
+
// address[] memory baseImpls = new address[](1);
|
|
237
|
+
// baseImpls[0] = existingHook;
|
|
210
238
|
|
|
211
|
-
|
|
212
|
-
|
|
239
|
+
// vm.prank(Ownable(upgradeGate).owner());
|
|
240
|
+
// IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
|
|
213
241
|
|
|
214
|
-
|
|
215
|
-
|
|
242
|
+
// vm.prank(MultiOwnable(contentCoin).owners()[0]);
|
|
243
|
+
// ContentCoin(contentCoin).migrateLiquidity(address(newHook), "");
|
|
216
244
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
245
|
+
// // do some swaps to test out
|
|
246
|
+
// _swapSomeCurrencyForCoin(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
|
|
247
|
+
// }
|
|
220
248
|
|
|
221
249
|
function getPositionInfo(
|
|
222
250
|
PoolKey memory key,
|
|
@@ -240,93 +268,94 @@ contract UpgradesTest is BaseTest, CoinsDeployerBase {
|
|
|
240
268
|
return getLiquidityForPositions(coin.getPoolKey(), IZoraV4CoinHook(address(coin.hooks())).getPoolCoin(coin.getPoolKey()).positions);
|
|
241
269
|
}
|
|
242
270
|
|
|
243
|
-
function test_canUpgradeBrokenCreatorCoinAndSwap() public {
|
|
244
|
-
|
|
271
|
+
// function test_canUpgradeBrokenCreatorCoinAndSwap() public {
|
|
272
|
+
// vm.createSelectFork("base", 31872861);
|
|
245
273
|
|
|
246
|
-
|
|
274
|
+
// address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
|
|
247
275
|
|
|
248
|
-
|
|
276
|
+
// ICoin creatorCoin = ICoin(0x2F03aB8fD97F5874bc3274C296Bb954Ae92EdA34);
|
|
249
277
|
|
|
250
|
-
|
|
278
|
+
// address zora = creatorCoin.currency();
|
|
251
279
|
|
|
252
|
-
|
|
280
|
+
// address existingHook = address(creatorCoin.hooks());
|
|
253
281
|
|
|
254
|
-
|
|
282
|
+
// ITrustedMsgSenderProviderLookup trustedMsgSenderLookup3 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
|
|
283
|
+
// bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup3, upgradeGate, address(mockZoraLimitOrderBook));
|
|
255
284
|
|
|
256
|
-
|
|
285
|
+
// (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
|
|
257
286
|
|
|
258
|
-
|
|
287
|
+
// address[] memory baseImpls = new address[](1);
|
|
288
|
+
// baseImpls[0] = existingHook;
|
|
259
289
|
|
|
260
|
-
|
|
261
|
-
|
|
290
|
+
// vm.prank(Ownable(upgradeGate).owner());
|
|
291
|
+
// IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
|
|
262
292
|
|
|
263
|
-
|
|
264
|
-
|
|
293
|
+
// LpPosition[] memory beforePositions = IZoraV4CoinHook(address(creatorCoin.hooks())).getPoolCoin(creatorCoin.getPoolKey()).positions;
|
|
294
|
+
// PoolKey memory beforeKey = creatorCoin.getPoolKey();
|
|
265
295
|
|
|
266
|
-
|
|
267
|
-
|
|
296
|
+
// uint128[] memory beforeLiquidity = getLiquidityForPositions(beforeKey, beforePositions);
|
|
297
|
+
// // get before price
|
|
298
|
+
// uint160 beforePrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
|
|
268
299
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
uint160 beforePrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
|
|
300
|
+
// vm.prank(MultiOwnable(address(creatorCoin)).owners()[0]);
|
|
301
|
+
// ContentCoin(address(creatorCoin)).migrateLiquidity(address(newHook), "");
|
|
272
302
|
|
|
273
|
-
|
|
274
|
-
|
|
303
|
+
// // get liquidity of original positions after migration
|
|
304
|
+
// uint128[] memory liquidityOfPositionsAfterMigration = getLiquidityForPositions(beforeKey, beforePositions);
|
|
275
305
|
|
|
276
|
-
|
|
277
|
-
|
|
306
|
+
// // there should be no liquidity left in the original positions after migration
|
|
307
|
+
// for (uint256 i = 0; i < liquidityOfPositionsAfterMigration.length; i++) {
|
|
308
|
+
// assertEq(liquidityOfPositionsAfterMigration[i], 0);
|
|
309
|
+
// }
|
|
278
310
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
// get liquidity of new positions after migration
|
|
285
|
-
PoolKey memory afterKey = creatorCoin.getPoolKey();
|
|
286
|
-
LpPosition[] memory afterPositions = IZoraV4CoinHook(address(afterKey.hooks)).getPoolCoin(afterKey).positions;
|
|
287
|
-
uint128[] memory afterLiquidity = getLiquidityForPositions(afterKey, afterPositions);
|
|
311
|
+
// // get liquidity of new positions after migration
|
|
312
|
+
// PoolKey memory afterKey = creatorCoin.getPoolKey();
|
|
313
|
+
// LpPosition[] memory afterPositions = IZoraV4CoinHook(address(afterKey.hooks)).getPoolCoin(afterKey).positions;
|
|
314
|
+
// uint128[] memory afterLiquidity = getLiquidityForPositions(afterKey, afterPositions);
|
|
288
315
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
316
|
+
// for (uint256 i = 0; i < beforeLiquidity.length; i++) {
|
|
317
|
+
// // we added any extra liquidity to the last position, so we don't expect it to be the same
|
|
318
|
+
// if (i != beforeLiquidity.length - 1) {
|
|
319
|
+
// assertApproxEqAbs(beforeLiquidity[i], afterLiquidity[i], 200);
|
|
320
|
+
// }
|
|
321
|
+
// }
|
|
292
322
|
|
|
293
|
-
|
|
323
|
+
// uint160 afterPrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
|
|
294
324
|
|
|
295
|
-
|
|
325
|
+
// assertEq(beforePrice, afterPrice);
|
|
296
326
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
assertApproxEqAbs(creatorCoin.getPoolKey().currency1.balanceOf(address(newHook)), 0, 0.1 ether);
|
|
327
|
+
// // make sure that the new hook has no balance of 0 or 1
|
|
328
|
+
// assertApproxEqAbs(creatorCoin.getPoolKey().currency0.balanceOf(address(newHook)), 0, 10);
|
|
329
|
+
// assertApproxEqAbs(creatorCoin.getPoolKey().currency1.balanceOf(address(newHook)), 0, 10);
|
|
301
330
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
331
|
+
// // now try to swap some currency for the creator coin - it should succeed
|
|
332
|
+
// _swapSomeCurrencyForCoin(creatorCoin, zora, uint128(IERC20(zora).balanceOf(trader) / 2), trader);
|
|
333
|
+
// }
|
|
305
334
|
|
|
306
|
-
function test_canFixBrokenContentCoinAndSwap() public {
|
|
307
|
-
|
|
335
|
+
// function test_canFixBrokenContentCoinAndSwap() public {
|
|
336
|
+
// vm.createSelectFork("base", 31835069);
|
|
308
337
|
|
|
309
|
-
|
|
338
|
+
// address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
|
|
310
339
|
|
|
311
|
-
|
|
340
|
+
// address contentCoin = 0x4E93A01c90f812284F71291a8d1415a904957156;
|
|
312
341
|
|
|
313
|
-
|
|
342
|
+
// address creatorCoin = ICoin(contentCoin).currency();
|
|
314
343
|
|
|
315
|
-
|
|
344
|
+
// uint256 amountIn = IERC20(creatorCoin).balanceOf(trader);
|
|
316
345
|
|
|
317
|
-
|
|
346
|
+
// require(amountIn > 0, "no balance");
|
|
318
347
|
|
|
319
|
-
|
|
320
|
-
|
|
348
|
+
// // this swap should revert because the content coin is broken
|
|
349
|
+
// _swapSomeCurrencyForCoinAndExpectRevert(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
|
|
321
350
|
|
|
322
|
-
|
|
323
|
-
|
|
351
|
+
// ITrustedMsgSenderProviderLookup trustedMsgSenderLookup2 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
|
|
352
|
+
// bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup2, upgradeGate, address(mockZoraLimitOrderBook));
|
|
324
353
|
|
|
325
|
-
|
|
354
|
+
// (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
|
|
326
355
|
|
|
327
|
-
|
|
328
|
-
|
|
356
|
+
// // etch new hook into the content coin, it shouldn't revert anymore when swapping
|
|
357
|
+
// vm.etch(address(ICoin(contentCoin).hooks()), address(newHook).code);
|
|
329
358
|
|
|
330
|
-
|
|
331
|
-
}
|
|
359
|
+
// _swapSomeCurrencyForCoin(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
|
|
360
|
+
// }
|
|
332
361
|
}
|
package/test/V4Liquidity.t.sol
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.13;
|
|
3
3
|
|
|
4
|
-
import "./utils/BaseTest.sol";
|
|
4
|
+
import {BaseTest} from "./utils/BaseTest.sol";
|
|
5
5
|
import {CoinConfigurationVersions} from "../src/libs/CoinConfigurationVersions.sol";
|
|
6
6
|
import {CoinDopplerMultiCurve} from "../src/libs/CoinDopplerMultiCurve.sol";
|
|
7
7
|
import {V4Liquidity} from "../src/libs/V4Liquidity.sol";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.28;
|
|
3
|
+
|
|
4
|
+
import {ISwapRouter} from "../../src/interfaces/ISwapRouter.sol";
|
|
5
|
+
|
|
6
|
+
/// @notice Mock V3 SwapRouter for non-forked tests
|
|
7
|
+
/// @dev This mock doesn't implement any actual swap logic - it's just to satisfy constructor requirements
|
|
8
|
+
contract MockSwapRouter is ISwapRouter {
|
|
9
|
+
/// @notice Mock implementation - reverts since V3 swaps shouldn't be called in non-forked tests
|
|
10
|
+
function exactInputSingle(ExactInputSingleParams calldata) external payable returns (uint256) {
|
|
11
|
+
revert("MockSwapRouter: V3 swaps not supported in non-forked tests");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/// @notice Mock implementation - reverts since V3 swaps shouldn't be called in non-forked tests
|
|
15
|
+
function exactInput(ExactInputParams calldata) external payable returns (uint256) {
|
|
16
|
+
revert("MockSwapRouter: V3 swaps not supported in non-forked tests");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// @notice Mock implementation - reverts since V3 swaps shouldn't be called in non-forked tests
|
|
20
|
+
function exactOutputSingle(ExactOutputSingleParams calldata) external payable returns (uint256) {
|
|
21
|
+
revert("MockSwapRouter: V3 swaps not supported in non-forked tests");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/// @notice Mock implementation - reverts since V3 swaps shouldn't be called in non-forked tests
|
|
25
|
+
function exactOutput(ExactOutputParams calldata) external payable returns (uint256) {
|
|
26
|
+
revert("MockSwapRouter: V3 swaps not supported in non-forked tests");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// @notice Mock implementation of V3 callback - reverts since V3 swaps shouldn't be called in non-forked tests
|
|
30
|
+
function uniswapV3SwapCallback(int256, int256, bytes calldata) external pure {
|
|
31
|
+
revert("MockSwapRouter: V3 swaps not supported in non-forked tests");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.13;
|
|
3
|
+
|
|
4
|
+
import {IZoraLimitOrderBookCoinsInterface} from "../../src/interfaces/IZoraLimitOrderBookCoinsInterface.sol";
|
|
5
|
+
import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol";
|
|
6
|
+
|
|
7
|
+
/// @title MockZoraLimitOrderBook
|
|
8
|
+
/// @notice Mock implementation of IZoraLimitOrderBookCoinsInterface for testing purposes
|
|
9
|
+
contract MockZoraLimitOrderBook is IZoraLimitOrderBookCoinsInterface {
|
|
10
|
+
/// @notice Fills limit orders within a tick window (mock implementation does nothing)
|
|
11
|
+
function fill(PoolKey calldata, bool, int24, int24, uint256, address) external override {
|
|
12
|
+
// Mock implementation - does nothing
|
|
13
|
+
}
|
|
14
|
+
}
|