@zoralabs/coins 1.1.2 → 2.0.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 (38) hide show
  1. package/.turbo/turbo-build.log +96 -95
  2. package/CHANGELOG.md +22 -0
  3. package/README.md +126 -0
  4. package/abis/BaseCoinV4.json +1840 -0
  5. package/abis/BaseZoraV4CoinHook.json +6 -2
  6. package/abis/CoinUniV4Test.json +20 -0
  7. package/abis/ContentCoinHook.json +6 -2
  8. package/abis/CreatorCoinHook.json +6 -2
  9. package/abis/FactoryTest.json +7 -0
  10. package/abis/FeeEstimatorHook.json +6 -2
  11. package/abis/IZoraV4CoinHook.json +2 -2
  12. package/abis/Ownable2StepUpgradeable.json +138 -0
  13. package/abis/ZoraFactoryImpl.json +39 -0
  14. package/addresses/8453.json +5 -5
  15. package/dist/index.cjs +36 -3
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.js +35 -2
  18. package/dist/index.js.map +1 -1
  19. package/dist/wagmiGenerated.d.ts +32 -1
  20. package/dist/wagmiGenerated.d.ts.map +1 -1
  21. package/package/wagmiGenerated.ts +35 -2
  22. package/package.json +1 -1
  23. package/script/TestBackingCoinSwap.s.sol +1 -1
  24. package/script/TestV4Swap.s.sol +1 -1
  25. package/src/{CoinV4.sol → BaseCoinV4.sol} +8 -16
  26. package/src/ContentCoin.sol +45 -0
  27. package/src/CreatorCoin.sol +7 -5
  28. package/src/ZoraFactoryImpl.sol +3 -3
  29. package/src/deployment/CoinsDeployerBase.sol +3 -3
  30. package/src/hooks/BaseZoraV4CoinHook.sol +3 -1
  31. package/src/interfaces/IZoraV4CoinHook.sol +1 -1
  32. package/src/version/ContractVersionBase.sol +1 -1
  33. package/test/CoinUniV4.t.sol +61 -5
  34. package/test/Factory.t.sol +41 -0
  35. package/test/Upgrades.t.sol +8 -8
  36. package/test/utils/BaseTest.sol +23 -15
  37. package/wagmi.config.ts +1 -1
  38. /package/abis/{CoinV4.json → ContentCoin.json} +0 -0
@@ -13,7 +13,7 @@ import {IZoraFactory} from "../../src/interfaces/IZoraFactory.sol";
13
13
  import {ZoraFactoryImpl} from "../../src/ZoraFactoryImpl.sol";
14
14
  import {ZoraFactory} from "../../src/proxy/ZoraFactory.sol";
15
15
  import {Coin} from "../../src/Coin.sol";
16
- import {CoinV4} from "../../src/CoinV4.sol";
16
+ import {ContentCoin} from "../../src/ContentCoin.sol";
17
17
  import {MultiOwnable} from "../../src/utils/MultiOwnable.sol";
18
18
  import {ICoin} from "../../src/interfaces/ICoin.sol";
19
19
  import {IERC7572} from "../../src/interfaces/IERC7572.sol";
@@ -75,14 +75,14 @@ contract BaseTest is Test, ContractAddresses {
75
75
  IUniversalRouter internal router;
76
76
  IPoolManager internal poolManager;
77
77
  IV4Quoter internal quoter;
78
- CoinV4 internal coinV4;
78
+ ContentCoin internal coinV4;
79
79
 
80
80
  ISwapRouter internal swapRouter;
81
81
  IAirlock internal airlock;
82
82
  Users internal users;
83
83
 
84
84
  Coin internal coinV3Impl;
85
- CoinV4 internal coinV4Impl;
85
+ ContentCoin internal coinV4Impl;
86
86
  CreatorCoin internal creatorCoinImpl;
87
87
  ZoraFactoryImpl internal factoryImpl;
88
88
  IZoraFactory internal factory;
@@ -157,7 +157,7 @@ contract BaseTest is Test, ContractAddresses {
157
157
  salt
158
158
  );
159
159
 
160
- coinV4 = CoinV4(payable(coinAddress));
160
+ coinV4 = ContentCoin(payable(coinAddress));
161
161
  return coinV4;
162
162
  }
