@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.
Files changed (129) hide show
  1. package/.abi-stability +923 -0
  2. package/.turbo/turbo-build$colon$js.log +110 -116
  3. package/CHANGELOG.md +25 -0
  4. package/abis/Address.json +0 -16
  5. package/abis/BaseCoin.json +18 -0
  6. package/abis/BuySupplyWithSwapRouterHook.json +0 -27
  7. package/abis/BuySupplyWithV4SwapHook.json +0 -32
  8. package/abis/Clones.json +1 -1
  9. package/abis/CoinDopplerMultiCurve.json +109 -0
  10. package/abis/ContentCoin.json +18 -0
  11. package/abis/Create2.json +0 -21
  12. package/abis/CreatorCoin.json +18 -0
  13. package/abis/ERC1967Proxy.json +1 -1
  14. package/abis/ERC1967Utils.json +0 -45
  15. package/abis/{UpgradeCoinImpl.json → Errors.json} +14 -10
  16. package/abis/{MockERC20.json → IERC1363.json} +134 -104
  17. package/abis/IERC1967.json +47 -0
  18. package/abis/IERC20.json +0 -36
  19. package/abis/IHasCreationInfo.json +20 -0
  20. package/abis/IProtocolRewards.json +0 -258
  21. package/abis/{Script.json → ISupportsLimitOrderFill.json} +2 -2
  22. package/abis/IZoraLimitOrderBookCoinsInterface.json +67 -0
  23. package/abis/IZoraV4CoinHook.json +10 -0
  24. package/abis/ProxyShim.json +15 -16
  25. package/abis/SafeCast.json +51 -0
  26. package/abis/{AddressConstants.json → SafeCast160.json} +1 -1
  27. package/abis/Strings.json +10 -0
  28. package/abis/UUPSUpgradeable.json +1 -1
  29. package/abis/V3ToV4SwapLib.json +28 -0
  30. package/abis/ZoraFactory.json +1 -1
  31. package/abis/ZoraFactoryImpl.json +22 -6
  32. package/abis/ZoraV4CoinHook.json +20 -48
  33. package/dist/index.cjs +980 -43
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.js +978 -41
  36. package/dist/index.js.map +1 -1
  37. package/dist/wagmiGenerated.d.ts +1501 -76
  38. package/dist/wagmiGenerated.d.ts.map +1 -1
  39. package/package/wagmiGenerated.ts +981 -44
  40. package/package.json +11 -9
  41. package/remappings.txt +2 -1
  42. package/src/BaseCoin.sol +32 -2
  43. package/src/ZoraFactoryImpl.sol +8 -0
  44. package/src/deployment/ForkedCoinsAddresses.sol +54 -0
  45. package/src/hooks/ZoraV4CoinHook.sol +131 -20
  46. package/src/hooks/deployment/BuySupplyWithV4SwapHook.sol +20 -142
  47. package/src/interfaces/IHasCreationInfo.sol +12 -0
  48. package/src/interfaces/ISupportsLimitOrderFill.sol +11 -0
  49. package/src/interfaces/IZoraLimitOrderBookCoinsInterface.sol +21 -0
  50. package/src/interfaces/IZoraV4CoinHook.sol +6 -0
  51. package/src/libs/CoinConstants.sol +22 -0
  52. package/src/libs/CoinDopplerMultiCurve.sol +1 -1
  53. package/src/libs/CoinRewardsV4.sol +0 -1
  54. package/src/libs/CoinSetup.sol +7 -1
  55. package/src/libs/HooksDeployment.sol +20 -8
  56. package/src/libs/UniV4SwapHelper.sol +35 -0
  57. package/src/libs/V3ToV4SwapLib.sol +265 -0
  58. package/src/version/ContractVersionBase.sol +1 -1
  59. package/test/BuySupplyWithV4SwapHook.t.sol +4 -3
  60. package/test/Coin.t.sol +7 -1
  61. package/test/CoinUniV4.t.sol +6 -1
  62. package/test/ContentCoinRewards.t.sol +6 -1
  63. package/test/CreatorCoin.t.sol +3 -1
  64. package/test/CreatorCoinRewards.t.sol +4 -1
  65. package/test/Factory.t.sol +20 -7
  66. package/test/HooksDeployment.t.sol +16 -3
  67. package/test/LaunchFee.t.sol +286 -0
  68. package/test/LiquidityMigration.t.sol +52 -44
  69. package/test/MultiOwnable.t.sol +2 -1
  70. package/test/Upgrades.t.sol +110 -81
  71. package/test/V4Liquidity.t.sol +1 -1
  72. package/test/mocks/MockSwapRouter.sol +33 -0
  73. package/test/mocks/MockZoraLimitOrderBook.sol +14 -0
  74. package/test/utils/BaseTest.sol +14 -448
  75. package/test/utils/FeeEstimatorHook.sol +6 -2
  76. package/test/utils/V4TestSetup.sol +595 -0
  77. package/wagmi.config.ts +1 -1
  78. package/abis/BaseTest.json +0 -718
  79. package/abis/DeterministicDeployerAndCaller.json +0 -315
  80. package/abis/DeterministicUUPSProxyDeployer.json +0 -167
  81. package/abis/EIP712.json +0 -67
  82. package/abis/ERC20.json +0 -310
  83. package/abis/FeeEstimatorHook.json +0 -1938
  84. package/abis/IERC721.json +0 -287
  85. package/abis/IERC721Enumerable.json +0 -343
  86. package/abis/IERC721Metadata.json +0 -332
  87. package/abis/IERC721TokenReceiver.json +0 -36
  88. package/abis/IImmutableCreate2Factory.json +0 -93
  89. package/abis/IMulticall3.json +0 -440
  90. package/abis/ISafe.json +0 -15
  91. package/abis/ISymbol.json +0 -15
  92. package/abis/IUniswapV4Router04.json +0 -484
  93. package/abis/IUniversalRouter.json +0 -61
  94. package/abis/IV4Quoter.json +0 -310
  95. package/abis/ImmutableCreate2FactoryUtils.json +0 -15
  96. package/abis/LibString.json +0 -7
  97. package/abis/Math.json +0 -7
  98. package/abis/MockAirlock.json +0 -39
  99. package/abis/MockERC721.json +0 -350
  100. package/abis/ProtocolRewards.json +0 -494
  101. package/abis/ShortStrings.json +0 -18
  102. package/abis/SimpleERC20.json +0 -326
  103. package/abis/StdAssertions.json +0 -379
  104. package/abis/StdInvariant.json +0 -180
  105. package/abis/Test.json +0 -570
  106. package/abis/VmContractHelper235.json +0 -233
  107. package/abis/VmContractHelper242.json +0 -233
  108. package/abis/stdError.json +0 -119
  109. package/abis/stdStorageSafe.json +0 -52
  110. package/addresses/8453.json +0 -13
  111. package/addresses/84532.json +0 -10
  112. package/deterministicConfig/deployerAndCaller.json +0 -5
  113. package/deterministicConfig/zoraFactory.json +0 -8
  114. package/script/Deploy.s.sol +0 -23
  115. package/script/DeployAutoSwapper.s.sol +0 -30
  116. package/script/DeployDevFactory.s.sol +0 -21
  117. package/script/DeployPostDeploymentHooks.s.sol +0 -20
  118. package/script/DeployTrustedMsgSenderLookup.s.sol +0 -20
  119. package/script/DeployUpgradeGate.s.sol +0 -21
  120. package/script/GenerateDeterministicParams.s.sol +0 -43
  121. package/script/PrintRegisterUpgradePath.s.sol +0 -28
  122. package/script/PrintUpgradeCommand.s.sol +0 -13
  123. package/script/TestBackingCoinSwap.s.sol +0 -144
  124. package/script/TestV4Swap.s.sol +0 -133
  125. package/script/UpgradeCoinImpl.sol +0 -23
  126. package/script/UpgradeFactoryImpl.s.sol +0 -28
  127. package/script/UpgradeHooks.s.sol +0 -23
  128. package/src/deployment/CoinsDeployerBase.sol +0 -297
  129. /package/{test → src}/utils/ProxyShim.sol +0 -0
