@zoralabs/coins 2.1.0 → 2.1.2

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.
@@ -1,17 +1,14 @@
1
1
 
2
- > @zoralabs/coins@2.1.0 build /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
2
+ > @zoralabs/coins@2.1.2 build /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
3
3
  > pnpm run wagmi:generate && pnpm run copy-abis && pnpm run prettier:write && tsup
4
4
 
5
5
 
6
- > @zoralabs/coins@2.1.0 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
6
+ > @zoralabs/coins@2.1.2 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
7
7
  > FOUNDRY_PROFILE=dev forge build && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts
8
8
 
9
9
  Compiling 236 files with Solc 0.8.28
10
- Solc 0.8.28 finished in 186.86s
10
+ Solc 0.8.28 finished in 195.15s
11
11
  Compiler run successful with warnings:
12
- Warning (3420): Source file does not specify required compiler version! Consider adding "pragma solidity ^0.8.28;"
13
- --> src/BaseCoin.sol
14
-
15
12
  Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
16
13
  --> src/ZoraFactoryImpl.sol:214:9:
17
14
  |
@@ -79,113 +76,113 @@ Warning (2072): Unused local variable.
79
76
  ✅ Updated ./package/wagmiGenerated.ts (10 replacements)
80
77
  ✨ All files processed successfully!
81
78
 
82
- > @zoralabs/coins@2.1.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
79
+ > @zoralabs/coins@2.1.2 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
83
80
  > pnpm exec bundle-abis
84
81
 
85
82
 
86
- > @zoralabs/coins@2.1.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
83
+ > @zoralabs/coins@2.1.2 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
87
84
  > prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
88
85
 
89
- src/BaseCoin.sol 423ms (unchanged)
90
- src/ContentCoin.sol 34ms (unchanged)
91
- src/CreatorCoin.sol 63ms (unchanged)
92
- src/deployment/CoinsDeployerBase.sol 216ms (unchanged)
93
- src/hooks/BaseZoraV4CoinHook.sol 180ms (unchanged)
86
+ src/BaseCoin.sol 440ms (unchanged)
87
+ src/ContentCoin.sol 31ms (unchanged)
88
+ src/CreatorCoin.sol 61ms (unchanged)
89
+ src/deployment/CoinsDeployerBase.sol 222ms (unchanged)
90
+ src/hooks/BaseZoraV4CoinHook.sol 179ms (unchanged)
94
91
  src/hooks/ContentCoinHook.sol 7ms (unchanged)
95
- src/hooks/CreatorCoinHook.sol 7ms (unchanged)
96
- src/hooks/deployment/BaseCoinDeployHook.sol 20ms (unchanged)
97
- src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 118ms (unchanged)
98
- src/hooks/HookUpgradeGate.sol 22ms (unchanged)
92
+ src/hooks/CreatorCoinHook.sol 8ms (unchanged)
93
+ src/hooks/deployment/BaseCoinDeployHook.sol 16ms (unchanged)
94
+ src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 130ms (unchanged)
95
+ src/hooks/HookUpgradeGate.sol 25ms (unchanged)
99
96
  src/interfaces/IAirlock.sol 1ms (unchanged)
100
- src/interfaces/ICoin.sol 13ms (unchanged)
97
+ src/interfaces/ICoin.sol 16ms (unchanged)
101
98
  src/interfaces/ICoinComments.sol 1ms (unchanged)
102
99
  src/interfaces/ICoinDeployHook.sol 1ms (unchanged)
103
- src/interfaces/ICoinV3.sol 3ms (unchanged)
104
- src/interfaces/ICreatorCoin.sol 2ms (unchanged)
105
- src/interfaces/ICreatorCoinHook.sol 2ms (unchanged)
100
+ src/interfaces/ICoinV3.sol 2ms (unchanged)
101
+ src/interfaces/ICreatorCoin.sol 1ms (unchanged)
102
+ src/interfaces/ICreatorCoinHook.sol 1ms (unchanged)
106
103
  src/interfaces/IDeployedCoinVersionLookup.sol 1ms (unchanged)
107
- src/interfaces/IDopplerErrors.sol 1ms (unchanged)
108
- src/interfaces/IERC7572.sol 0ms (unchanged)
104
+ src/interfaces/IDopplerErrors.sol 0ms (unchanged)
105
+ src/interfaces/IERC7572.sol 1ms (unchanged)
109
106
  src/interfaces/IHasRewardsRecipients.sol 1ms (unchanged)