163
163
 
@@ -206,11 +206,15 @@ contract BaseTest is Test, ContractAddresses {
206
206
  );
207
207
 
208
208
  vm.startPrank(trader);
209
- UniV4SwapHelper.approveTokenWithPermit2(permit2, address(router), currency, amountIn, uint48(block.timestamp + 1 days));
209
+ if (currency != address(0)) {
210
+ UniV4SwapHelper.approveTokenWithPermit2(permit2, address(router), currency, amountIn, uint48(block.timestamp + 1 days));
211
+ }
212
+
213
+ uint256 value = currency == address(0) ? amountIn : 0;
210
214
 
211
215
  // Execute the swap
212
216
  uint256 deadline = block.timestamp + 20;
213
- router.execute(commands, inputs, deadline);
217
+ router.execute{value: value}(commands, inputs, deadline);
214
218
 
215
219
  vm.stopPrank();
216
220
  }
@@ -269,18 +273,22 @@ contract BaseTest is Test, ContractAddresses {
269
273
  (bytes32 contentCoinSalt, bytes32 creatorCoinSalt) = getSalts(trustedMessageSenders);
270
274
 
271
275
  contentCoinHook = ContentCoinHook(
272
- address(
273
- HooksDeployment.deployHookWithSalt(
274
- HooksDeployment.contentCoinCreationCode(V4_POOL_MANAGER, address(factory), trustedMessageSenders, address(hookUpgradeGate)),
275
- contentCoinSalt
276
+ payable(
277
+ address(
278
+ HooksDeployment.deployHookWithSalt(
279
+ HooksDeployment.contentCoinCreationCode(V4_POOL_MANAGER, address(factory), trustedMessageSenders, address(hookUpgradeGate)),
280
+ contentCoinSalt
281
+ )
276
282
  )
277
283
  )
278
284
  );
279
285
  creatorCoinHook = CreatorCoinHook(
280
- address(
281
- HooksDeployment.deployHookWithSalt(
282
- HooksDeployment.creatorCoinHookCreationCode(V4_POOL_MANAGER, address(factory), trustedMessageSenders, address(hookUpgradeGate)),
283
- creatorCoinSalt
286
+ payable(
287
+ address(
288
+ HooksDeployment.deployHookWithSalt(
289
+ HooksDeployment.creatorCoinHookCreationCode(V4_POOL_MANAGER, address(factory), trustedMessageSenders, address(hookUpgradeGate)),
290
+ creatorCoinSalt
291
+ )
284
292
  )
285
293
  )
286
294
  );
@@ -324,7 +332,7 @@ contract BaseTest is Test, ContractAddresses {
324
332
 
325
333
  _deployHooks();
326
334
 
327
- coinV4Impl = new CoinV4(users.feeRecipient, address(protocolRewards), IPoolManager(V4_POOL_MANAGER), DOPPLER_AIRLOCK);
335
+ coinV4Impl = new ContentCoin(users.feeRecipient, address(protocolRewards), IPoolManager(V4_POOL_MANAGER), DOPPLER_AIRLOCK);
328
336
 
329
337
  creatorCoinImpl = new CreatorCoin(users.feeRecipient, address(protocolRewards), IPoolManager(V4_POOL_MANAGER), DOPPLER_AIRLOCK);
330
338
 
package/wagmi.config.ts CHANGED
@@ -10,7 +10,7 @@ export default defineConfig({
10
10
  },
11
11
  include: [
12
12
  "Coin",
13
- "CoinV4",
13
+ "ContentCoin",
14
14
  "CreatorCoin",
15
15
  "ZoraFactoryImpl",
16
16
  "IUniswapV3Pool",
File without changes