@@ -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 {CoinsDeployerBase} from "../src/deployment/CoinsDeployerBase.sol";
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, CoinsDeployerBase {
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
- vm.createSelectFork("base", 32613149);
191
-
192
- address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
218
+ // function test_canUpgradeBrokenContentCoinAndSwap() public {
219
+ // vm.createSelectFork("base", 32613149);
193
220
 
194
- address contentCoin = 0xB9799C839818bF50240CE683363D00c43a2E23b8;
221
+ // address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
195
222
 
196
- address creatorCoin = ICoin(contentCoin).currency();
223
+ // address contentCoin = 0xB9799C839818bF50240CE683363D00c43a2E23b8;
197
224
 
198
- uint256 amountIn = 0.000111 ether;
225
+ // address creatorCoin = ICoin(contentCoin).currency();
199
226
 
200
- ITrustedMsgSenderProviderLookup trustedMsgSenderLookup2 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
227
+ // uint256 amountIn = 0.000111 ether;
201
228
 
202
- bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup2, upgradeGate);
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
- (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
232
+ // (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
205
233
 
206
- address existingHook = address(ICoin(contentCoin).hooks());
234
+ // address existingHook = address(ICoin(contentCoin).hooks());
207
235
 
208
- address[] memory baseImpls = new address[](1);
209
- baseImpls[0] = existingHook;
236
+ // address[] memory baseImpls = new address[](1);
237
+ // baseImpls[0] = existingHook;
210
238
 
211
- vm.prank(Ownable(upgradeGate).owner());
212
- IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
239
+ // vm.prank(Ownable(upgradeGate).owner());
240
+ // IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
213
241
 
214
- vm.prank(MultiOwnable(contentCoin).owners()[0]);
215
- ContentCoin(contentCoin).migrateLiquidity(address(newHook), "");
242
+ // vm.prank(MultiOwnable(contentCoin).owners()[0]);
243
+ // ContentCoin(contentCoin).migrateLiquidity(address(newHook), "");
216
244
 
217
- // do some swaps to test out
218
- _swapSomeCurrencyForCoin(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
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
- vm.createSelectFork("base", 31872861);
271
+ // function test_canUpgradeBrokenCreatorCoinAndSwap() public {
272
+ // vm.createSelectFork("base", 31872861);
245
273
 
246
- address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
274
+ // address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
247
275
 
248
- ICoin creatorCoin = ICoin(0x2F03aB8fD97F5874bc3274C296Bb954Ae92EdA34);
276
+ // ICoin creatorCoin = ICoin(0x2F03aB8fD97F5874bc3274C296Bb954Ae92EdA34);
249
277
 
250
- address zora = creatorCoin.currency();
278
+ // address zora = creatorCoin.currency();
251
279
 
252
- address existingHook = address(creatorCoin.hooks());
280
+ // address existingHook = address(creatorCoin.hooks());
253
281
 
254
- ITrustedMsgSenderProviderLookup trustedMsgSenderLookup3 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
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
- bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup3, upgradeGate);
285
+ // (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
257
286
 
258
- (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
287
+ // address[] memory baseImpls = new address[](1);
288
+ // baseImpls[0] = existingHook;
259
289
 
260
- address[] memory baseImpls = new address[](1);
261
- baseImpls[0] = existingHook;
290
+ // vm.prank(Ownable(upgradeGate).owner());
291
+ // IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
262
292
 
263
- vm.prank(Ownable(upgradeGate).owner());
264
- IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
293
+ // LpPosition[] memory beforePositions = IZoraV4CoinHook(address(creatorCoin.hooks())).getPoolCoin(creatorCoin.getPoolKey()).positions;
294
+ // PoolKey memory beforeKey = creatorCoin.getPoolKey();
265
295
 
266
- LpPosition[] memory beforePositions = IZoraV4CoinHook(address(creatorCoin.hooks())).getPoolCoin(creatorCoin.getPoolKey()).positions;
267
- PoolKey memory beforeKey = creatorCoin.getPoolKey();
296
+ // uint128[] memory beforeLiquidity = getLiquidityForPositions(beforeKey, beforePositions);
297
+ // // get before price
298
+ // uint160 beforePrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
268
299
 
269
- uint128[] memory beforeLiquidity = getLiquidityForPositions(beforeKey, beforePositions);
270
- // get before price
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
- vm.prank(MultiOwnable(address(creatorCoin)).owners()[0]);
274
- ContentCoin(address(creatorCoin)).migrateLiquidity(address(newHook), "");
303
+ // // get liquidity of original positions after migration
304
+ // uint128[] memory liquidityOfPositionsAfterMigration = getLiquidityForPositions(beforeKey, beforePositions);
275
305
 
276
- // get liquidity of original positions after migration
277
- uint128[] memory liquidityOfPositionsAfterMigration = getLiquidityForPositions(beforeKey, beforePositions);
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
- // there should be no liquidity left in the original positions after migration
280
- for (uint256 i = 0; i < liquidityOfPositionsAfterMigration.length; i++) {
281
- assertEq(liquidityOfPositionsAfterMigration[i], 0);
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
- for (uint256 i = 0; i < beforeLiquidity.length; i++) {
290
- assertApproxEqAbs(beforeLiquidity[i], afterLiquidity[i], 200);
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
- uint160 afterPrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
323
+ // uint160 afterPrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
294
324
 
295
- assertEq(beforePrice, afterPrice);
325
+ // assertEq(beforePrice, afterPrice);
296
326
 
297
- // Small amounts of dust from rounding may remain in the hook as burned tokens
298
- // This is expected and saves on code size by not minting them back into the pool
299
- assertApproxEqAbs(creatorCoin.getPoolKey().currency0.balanceOf(address(newHook)), 0, 0.1 ether);
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
- // now try to swap some currency for the creator coin - it should succeed
303
- _swapSomeCurrencyForCoin(creatorCoin, zora, uint128(IERC20(zora).balanceOf(trader) / 2), trader);
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
- vm.createSelectFork("base", 31835069);
335
+ // function test_canFixBrokenContentCoinAndSwap() public {
336
+ // vm.createSelectFork("base", 31835069);
308
337
 
309
- address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
338
+ // address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
310
339
 
311
- address contentCoin = 0x4E93A01c90f812284F71291a8d1415a904957156;
340
+ // address contentCoin = 0x4E93A01c90f812284F71291a8d1415a904957156;
312
341
 
313
- address creatorCoin = ICoin(contentCoin).currency();
342
+ // address creatorCoin = ICoin(contentCoin).currency();
314
343
 
315
- uint256 amountIn = IERC20(creatorCoin).balanceOf(trader);
344
+ // uint256 amountIn = IERC20(creatorCoin).balanceOf(trader);
316
345
 
317
- require(amountIn > 0, "no balance");
346
+ // require(amountIn > 0, "no balance");
318
347
 
319
- // this swap should revert because the content coin is broken
320
- _swapSomeCurrencyForCoinAndExpectRevert(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
348
+ // // this swap should revert because the content coin is broken
349
+ // _swapSomeCurrencyForCoinAndExpectRevert(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
321
350
 
322
- ITrustedMsgSenderProviderLookup trustedMsgSenderLookup2 = TrustedSenderTestHelper.deployTrustedMessageSender(makeAddr("owner"), new address[](0));
323
- bytes memory creationCode = HooksDeployment.makeHookCreationCode(address(poolManager), coinVersionLookup, trustedMsgSenderLookup2, upgradeGate);
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
- (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
354
+ // (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
326
355
 
327
- // etch new hook into the content coin, it shouldn't revert anymore when swapping
328
- vm.etch(address(ICoin(contentCoin).hooks()), address(newHook).code);
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
- _swapSomeCurrencyForCoin(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
331
- }
359
+ // _swapSomeCurrencyForCoin(ICoin(contentCoin), creatorCoin, uint128(amountIn), trader);
360
+ // }
332
361
  }
@@ -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
+ }