110
- src/interfaces/IHooksUpgradeGate.sol 1ms (unchanged)
107
+ src/interfaces/IHooksUpgradeGate.sol 2ms (unchanged)
111
108
  src/interfaces/IMsgSender.sol 1ms (unchanged)
112
- src/interfaces/INonfungiblePositionManager.sol 4ms (unchanged)
113
- src/interfaces/IPoolConfigEncoding.sol 2ms (unchanged)
109
+ src/interfaces/INonfungiblePositionManager.sol 5ms (unchanged)
110
+ src/interfaces/IPoolConfigEncoding.sol 1ms (unchanged)
114
111
  src/interfaces/IProtocolRewards.sol 2ms (unchanged)
115
- src/interfaces/ISwapPathRouter.sol 1ms (unchanged)
112
+ src/interfaces/ISwapPathRouter.sol 2ms (unchanged)
116
113
  src/interfaces/ISwapRouter.sol 1ms (unchanged)
117
114
  src/interfaces/IUniswapV3Factory.sol 5ms (unchanged)
118
115
  src/interfaces/IUniswapV3Pool.sol 3ms (unchanged)
119
116
  src/interfaces/IUniswapV3SwapCallback.sol 1ms (unchanged)
120
117
  src/interfaces/IUpgradeableV4Hook.sol 2ms (unchanged)
121
- src/interfaces/IWETH.sol 1ms (unchanged)
122
- src/interfaces/IZoraFactory.sol 12ms (unchanged)
123
- src/interfaces/IZoraV4CoinHook.sol 6ms (unchanged)
124
- src/libs/CoinCommon.sol 4ms (unchanged)
125
- src/libs/CoinConfigurationVersions.sol 46ms (unchanged)
126
- src/libs/CoinConstants.sol 4ms (unchanged)
127
- src/libs/CoinDopplerMultiCurve.sol 103ms (unchanged)
128
- src/libs/CoinRewardsV4.sol 99ms (unchanged)
129
- src/libs/CoinSetup.sol 26ms (unchanged)
130
- src/libs/CreatorCoinConstants.sol 2ms (unchanged)
131
- src/libs/CreatorCoinRewards.sol 18ms (unchanged)
132
- src/libs/DopplerMath.sol 88ms (unchanged)
133
- src/libs/HooksDeployment.sol 79ms (unchanged)
134
- src/libs/MarketConstants.sol 2ms (unchanged)
118
+ src/interfaces/IWETH.sol 2ms (unchanged)
119
+ src/interfaces/IZoraFactory.sol 11ms (unchanged)
120
+ src/interfaces/IZoraV4CoinHook.sol 11ms (unchanged)
121
+ src/libs/CoinCommon.sol 5ms (unchanged)
122
+ src/libs/CoinConfigurationVersions.sol 48ms (unchanged)
123
+ src/libs/CoinConstants.sol 5ms (unchanged)
124
+ src/libs/CoinDopplerMultiCurve.sol 110ms (unchanged)
125
+ src/libs/CoinRewardsV4.sol 103ms (unchanged)
126
+ src/libs/CoinSetup.sol 29ms (unchanged)
127
+ src/libs/CreatorCoinConstants.sol 3ms (unchanged)
128
+ src/libs/CreatorCoinRewards.sol 22ms (unchanged)
129
+ src/libs/DopplerMath.sol 93ms (unchanged)
130
+ src/libs/HooksDeployment.sol 86ms (unchanged)
131
+ src/libs/MarketConstants.sol 1ms (unchanged)
135
132
  src/libs/PoolStateReader.sol 6ms (unchanged)
136
133
  src/libs/UniV4SwapHelper.sol 29ms (unchanged)
137
- src/libs/UniV4SwapToCurrency.sol 48ms (unchanged)
138
- src/libs/V4Liquidity.sol 131ms (unchanged)
139
- src/proxy/ZoraFactory.sol 5ms (unchanged)
134
+ src/libs/UniV4SwapToCurrency.sol 50ms (unchanged)
135
+ src/libs/V4Liquidity.sol 138ms (unchanged)
136
+ src/proxy/ZoraFactory.sol 6ms (unchanged)
140
137
  src/types/LpPosition.sol 1ms (unchanged)
141
- src/types/PoolConfiguration.sol 3ms (unchanged)
142
- src/types/PoolState.sol 1ms (unchanged)
138
+ src/types/PoolConfiguration.sol 1ms (unchanged)
139
+ src/types/PoolState.sol 2ms (unchanged)
143
140
  src/utils/AutoSwapper.sol 20ms (unchanged)
