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