@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
@@ -1764,7 +1764,7 @@ export declare const coinABI: readonly [{
1764
1764
  readonly inputs: readonly [];
1765
1765
  readonly name: "UseRevokeOwnershipToRemoveSelf";
1766
1766
  }];
1767
- export declare const coinV4ABI: readonly [{
1767
+ export declare const contentCoinABI: readonly [{
1768
1768
  readonly type: "constructor";
1769
1769
  readonly inputs: readonly [{
1770
1770
  readonly name: "protocolRewardRecipient_";
@@ -5762,6 +5762,12 @@ export declare const zoraFactoryImplABI: readonly [{
5762
5762
  readonly type: "string";
5763
5763
  }];
5764
5764
  readonly stateMutability: "view";
5765
+ }, {
5766
+ readonly type: "function";
5767
+ readonly inputs: readonly [];
5768
+ readonly name: "acceptOwnership";
5769
+ readonly outputs: readonly [];
5770
+ readonly stateMutability: "nonpayable";
5765
5771
  }, {
5766
5772
  readonly type: "function";
5767
5773
  readonly inputs: readonly [{
@@ -6152,6 +6158,16 @@ export declare const zoraFactoryImplABI: readonly [{
6152
6158
  readonly type: "address";
6153
6159
  }];
6154
6160
  readonly stateMutability: "view";
6161
+ }, {
6162
+ readonly type: "function";
6163
+ readonly inputs: readonly [];
6164
+ readonly name: "pendingOwner";
6165
+ readonly outputs: readonly [{
6166
+ readonly name: "";
6167
+ readonly internalType: "address";
6168
+ readonly type: "address";
6169
+ }];
6170
+ readonly stateMutability: "view";
6155
6171
  }, {
6156
6172
  readonly type: "function";
6157
6173
  readonly inputs: readonly [];
@@ -6419,6 +6435,21 @@ export declare const zoraFactoryImplABI: readonly [{
6419
6435
  readonly indexed: false;
6420
6436
  }];
6421
6437
  readonly name: "Initialized";
6438
+ }, {
6439
+ readonly type: "event";
6440
+ readonly anonymous: false;
6441
+ readonly inputs: readonly [{
6442
+ readonly name: "previousOwner";
6443
+ readonly internalType: "address";
6444
+ readonly type: "address";
6445
+ readonly indexed: true;
6446
+ }, {
6447
+ readonly name: "newOwner";
6448
+ readonly internalType: "address";
6449
+ readonly type: "address";
6450
+ readonly indexed: true;
6451
+ }];
6452
+ readonly name: "OwnershipTransferStarted";
6422
6453
  }, {
6423
6454
  readonly type: "event";
6424
6455
  readonly anonymous: false;
@@ -1 +1 @@
1
- {"version":3,"file":"wagmiGenerated.d.ts","sourceRoot":"","sources":["../package/wagmiGenerated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FjB,CAAA;AAMV,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqFjC,CAAA;AAMV,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0lBrB,CAAA"}
@@ -1256,10 +1256,10 @@ export const coinABI = [
1256
1256
  ] as const
1257
1257
 
1258
1258
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1259
- // CoinV4
1259
+ // ContentCoin
1260
1260
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1261
1261
 
1262
- export const coinV4ABI = [
1262
+ export const contentCoinABI = [
1263
1263
  {
1264
1264
  type: 'constructor',
1265
1265
  inputs: [
@@ -4229,6 +4229,13 @@ export const zoraFactoryImplABI = [
4229
4229
  outputs: [{ name: '', internalType: 'string', type: 'string' }],
4230
4230
  stateMutability: 'view',
4231
4231
  },
4232
+ {
4233
+ type: 'function',
4234
+ inputs: [],
4235
+ name: 'acceptOwnership',
4236
+ outputs: [],
4237
+ stateMutability: 'nonpayable',
4238
+ },
4232
4239
  {
4233
4240
  type: 'function',
4234
4241
  inputs: [
@@ -4418,6 +4425,13 @@ export const zoraFactoryImplABI = [
4418
4425
  outputs: [{ name: '', internalType: 'address', type: 'address' }],
4419
4426
  stateMutability: 'view',
4420
4427
  },
4428
+ {
4429
+ type: 'function',
4430
+ inputs: [],
4431
+ name: 'pendingOwner',
4432
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
4433
+ stateMutability: 'view',
4434
+ },
4421
4435
  {
4422
4436
  type: 'function',
4423
4437
  inputs: [],
@@ -4659,6 +4673,25 @@ export const zoraFactoryImplABI = [
4659
4673
  ],
4660
4674
  name: 'Initialized',
4661
4675
  },
4676
+ {
4677
+ type: 'event',
4678
+ anonymous: false,
4679
+ inputs: [
4680
+ {
4681
+ name: 'previousOwner',
4682
+ internalType: 'address',
4683
+ type: 'address',
4684
+ indexed: true,
4685
+ },
4686
+ {
4687
+ name: 'newOwner',
4688
+ internalType: 'address',
4689
+ type: 'address',
4690
+ indexed: true,
4691
+ },
4692
+ ],
4693
+ name: 'OwnershipTransferStarted',
4694
+ },
4662
4695
  {
4663
4696
  type: 'event',
4664
4697
  anonymous: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoralabs/coins",
3
- "version": "1.1.2",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -8,7 +8,7 @@ import {IZoraFactory} from "../src/interfaces/IZoraFactory.sol";
8
8
  import {CoinConfigurationVersions} from "../src/libs/CoinConfigurationVersions.sol";
9
9
  import {MarketConstants} from "../src/libs/MarketConstants.sol";
10
10
  import {UniV4SwapHelper} from "../src/libs/UniV4SwapHelper.sol";
11
- import {CoinV4} from "../src/CoinV4.sol";
11
+ import {ContentCoin} from "../src/ContentCoin.sol";
12
12
  import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol";
13
13
  import {IUniversalRouter} from "@uniswap/universal-router/contracts/interfaces/IUniversalRouter.sol";
14
14
  import {IPermit2} from "permit2/src/interfaces/IPermit2.sol";
@@ -8,7 +8,7 @@ import {IZoraFactory} from "../src/interfaces/IZoraFactory.sol";
8
8
  import {CoinConfigurationVersions} from "../src/libs/CoinConfigurationVersions.sol";
9
9
  import {MarketConstants} from "../src/libs/MarketConstants.sol";
10
10
  import {UniV4SwapHelper} from "../src/libs/UniV4SwapHelper.sol";
11
- import {CoinV4} from "../src/CoinV4.sol";
11
+ import {ContentCoin} from "../src/ContentCoin.sol";
12
12
  import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol";
13
13
  import {IUniversalRouter} from "@uniswap/universal-router/contracts/interfaces/IUniversalRouter.sol";
14
14
  import {IPermit2} from "permit2/src/interfaces/IPermit2.sol";
@@ -20,7 +20,12 @@ import {CoinConstants} from "./libs/CoinConstants.sol";
20
20
  import {IUpgradeableV4Hook} from "./interfaces/IUpgradeableV4Hook.sol";
21
21
  import {CoinCommon} from "./libs/CoinCommon.sol";
22
22
 
23
- contract CoinV4 is BaseCoin, ICoinV4 {
23
+ /**
24
+ * @title BaseCoinV4
25
+ * @notice Abstract base contract for Uniswap V4 integrated coins
26
+ * @dev Provides shared V4 functionality for both content coins and creator coins
27
+ */
28
+ abstract contract BaseCoinV4 is BaseCoin, ICoinV4 {
24
29
  /// @notice The Uniswap v4 pool manager singleton contract reference.
25
30
  IPoolManager public immutable poolManager;
26
31
 
@@ -30,8 +35,8 @@ contract CoinV4 is BaseCoin, ICoinV4 {
30
35
  /// @notice The configuration for the pool.
31
36
  PoolConfiguration internal poolConfiguration;
32
37
 
33
- /// @notice The constructor for the static CoinV4 contract deployment shared across all Coins.
34
- /// @dev All arguments are required and cannot be set to teh 0 address.
38
+ /// @notice The constructor for the static BaseCoinV4 contract deployment shared across all Coins.
39
+ /// @dev All arguments are required and cannot be set to the 0 address.
35
40
  /// @param protocolRewardRecipient_ The address of the protocol reward recipient
36
41
  /// @param protocolRewards_ The address of the protocol rewards contract
37
42
  /// @param poolManager_ The address of the pool manager
@@ -86,19 +91,6 @@ contract CoinV4 is BaseCoin, ICoinV4 {
86
91
  poolManager.initialize(poolKey, sqrtPriceX96);
87
92
  }
88
93
 
89
- /// @dev The initial mint and distribution of the coin supply.
90
- /// Overrides the BaseCoin._handleInitialDistribution to transfer the market supply to the hook.
91
- function _handleInitialDistribution() internal virtual override {
92
- // Mint the total supply to the coin contract
93
- _mint(address(this), CoinConstants.MAX_TOTAL_SUPPLY);
94
-
95
- // Distribute the creator launch reward to the payout recipient
96
- _transfer(address(this), payoutRecipient, CoinConstants.CREATOR_LAUNCH_REWARD);
97
-
98
- // Transfer the market supply to the hook for liquidity
99
- _transfer(address(this), address(poolKey.hooks), balanceOf(address(this)));
100
- }
101
-
102
94
  /// @inheritdoc ICoinV4
103
95
  function hooks() external view returns (IHooks) {
104
96
  return poolKey.hooks;
@@ -0,0 +1,45 @@
1
+ // SPDX-License-Identifier: ZORA-DELAYED-OSL-v1
2
+ // This software is licensed under the Zora Delayed Open Source License.
3
+ // Under this license, you may use, copy, modify, and distribute this software for
4
+ // non-commercial purposes only. Commercial use and competitive products are prohibited
5
+ // until the "Open Date" (3 years from first public distribution or earlier at Zora's discretion),
6
+ // at which point this software automatically becomes available under the MIT License.
7
+ // Full license terms available at: https://docs.zora.co/coins/license
8
+ pragma solidity ^0.8.23;
9
+
10
+ import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
11
+ import {BaseCoinV4} from "./BaseCoinV4.sol";
12
+ import {CoinConstants} from "./libs/CoinConstants.sol";
13
+
14
+ /**
15
+ * @title ContentCoin
16
+ * @notice Content coin implementation that uses creator coins as backing currency
17
+ * @dev Inherits from BaseCoinV4 and implements content-specific distribution logic
18
+ */
19
+ contract ContentCoin is BaseCoinV4 {
20
+ /// @notice The constructor for the static ContentCoin contract deployment shared across all content coins.
21
+ /// @dev All arguments are required and cannot be set to the 0 address.
22
+ /// @param protocolRewardRecipient_ The address of the protocol reward recipient
23
+ /// @param protocolRewards_ The address of the protocol rewards contract
24
+ /// @param poolManager_ The address of the pool manager
25
+ /// @param airlock_ The address of the Airlock contract, ownership is used for a protocol fee split.
26
+ constructor(
27
+ address protocolRewardRecipient_,
28
+ address protocolRewards_,
29
+ IPoolManager poolManager_,
30
+ address airlock_
31
+ ) BaseCoinV4(protocolRewardRecipient_, protocolRewards_, poolManager_, airlock_) {}
32
+
33
+ /// @dev The initial mint and distribution of the coin supply.
34
+ /// Implements content coin specific distribution: 990M to liquidity pool, 10M to creator.
35
+ function _handleInitialDistribution() internal virtual override {
36
+ // Mint the total supply to the coin contract
37
+ _mint(address(this), CoinConstants.MAX_TOTAL_SUPPLY);
38
+
39
+ // Distribute the creator launch reward to the payout recipient
40
+ _transfer(address(this), payoutRecipient, CoinConstants.CREATOR_LAUNCH_REWARD);
41
+
42
+ // Transfer the market supply to the hook for liquidity
43
+ _transfer(address(this), address(poolKey.hooks), balanceOf(address(this)));
44
+ }
45
+ }
@@ -9,9 +9,11 @@ pragma solidity ^0.8.28;
9
9
 
10
10
  import {ICreatorCoin} from "./interfaces/ICreatorCoin.sol";
11
11
  import {CreatorCoinConstants} from "./libs/CreatorCoinConstants.sol";
12
- import {IHooks, PoolConfiguration, PoolKey, IPoolManager, ICoinV4, CoinV4} from "./CoinV4.sol";
12
+ import {IHooks, PoolConfiguration, PoolKey, ICoinV4} from "./interfaces/ICoinV4.sol";
13
+ import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
14
+ import {BaseCoinV4} from "./BaseCoinV4.sol";
13
15
 
14
- contract CreatorCoin is ICreatorCoin, CoinV4 {
16
+ contract CreatorCoin is ICreatorCoin, BaseCoinV4 {
15
17
  uint256 public vestingStartTime;
16
18
  uint256 public vestingEndTime;
17
19
  uint256 public totalClaimed;
@@ -21,7 +23,7 @@ contract CreatorCoin is ICreatorCoin, CoinV4 {
21
23
  address _protocolRewards,
22
24
  IPoolManager _poolManager,
23
25
  address _airlock
24
- ) CoinV4(_protocolRewardRecipient, _protocolRewards, _poolManager, _airlock) initializer {}
26
+ ) BaseCoinV4(_protocolRewardRecipient, _protocolRewards, _poolManager, _airlock) initializer {}
25
27
 
26
28
  function initialize(
27
29
  address payoutRecipient_,
@@ -34,7 +36,7 @@ contract CreatorCoin is ICreatorCoin, CoinV4 {
34
36
  PoolKey memory poolKey_,
35
37
  uint160 sqrtPriceX96,
36
38
  PoolConfiguration memory poolConfiguration_
37
- ) public override(CoinV4, ICoinV4) {
39
+ ) public override(BaseCoinV4, ICoinV4) {
38
40
  require(currency_ == CreatorCoinConstants.CURRENCY, InvalidCurrency());
39
41
 
40
42
  super.initialize(payoutRecipient_, owners_, tokenURI_, name_, symbol_, platformReferrer_, currency_, poolKey_, sqrtPriceX96, poolConfiguration_);
@@ -44,7 +46,7 @@ contract CreatorCoin is ICreatorCoin, CoinV4 {
44
46
  }
45
47
 
46
48
  /// @dev The initial mint and distribution of the coin supply.
47
- /// Overrides the CoinV4._handleInitialDistribution to transfer the market supply to the hook.
49
+ /// Implements creator coin specific distribution: 500M to liquidity pool, 500M vested to creator.
48
50
  function _handleInitialDistribution() internal override {
49
51
  _mint(address(this), CreatorCoinConstants.TOTAL_SUPPLY);
50
52
 
@@ -8,7 +8,7 @@
8
8
  pragma solidity ^0.8.23;
9
9
 
10
10
  import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
11
- import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
11
+ import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
12
12
  import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
13
13
  import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
14
14
  import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
@@ -21,7 +21,7 @@ import {IZoraFactory} from "./interfaces/IZoraFactory.sol";
21
21
  import {IHasAfterCoinDeploy} from "./hooks/deployment/BaseCoinDeployHook.sol";
22
22
  import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
23
23
  import {Coin} from "./Coin.sol";
24
- import {CoinV4} from "./CoinV4.sol";
24
+ import {ContentCoin} from "./ContentCoin.sol";
25
25
  import {ICoin, PoolKeyStruct} from "./interfaces/ICoin.sol";
26
26
  import {ICoinV3} from "./interfaces/ICoinV3.sol";
27
27
  import {ICoinV4} from "./interfaces/ICoinV4.sol";
@@ -45,7 +45,7 @@ contract ZoraFactoryImpl is
45
45
  IZoraFactory,
46
46
  UUPSUpgradeable,
47
47
  ReentrancyGuardUpgradeable,
48
- OwnableUpgradeable,
48
+ Ownable2StepUpgradeable,
49
49
  IHasContractName,
50
50
  ContractVersionBase,
51
51
  DeployedCoinVersionLookup
@@ -10,7 +10,7 @@ import {Coin} from "../Coin.sol";
10
10
  import {IVersionedContract} from "@zoralabs/shared-contracts/interfaces/IVersionedContract.sol";
11
11
  import {BuySupplyWithSwapRouterHook} from "../hooks/deployment/BuySupplyWithSwapRouterHook.sol";
12
12
  import {IZoraFactory} from "../interfaces/IZoraFactory.sol";
13
- import {CoinV4} from "../CoinV4.sol";
13
+ import {ContentCoin} from "../ContentCoin.sol";
14
14
  import {IHooks} from "@uniswap/v4-core/src/interfaces/IHooks.sol";
15
15
  import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
16
16
  import {ZoraFactory} from "../proxy/ZoraFactory.sol";
@@ -114,9 +114,9 @@ contract CoinsDeployerBase is ProxyDeployerScript {
114
114
  });
115
115
  }
116
116
 
117
- function deployCoinV4Impl(address zoraV4CoinHook) internal returns (CoinV4) {
117
+ function deployCoinV4Impl(address zoraV4CoinHook) internal returns (ContentCoin) {
118
118
  return
119
- new CoinV4({
119
+ new ContentCoin({
120
120
  protocolRewardRecipient_: getZoraRecipient(),
121
121
  protocolRewards_: PROTOCOL_REWARDS,
122
122
  poolManager_: IPoolManager(getUniswapV4PoolManager()),
@@ -119,7 +119,7 @@ abstract contract BaseZoraV4CoinHook is BaseHook, ContractVersionBase, IZoraV4Co
119
119
  }
120
120
 
121
121
  /// @inheritdoc IZoraV4CoinHook
122
- function getPoolCoinByHash(bytes23 poolKeyHash) external view returns (IZoraV4CoinHook.PoolCoin memory) {
122
+ function getPoolCoinByHash(bytes32 poolKeyHash) external view returns (IZoraV4CoinHook.PoolCoin memory) {
123
123
  return poolCoins[poolKeyHash];
124
124
  }
125
125
 
@@ -372,4 +372,6 @@ abstract contract BaseZoraV4CoinHook is BaseHook, ContractVersionBase, IZoraV4Co
372
372
 
373
373
  newPoolKey = V4Liquidity.lockAndMigrate(poolManager, poolKey, poolCoin.positions, poolCoin.coin, newHook, additionalData);
374
374
  }
375
+
376
+ receive() external payable onlyPoolManager {}
375
377
  }
@@ -117,7 +117,7 @@ interface IZoraV4CoinHook is IUpgradeableV4Hook {
117
117
  /// @notice Returns the pool coin for a given pool key hash.
118
118
  /// @param poolKeyHash The hash of the pool key for indexing.
119
119
  /// @return poolCoin The pool coin confirmation data.
120
- function getPoolCoinByHash(bytes23 poolKeyHash) external view returns (IZoraV4CoinHook.PoolCoin memory);
120
+ function getPoolCoinByHash(bytes32 poolKeyHash) external view returns (IZoraV4CoinHook.PoolCoin memory);
121
121
 
122
122
  /// @notice Returns the pool coin for a given pool key.
123
123
  /// @param key The pool key.
@@ -9,6 +9,6 @@ import {IVersionedContract} from "@zoralabs/shared-contracts/interfaces/IVersion
9
9
  contract ContractVersionBase is IVersionedContract {
10
10
  /// @notice The version of the contract
11
11
  function contractVersion() external pure override returns (string memory) {
12
- return "1.1.2";
12
+ return "2.0.0";
13
13
  }
14
14
  }
@@ -63,7 +63,7 @@ contract CoinUniV4Test is BaseTest {
63
63
  uint256 deadline = block.timestamp + 20;
64
64
  router.execute(commands, inputs, deadline);
65
65
 
66
- feeState = FeeEstimatorHook(address(contentCoinHook)).getFeeState();
66
+ feeState = FeeEstimatorHook(payable(address(contentCoinHook))).getFeeState();
67
67
 
68
68
  vm.revertToState(snapshot);
69
69
  }
@@ -80,8 +80,8 @@ contract CoinUniV4Test is BaseTest {
80
80
  uint256 deadline = block.timestamp + 20;
81
81
  router.execute(commands, inputs, deadline);
82
82
 
83
- delta = FeeEstimatorHook(address(contentCoinHook)).getFeeState().lastDelta;
84
- swapParams = FeeEstimatorHook(address(contentCoinHook)).getFeeState().lastSwapParams;
83
+ delta = FeeEstimatorHook(payable(address(contentCoinHook))).getFeeState().lastDelta;
84
+ swapParams = FeeEstimatorHook(payable(address(contentCoinHook))).getFeeState().lastSwapParams;
85
85
 
86
86
  sqrtPriceX96 = PoolStateReader.getSqrtPriceX96(coinV4.getPoolKey(), poolManager);
87
87
 
@@ -90,7 +90,7 @@ contract CoinUniV4Test is BaseTest {
90
90
 
91
91
  function test_setupZeroAddressForPoolManager() public {
92
92
  vm.expectRevert(ICoin.AddressZero.selector);
93
- new CoinV4({
93
+ new ContentCoin({
94
94
  protocolRewardRecipient_: address(0x1234),
95
95
  protocolRewards_: address(0x1234),
96
96
  poolManager_: IPoolManager(address(0)),
@@ -100,7 +100,7 @@ contract CoinUniV4Test is BaseTest {
100
100
 
101
101
  // function test_setupZeroAddressForHooks() public {
102
102
  // vm.expectRevert(ICoin.AddressZero.selector);
103
- // new CoinV4({
103
+ // new ContentCoin({
104
104
  // protocolRewardRecipient_: address(0x1234),
105
105
  // protocolRewards_: address(0x1234),
106
106
  // poolManager_: IPoolManager(address(0x1234)),
@@ -293,6 +293,62 @@ contract CoinUniV4Test is BaseTest {
293
293
  assertApproxEqAbs(mockERC20A.balanceOf(coinV4.protocolRewardRecipient()), totalRewards.protocol, 10, "protocol reward currency");
294
294
  }
295
295
 
296
+ function test_distributesMarketRewardsInEth() public {
297
+ uint64 amountIn = 0.1 ether;
298
+
299
+ // Use address(0) as currency to price the coin in ETH
300
+ address currency = address(0);
301
+ bytes32 salt = keccak256(abi.encodePacked("eth-rewards-test"));
302
+ _deployV4Coin(currency, address(0), salt);
303
+
304
+ address trader = makeAddr("trader");
305
+
306
+ // Give trader ETH
307
+ vm.deal(trader, amountIn);
308
+
309
+ // Record initial ETH balance of payout recipient
310
+ uint256 initialPayoutBalance = coinV4.payoutRecipient().balance;
311
+
312
+ // Swap ETH for coin
313
+ _swapSomeCurrencyForCoin(coinV4, currency, amountIn, trader);
314
+
315
+ // Verify that rewards were paid out in ETH
316
+ assertGt(coinV4.payoutRecipient().balance, initialPayoutBalance, "backing reward should be paid in ETH");
317
+ }
318
+
319
+ function test_canSwapEthForCoin(uint128 amountIn) public {
320
+ vm.assume(amountIn > 0.00001 ether);
321
+ vm.assume(amountIn < 1 ether);
322
+
323
+ // Use address(0) as currency to price the coin in ETH
324
+ address currency = address(0);
325
+ bytes32 salt = keccak256(abi.encodePacked("eth-coin-test"));
326
+ _deployV4Coin(currency, address(0), salt);
327
+
328
+ address trader = makeAddr("trader");
329
+
330
+ // Give trader ETH
331
+ vm.deal(trader, amountIn);
332
+
333
+ uint256 initialEthBalance = trader.balance;
334
+
335
+ // Swap ETH for coin
336
+ _swapSomeCurrencyForCoin(coinV4, currency, amountIn, trader);
337
+
338
+ // Verify the swap worked
339
+ assertEq(trader.balance, initialEthBalance - amountIn, "trader should have spent ETH");
340
+ assertGt(coinV4.balanceOf(trader), 0, "trader should have received coin");
341
+
342
+ // Now swap some coin back for ETH
343
+ uint128 coinBalance = uint128(coinV4.balanceOf(trader));
344
+
345
+ _swapSomeCoinForCurrency(coinV4, currency, coinBalance, trader);
346
+
347
+ // Verify the reverse swap worked
348
+ assertEq(coinV4.balanceOf(trader), 0, "trader should have no coins left");
349
+ assertGt(trader.balance, 0, "trader should have received ETH back");
350
+ }
351
+
296
352
  function test_swap_emitsCoinMarketRewardsV4(uint64 amountIn) public {
297
353
  vm.assume(amountIn > 0.00001 ether);
298
354
  address currency = address(mockERC20A);
@@ -29,6 +29,47 @@ contract FactoryTest is BaseTest {
29
29
  assertEq(ZoraFactoryImpl(address(factory)).owner(), initialOwner);
30
30
  }
31
31
 
32
+ function test_ownable2Step() public {
33
+ // old current impl
34
+ assertEq(ZoraFactoryImpl(address(factory)).owner(), users.factoryOwner);
35
+
36
+ // 1st ensure owner slot is set at expected address
37
+
38
+ bytes32 ownableSlot = hex"9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300";
39
+ bytes32 ownable2StepSlot = hex"237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00";
40
+
41
+ address ownerAddress = address(uint160(uint256(vm.load(address(factory), ownableSlot))));
42
+ assertEq(ownerAddress, users.factoryOwner);
43
+
44
+ assertEq(ZoraFactoryImpl(address(factory)).pendingOwner(), address(0));
45
+
46
+ address newFactoryImpl = address(
47
+ new ZoraFactoryImpl(address(coinV3Impl), address(coinV4Impl), address(creatorCoinImpl), address(contentCoinHook), address(creatorCoinHook))
48
+ );
49
+
50
+ // Upgrade to current / new impl
51
+ vm.prank(users.factoryOwner);
52
+ ZoraFactoryImpl(address(factory)).upgradeToAndCall(newFactoryImpl, "");
53
+
54
+ // 2nd ensure owner is read from correct slot
55
+ assertEq(ZoraFactoryImpl(address(factory)).owner(), users.factoryOwner);
56
+
57
+ address newOwner = makeAddr("newOwner");
58
+
59
+ // 3rd ensure pending owner is set correctly
60
+ vm.prank(users.factoryOwner);
61
+ ZoraFactoryImpl(address(factory)).transferOwnership(newOwner);
62
+ assertEq(ZoraFactoryImpl(address(factory)).pendingOwner(), newOwner);
63
+
64
+ address ownerAddress2Step = address(uint160(uint256(vm.load(address(factory), ownable2StepSlot))));
65
+ assertEq(ownerAddress2Step, newOwner);
66
+
67
+ // 4th ensure owner is set correctly
68
+ vm.prank(newOwner);
69
+ ZoraFactoryImpl(address(factory)).acceptOwnership();
70
+ assertEq(ZoraFactoryImpl(address(factory)).owner(), newOwner);
71
+ }
72
+
32
73
  function test_deploy_no_eth() public {
33
74
  address[] memory owners = new address[](1);
34
75
  owners[0] = users.creator;
@@ -21,7 +21,7 @@ import {HooksDeployment} from "../src/libs/HooksDeployment.sol";
21
21
  import {IHooks} from "@uniswap/v4-core/src/interfaces/IHooks.sol";
22
22
  import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
23
23
  import {MultiOwnable} from "../src/utils/MultiOwnable.sol";
24
- import {CoinV4} from "../src/CoinV4.sol";
24
+ import {ContentCoin} from "../src/ContentCoin.sol";
25
25
  import {UniV4SwapHelper} from "../src/libs/UniV4SwapHelper.sol";
26
26
  import {StateLibrary} from "@uniswap/v4-core/src/libraries/StateLibrary.sol";
27
27
  import {IZoraV4CoinHook} from "../src/interfaces/IZoraV4CoinHook.sol";
@@ -225,22 +225,22 @@ contract UpgradesTest is BaseTest, CoinsDeployerBase {
225
225
  }
226
226
 
227
227
  function test_canUpgradeBrokenContentCoinAndSwap() public {
228
- vm.createSelectFork("base", 31835069);
228
+ vm.createSelectFork("base", 32613149);
229
229
 
230
230
  address trader = 0xf69fEc6d858c77e969509843852178bd24CAd2B6;
231
231
 
232
- address contentCoin = 0x4E93A01c90f812284F71291a8d1415a904957156;
232
+ address contentCoin = 0xB9799C839818bF50240CE683363D00c43a2E23b8;
233
233
 
234
234
  address creatorCoin = ICoinV4(contentCoin).currency();
235
235
 
236
- address existingHook = 0xd3D133469ADC85e01A4887404D8AC12d630e9040;
237
-
238
- uint256 amountIn = IERC20(creatorCoin).balanceOf(trader);
236
+ uint256 amountIn = 0.000111 ether;
239
237
 
240
238
  bytes memory creationCode = HooksDeployment.contentCoinCreationCode(address(poolManager), coinVersionLookup, new address[](0), upgradeGate);
241
239
 
242
240
  (IHooks newHook, ) = HooksDeployment.deployHookWithExistingOrNewSalt(address(this), creationCode, bytes32(0));
243
241
 
242
+ address existingHook = address(ICoinV4(contentCoin).hooks());
243
+
244
244
  address[] memory baseImpls = new address[](1);
245
245
  baseImpls[0] = existingHook;
246
246
 
@@ -248,7 +248,7 @@ contract UpgradesTest is BaseTest, CoinsDeployerBase {
248
248
  IHooksUpgradeGate(upgradeGate).registerUpgradePath(baseImpls, address(newHook));
249
249
 
250
250
  vm.prank(MultiOwnable(contentCoin).owners()[0]);
251
- CoinV4(contentCoin).migrateLiquidity(address(newHook), "");
251
+ ContentCoin(contentCoin).migrateLiquidity(address(newHook), "");
252
252
 
253
253
  // do some swaps to test out
254
254
  _swapSomeCurrencyForCoin(ICoinV4(contentCoin), creatorCoin, uint128(amountIn), trader);
@@ -305,7 +305,7 @@ contract UpgradesTest is BaseTest, CoinsDeployerBase {
305
305
  uint160 beforePrice = PoolStateReader.getSqrtPriceX96(creatorCoin.getPoolKey(), poolManager);
306
306
 
307
307
  vm.prank(MultiOwnable(address(creatorCoin)).owners()[0]);
308
- CoinV4(address(creatorCoin)).migrateLiquidity(address(newHook), "");
308
+ ContentCoin(address(creatorCoin)).migrateLiquidity(address(newHook), "");
309
309
 
310
310
  // get liquidity of original positions after migration
311
311
  uint128[] memory liquidityOfPositionsAfterMigration = getLiquidityForPositions(beforeKey, beforePositions);