@zoralabs/coins 2.3.1 → 2.4.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.
- package/.turbo/turbo-build$colon$js.log +119 -128
- package/CHANGELOG.md +30 -0
- package/abis/Address.json +0 -16
- 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/Create2.json +0 -21
- 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/IProtocolRewards.json +0 -258
- package/abis/{Script.json → ISupportsLimitOrderFill.json} +2 -2
- package/abis/ITrustedMsgSenderProviderLookup.json +21 -0
- package/abis/IZoraLimitOrderBookCoinsInterface.json +67 -0
- package/abis/IZoraV4CoinHook.json +15 -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/TrustedMsgSenderProviderLookup.json +215 -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 +41 -51
- package/dist/index.cjs +950 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +948 -41
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +1459 -76
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/foundry.toml +5 -1
- package/package/wagmiGenerated.ts +951 -44
- package/package.json +7 -7
- package/remappings.txt +2 -1
- package/src/ZoraFactoryImpl.sol +8 -0
- package/src/deployment/ForkedCoinsAddresses.sol +54 -0
- package/src/hooks/ZoraV4CoinHook.sol +92 -74
- package/src/hooks/deployment/BuySupplyWithV4SwapHook.sol +20 -142
- package/src/interfaces/ISupportsLimitOrderFill.sol +11 -0
- package/src/interfaces/ITrustedMsgSenderProviderLookup.sol +18 -0
- package/src/interfaces/IZoraLimitOrderBookCoinsInterface.sol +21 -0
- package/src/interfaces/IZoraV4CoinHook.sol +9 -0
- package/src/libs/CoinConstants.sol +6 -0
- package/src/libs/CoinDopplerMultiCurve.sol +1 -1
- package/src/libs/CoinRewardsV4.sol +0 -1
- package/src/libs/HooksDeployment.sol +25 -12
- package/src/libs/UniV4SwapHelper.sol +35 -0
- package/src/libs/V3ToV4SwapLib.sol +261 -0
- package/src/libs/V4Liquidity.sol +50 -6
- package/src/utils/TrustedMsgSenderProviderLookup.sol +73 -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 +2 -1
- package/test/ContentCoinRewards.t.sol +5 -1
- package/test/CreatorCoin.t.sol +3 -1
- package/test/CreatorCoinRewards.t.sol +7 -1
- package/test/Factory.t.sol +20 -7
- package/test/HooksDeployment.t.sol +73 -8
- package/test/LiquidityMigration.t.sol +55 -43
- package/test/MultiOwnable.t.sol +2 -1
- package/test/TrustedMsgSenderProviderLookup.t.sol +112 -0
- package/test/Upgrades.t.sol +112 -78
- 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 +17 -425
- package/test/utils/FeeEstimatorHook.sol +8 -2
- package/test/utils/TrustedSenderTestHelper.sol +18 -0
- 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 -1915
- 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/VmContractHelper239.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/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 -276
- /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";
|
|
@@ -28,6 +34,8 @@ import {StateLibrary} from "@uniswap/v4-core/src/libraries/StateLibrary.sol";
|
|
|
28
34
|
import {IZoraV4CoinHook} from "../src/interfaces/IZoraV4CoinHook.sol";
|
|
29
35
|
import {PoolStateReader} from "../src/libs/PoolStateReader.sol";
|
|
30
36
|
import {LpPosition} from "../src/types/LpPosition.sol";
|
|
37
|
+
import {ITrustedMsgSenderProviderLookup} from "../src/interfaces/ITrustedMsgSenderProviderLookup.sol";
|
|
38
|
+
import {TrustedSenderTestHelper} from "./utils/TrustedSenderTestHelper.sol";
|
|
31
39
|
|
|
32
40
|
contract BadImpl {
|
|
33
41
|
function contractName() public pure returns (string memory) {
|
|
@@ -35,9 +43,32 @@ contract BadImpl {
|
|
|
35
43
|
}
|
|
36
44
|
}
|
|
37
45
|
|
|
38
|
-
contract UpgradesTest is BaseTest,
|
|
46
|
+
contract UpgradesTest is BaseTest, ForkedCoinsAddresses {
|
|
39
47
|
ZoraFactoryImpl public factoryProxy;
|
|
40
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
|
+
|
|
41
72
|
function test_canUpgradeFromVersionWithoutContractName() public {
|
|
42
73
|
// this test that we can upgrade from the current version, which doesn't have a contract name
|
|
43
74
|
vm.createSelectFork("base", 29675508);
|
|
@@ -184,35 +215,36 @@ contract UpgradesTest is BaseTest, CoinsDeployerBase {
|
|
|
184
215
|
vm.stopPrank();
|
|
185
216
|
}
|
|
186
217
|
|
|
187
|
-
function test_canUpgradeBrokenContentCoinAndSwap() public {
|
|
188
|
-
|
|
218
|
+
// function test_canUpgradeBrokenContentCoinAndSwap() public {
|
|
219
|
+
// vm.createSelectFork("base", 32613149);
|
|
189
220
|
|
|
190
|
-
|
|
221
|
+
// address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
|
|
191
222
|
|
|
192
|
-
|
|
223
|
+
// address contentCoin = 0xB9799C839818bF50240CE683363D00c43a2E23b8;
|
|
193
224
|
|
|
194
|
-
|
|
225
|
+
// address creatorCoin = ICoin(contentCoin).currency();
|
|
195
226
|
|
|
196
|
-
|
|
227
|
+
// uint256 amountIn = 0.000111 ether;
|
|
197
228
|
|
|
198
|
-
|
|
229
|
+
// ITrustedMsgSenderProviderLookup trustedMsgSenderLookup2 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
|
|
230
|
+
// bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup2, upgradeGate, address(mockZoraLimitOrderBook));
|
|
199
231
|
|
|
200
|
-
|
|
232
|
+
// (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
|
|
201
233
|
|
|
202
|
-
|
|
234
|
+
// address existingHook = address(ICoin(contentCoin).hooks());
|
|
203
235
|
|
|
204
|
-
|
|
205
|
-
|
|
236
|
+
// address[] memory baseImpls = new address[](1);
|
|
237
|
+
// baseImpls[0] = existingHook;
|
|
206
238
|
|
|
207
|
-
|
|
208
|
-
|
|
239
|
+
// vm.prank(Ownable(upgradeGate).owner());
|
|
240
|
+
// IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
|
|
209
241
|
|
|
210
|
-
|
|
211
|
-
|
|
242
|
+
// vm.prank(MultiOwnable(contentCoin).owners()[0]);
|
|
243
|
+
// ContentCoin(contentCoin).migrateLiquidity(address(newHook), "");
|
|
212
244
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
245
|
+
// // do some swaps to test out
|
|
246
|
+
// _swapSomeCurrencyForCoin(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
|
|
247
|
+
// }
|
|
216
248
|
|
|
217
249
|
function getPositionInfo(
|
|
218
250
|
PoolKey memory key,
|
|
@@ -236,92 +268,94 @@ contract UpgradesTest is BaseTest, CoinsDeployerBase {
|
|
|
236
268
|
return getLiquidityForPositions(coin.getPoolKey(), IZoraV4CoinHook(address(coin.hooks())).getPoolCoin(coin.getPoolKey()).positions);
|
|
237
269
|
}
|
|
238
270
|
|
|
239
|
-
function test_canUpgradeBrokenCreatorCoinAndSwap() public {
|
|
240
|
-
|
|
271
|
+
// function test_canUpgradeBrokenCreatorCoinAndSwap() public {
|
|
272
|
+
// vm.createSelectFork("base", 31872861);
|
|
241
273
|
|
|
242
|
-
|
|
274
|
+
// address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
|
|
243
275
|
|
|
244
|
-
|
|
276
|
+
// ICoin creatorCoin = ICoin(0x2F03aB8fD97F5874bc3274C296Bb954Ae92EdA34);
|
|
245
277
|
|
|
246
|
-
|
|
278
|
+
// address zora = creatorCoin.currency();
|
|
247
279
|
|
|
248
|
-
|
|
280
|
+
// address existingHook = address(creatorCoin.hooks());
|
|
249
281
|
|
|
250
|
-
|
|
282
|
+
// ITrustedMsgSenderProviderLookup trustedMsgSenderLookup3 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
|
|
283
|
+
// bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup3, upgradeGate, address(mockZoraLimitOrderBook));
|
|
251
284
|
|
|
252
|
-
|
|
285
|
+
// (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
|
|
253
286
|
|
|
254
|
-
|
|
255
|
-
|
|
287
|
+
// address[] memory baseImpls = new address[](1);
|
|
288
|
+
// baseImpls[0] = existingHook;
|
|
256
289
|
|
|
257
|
-
|
|
258
|
-
|
|
290
|
+
// vm.prank(Ownable(upgradeGate).owner());
|
|
291
|
+
// IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
|
|
259
292
|
|
|
260
|
-
|
|
261
|
-
|
|
293
|
+
// LpPosition[] memory beforePositions = IZoraV4CoinHook(address(creatorCoin.hooks())).getPoolCoin(creatorCoin.getPoolKey()).positions;
|
|
294
|
+
// PoolKey memory beforeKey = creatorCoin.getPoolKey();
|
|
262
295
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
296
|
+
// uint128[] memory beforeLiquidity = getLiquidityForPositions(beforeKey, beforePositions);
|
|
297
|
+
// // get before price
|
|
298
|
+
// uint160 beforePrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
|
|
266
299
|
|
|
267
|
-
|
|
268
|
-
|
|
300
|
+
// vm.prank(MultiOwnable(address(creatorCoin)).owners()[0]);
|
|
301
|
+
// ContentCoin(address(creatorCoin)).migrateLiquidity(address(newHook), "");
|
|
269
302
|
|
|
270
|
-
|
|
271
|
-
|
|
303
|
+
// // get liquidity of original positions after migration
|
|
304
|
+
// uint128[] memory liquidityOfPositionsAfterMigration = getLiquidityForPositions(beforeKey, beforePositions);
|
|
272
305
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
+
// }
|
|
277
310
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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);
|
|
282
315
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
+
// }
|
|
289
322
|
|
|
290
|
-
|
|
323
|
+
// uint160 afterPrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
|
|
291
324
|
|
|
292
|
-
|
|
325
|
+
// assertEq(beforePrice, afterPrice);
|
|
293
326
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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);
|
|
297
330
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
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
|
+
// }
|
|
301
334
|
|
|
302
|
-
function test_canFixBrokenContentCoinAndSwap() public {
|
|
303
|
-
|
|
335
|
+
// function test_canFixBrokenContentCoinAndSwap() public {
|
|
336
|
+
// vm.createSelectFork("base", 31835069);
|
|
304
337
|
|
|
305
|
-
|
|
338
|
+
// address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
|
|
306
339
|
|
|
307
|
-
|
|
340
|
+
// address contentCoin = 0x4E93A01c90f812284F71291a8d1415a904957156;
|
|
308
341
|
|
|
309
|
-
|
|
342
|
+
// address creatorCoin = ICoin(contentCoin).currency();
|
|
310
343
|
|
|
311
|
-
|
|
344
|
+
// uint256 amountIn = IERC20(creatorCoin).balanceOf(trader);
|
|
312
345
|
|
|
313
|
-
|
|
346
|
+
// require(amountIn > 0, "no balance");
|
|
314
347
|
|
|
315
|
-
|
|
316
|
-
|
|
348
|
+
// // this swap should revert because the content coin is broken
|
|
349
|
+
// _swapSomeCurrencyForCoinAndExpectRevert(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
|
|
317
350
|
|
|
318
|
-
|
|
351
|
+
// ITrustedMsgSenderProviderLookup trustedMsgSenderLookup2 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
|
|
352
|
+
// bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup2, upgradeGate, address(mockZoraLimitOrderBook));
|
|
319
353
|
|
|
320
|
-
|
|
354
|
+
// (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
|
|
321
355
|
|
|
322
|
-
|
|
323
|
-
|
|
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);
|
|
324
358
|
|
|
325
|
-
|
|
326
|
-
}
|
|
359
|
+
// _swapSomeCurrencyForCoin(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
|
|
360
|
+
// }
|
|
327
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
|
+
}
|