144
- src/utils/DeployedCoinVersionLookup.sol 4ms (unchanged)
145
- src/utils/MultiOwnable.sol 45ms (unchanged)
141
+ src/utils/DeployedCoinVersionLookup.sol 5ms (unchanged)
142
+ src/utils/MultiOwnable.sol 46ms (unchanged)
146
143
  src/utils/uniswap/BitMath.sol 10ms (unchanged)
147
- src/utils/uniswap/BytesLib.sol 17ms (unchanged)
148
- src/utils/uniswap/CustomRevert.sol 41ms (unchanged)
144
+ src/utils/uniswap/BytesLib.sol 12ms (unchanged)
145
+ src/utils/uniswap/CustomRevert.sol 43ms (unchanged)
149
146
  src/utils/uniswap/FixedPoint96.sol 1ms (unchanged)
150
147
  src/utils/uniswap/FullMath.sol 20ms (unchanged)
151
- src/utils/uniswap/LiquidityAmounts.sol 46ms (unchanged)
148
+ src/utils/uniswap/LiquidityAmounts.sol 47ms (unchanged)
152
149
  src/utils/uniswap/Path.sol 5ms (unchanged)
153
150
  src/utils/uniswap/SafeCast.sol 11ms (unchanged)
154
- src/utils/uniswap/SqrtPriceMath.sol 64ms (unchanged)
155
- src/utils/uniswap/TickMath.sol 68ms (unchanged)
156
- src/utils/uniswap/UnsafeMath.sol 2ms (unchanged)
151
+ src/utils/uniswap/SqrtPriceMath.sol 67ms (unchanged)
152
+ src/utils/uniswap/TickMath.sol 66ms (unchanged)
153
+ src/utils/uniswap/UnsafeMath.sol 3ms (unchanged)
157
154
  src/version/ContractVersionBase.sol 1ms (unchanged)
158
- src/ZoraFactoryImpl.sol 106ms (unchanged)
159
- test/AutoSwapper.t.sol 34ms (unchanged)
160
- test/Coin.t.sol 110ms (unchanged)
161
- test/CoinUniV4.t.sol 336ms (unchanged)
162
- test/CreatorCoin.t.sol 130ms (unchanged)
163
- test/DeploymentHooks.t.sol 66ms (unchanged)
164
- test/Factory.t.sol 76ms (unchanged)
165
- test/HooksDeployment.t.sol 25ms (unchanged)
166
- test/LiquidityMigration.t.sol 155ms (unchanged)
167
- test/mocks/MockERC20.sol 2ms (unchanged)
168
- test/MultiOwnable.t.sol 80ms (unchanged)
169
- test/Upgrades.t.sol 107ms (unchanged)
170
- test/utils/BaseTest.sol 154ms (unchanged)
171
- test/utils/ContractAddresses.sol 2ms (unchanged)
172
- test/utils/DeployedCoinVersionLookup.t.sol 38ms (unchanged)
173
- test/utils/FeeEstimatorHook.sol 26ms (unchanged)
174
- test/utils/ProtocolRewards.sol 281ms (unchanged)
175
- test/utils/ProxyShim.sol 6ms (unchanged)
155
+ src/ZoraFactoryImpl.sol 109ms (unchanged)
156
+ test/AutoSwapper.t.sol 35ms (unchanged)
157
+ test/Coin.t.sol 114ms (unchanged)
158
+ test/CoinUniV4.t.sol 354ms (unchanged)
159
+ test/CreatorCoin.t.sol 133ms (unchanged)
160
+ test/DeploymentHooks.t.sol 68ms (unchanged)
161
+ test/Factory.t.sol 80ms (unchanged)
162
+ test/HooksDeployment.t.sol 27ms (unchanged)
163
+ test/LiquidityMigration.t.sol 162ms (unchanged)
164
+ test/mocks/MockERC20.sol 3ms (unchanged)
165
+ test/MultiOwnable.t.sol 84ms (unchanged)
166
+ test/Upgrades.t.sol 110ms (unchanged)
167
+ test/utils/BaseTest.sol 159ms (unchanged)
168
+ test/utils/ContractAddresses.sol 3ms (unchanged)
169
+ test/utils/DeployedCoinVersionLookup.t.sol 48ms (unchanged)
170
+ test/utils/FeeEstimatorHook.sol 28ms (unchanged)
171
+ test/utils/ProtocolRewards.sol 319ms (unchanged)
172
+ test/utils/ProxyShim.sol 4ms (unchanged)
176
173
  script/Deploy.s.sol 3ms (unchanged)
177
- script/DeployAutoSwapper.s.sol 13ms (unchanged)
178
- script/DeployDevFactory.s.sol 3ms (unchanged)
174
+ script/DeployAutoSwapper.s.sol 12ms (unchanged)
175
+ script/DeployDevFactory.s.sol 2ms (unchanged)
179
176
  script/DeployPostDeploymentHooks.s.sol 2ms (unchanged)
180
177
  script/DeployUpgradeGate.s.sol 3ms (unchanged)
181
- script/GenerateDeterministicParams.s.sol 12ms (unchanged)
178
+ script/GenerateDeterministicParams.s.sol 11ms (unchanged)
182
179
  script/PrintRegisterUpgradePath.s.sol 9ms (unchanged)
183
180
  script/PrintUpgradeCommand.s.sol 2ms (unchanged)
184
- script/TestBackingCoinSwap.s.sol 31ms (unchanged)
185
- script/TestV4Swap.s.sol 30ms (unchanged)
186
- script/UpgradeCoinImpl.sol 5ms (unchanged)
181
+ script/TestBackingCoinSwap.s.sol 30ms (unchanged)
182
+ script/TestV4Swap.s.sol 29ms (unchanged)
183
+ script/UpgradeCoinImpl.sol 6ms (unchanged)
187
184
  script/UpgradeFactoryImpl.s.sol 5ms (unchanged)
188
- script/UpgradeHooks.s.sol 6ms (unchanged)
185
+ script/UpgradeHooks.s.sol 7ms (unchanged)
189
186
  CLI Building entry: package/index.ts
190
187
  CLI Using tsconfig: tsconfig.json
191
188
  CLI tsup v8.4.0
@@ -196,7 +193,7 @@ script/UpgradeHooks.s.sol 6ms (unchanged)
196
193
  ESM Build start
197
194
  ESM dist/index.js 128.58 KB
198
195
  ESM dist/index.js.map 229.86 KB
199
- ESM ⚡️ Build success in 44ms
196
+ ESM ⚡️ Build success in 41ms
200
197
  CJS dist/index.cjs 130.00 KB
201
198
  CJS dist/index.cjs.map 230.01 KB
202
- CJS ⚡️ Build success in 44ms
199
+ CJS ⚡️ Build success in 41ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @zoralabs/coins
2
2
 
3
+ ## 2.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8b85ab94: Removed some unused constants
8
+
9
+ ## 2.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 498e5c9d: Consolidated POOL_LAUNCH_SUPPLY into a single constant
14
+
3
15
  ## 2.1.0
4
16
 
5
17
  ### Minor Changes
package/foundry.toml CHANGED
@@ -19,6 +19,4 @@ fs_permissions = [
19
19
  runs = 100
20
20
 
21
21
  [rpc_endpoints]
22
- base = "https://base-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
23
- mainnet = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
24
- zora = "https://rpc.zora.energy"
22
+ base = "https://base.gateway.tenderly.co/${TENDERLY_KEY}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoralabs/coins",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -35,9 +35,9 @@
35
35
  "tsx": "^3.13.0",
36
36
  "typescript": "^5.2.2",
37
37
  "viem": "^2.21.18",
38
- "@zoralabs/tsconfig": "^0.0.1",
39
38
  "@zoralabs/shared-scripts": "^0.0.0",
40
- "@zoralabs/shared-contracts": "^0.0.5"
39
+ "@zoralabs/shared-contracts": "^0.0.5",
40
+ "@zoralabs/tsconfig": "^0.0.1"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "pnpm run wagmi:generate && pnpm run copy-abis && pnpm run prettier:write && tsup",
package/src/BaseCoin.sol CHANGED
@@ -4,7 +4,8 @@
4
4
  // non-commercial purposes only. Commercial use and competitive products are prohibited
5
5
  // until the "Open Date" (3 years from first public distribution or earlier at Zora's discretion),
6
6
  // at which point this software automatically becomes available under the MIT License.
7
- // Full license terms available at: https://docs.zora.co/coins/licensepragma solidity ^0.8.23;
7
+ // Full license terms available at: https://docs.zora.co/coins/license
8
+ pragma solidity ^0.8.23;
8
9
 
9
10
  import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
10
11
  import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
@@ -9,7 +9,7 @@ pragma solidity ^0.8.28;
9
9
 
10
10
  import {IPoolManager, IDeployedCoinVersionLookup, IHasRewardsRecipients, Currency, BaseZoraV4CoinHook} from "./BaseZoraV4CoinHook.sol";
11
11
  import {CoinRewardsV4} from "../libs/CoinRewardsV4.sol";
12
- import {MarketConstants} from "../libs/MarketConstants.sol";
12
+ import {CoinConstants} from "../libs/CoinConstants.sol";
13
13
  import {IHooksUpgradeGate} from "../interfaces/IHooksUpgradeGate.sol";
14
14
 
15
15
  contract ContentCoinHook is BaseZoraV4CoinHook {
@@ -18,7 +18,7 @@ contract ContentCoinHook is BaseZoraV4CoinHook {
18
18
  IDeployedCoinVersionLookup coinVersionLookup_,
19
19
  address[] memory trustedMessageSenders_,
20
20
  IHooksUpgradeGate upgradeGate
21
- ) BaseZoraV4CoinHook(poolManager_, coinVersionLookup_, trustedMessageSenders_, upgradeGate, MarketConstants.POOL_LAUNCH_SUPPLY) {}
21
+ ) BaseZoraV4CoinHook(poolManager_, coinVersionLookup_, trustedMessageSenders_, upgradeGate, CoinConstants.POOL_LAUNCH_SUPPLY) {}
22
22
 
23
23
  /// @dev Override for market reward distribution
24
24
  function _distributeMarketRewards(Currency currency, uint128 fees, IHasRewardsRecipients coin, address tradeReferrer) internal override {
@@ -53,7 +53,7 @@ library CoinRewardsV4 {
53
53
  uint256 public constant LP_REWARD_BPS = 3333;
54
54
 
55
55
  function getTradeReferral(bytes calldata hookData) internal pure returns (address) {
56
- return hookData.length >= 32 ? abi.decode(hookData, (address)) : address(0);
56
+ return hookData.length >= 20 ? abi.decode(hookData, (address)) : address(0);
57
57
  }
58
58
 
59
59
  /// @dev Converts collected fees from LP positions into target payout currency, and transfers to hook contract, so
@@ -2,17 +2,9 @@
2
2
  pragma solidity ^0.8.23;
3
3
 
4
4
  library MarketConstants {
5
- /// @notice The number of coins allocated to the liquidity pool
6
- /// @dev 990 million coins
7
- uint256 internal constant POOL_LAUNCH_SUPPLY = 990_000_000e18;
8
-
9
5
  /// @dev Constant used to increase precision during calculations
10
6
  uint256 constant WAD = 1e18;
11
7
 
12
- /// @notice The LP fee
13
- /// @dev 10000 basis points = 1%
14
- uint24 internal constant LP_FEE = 10000;
15
-
16
8
  /// @notice The LP fee
17
9
  /// @dev 30000 basis points = 3%
18
10
  uint24 internal constant LP_FEE_V4 = 30000;
@@ -20,10 +12,4 @@ library MarketConstants {
20
12
  /// @notice The spacing for 1% pools
21
13
  /// @dev 200 ticks
22
14
  int24 internal constant TICK_SPACING = 200;
23
-
24
- /// @notice The minimum lower tick for legacy single LP WETH pools
25
- int24 internal constant LP_TICK_LOWER_WETH = -208200;
26
-
27
- /// @notice The upper tick for legacy single LP WETH pools
28
- int24 internal constant LP_TICK_UPPER = 887200;
29
15
  }
@@ -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 "2.1.0";
12
+ return "2.1.2";
13
13
  }
14
14
  }
@@ -57,7 +57,7 @@ contract CoinUniV4Test is BaseTest {
57
57
  /// and then reverting the state after the swap
58
58
  function _estimateLpFees(bytes memory commands, bytes[] memory inputs) internal returns (FeeEstimatorHook.FeeEstimatorState memory feeState) {
59
59
  uint256 snapshot = vm.snapshot();
60
- _deployFeeEstimatorHook(MarketConstants.POOL_LAUNCH_SUPPLY, address(contentCoinHook));
60
+ _deployFeeEstimatorHook(CoinConstants.POOL_LAUNCH_SUPPLY, address(contentCoinHook));
61
61
 
62
62
  // Execute the swap
63
63
  uint256 deadline = block.timestamp + 20;
@@ -74,7 +74,7 @@ contract CoinUniV4Test is BaseTest {
74
74
  bytes[] memory inputs
75
75
  ) internal returns (BalanceDelta delta, SwapParams memory swapParams, uint160 sqrtPriceX96) {
76
76
  uint256 snapshot = vm.snapshot();
77
- _deployFeeEstimatorHook(MarketConstants.POOL_LAUNCH_SUPPLY, address(contentCoinHook));
77
+ _deployFeeEstimatorHook(CoinConstants.POOL_LAUNCH_SUPPLY, address(contentCoinHook));
78
78
 
79
79
  // Execute the swap
80
80
  uint256 deadline = block.timestamp + 20;