@zoralabs/coins 2.5.0 → 2.6.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 (46) hide show
  1. package/.turbo/turbo-build$colon$js.log +143 -131
  2. package/CHANGELOG.md +20 -17
  3. package/abis/BaseCoin.json +5 -0
  4. package/abis/ContentCoin.json +5 -0
  5. package/abis/ICoin.json +5 -0
  6. package/abis/ICoinV3.json +5 -0
  7. package/abis/ITrendCoin.json +130 -0
  8. package/abis/ITrendCoinErrors.json +23 -0
  9. package/abis/IUniversalRouter.json +61 -0
  10. package/abis/IZoraFactory.json +227 -0
  11. package/abis/TrendCoin.json +2043 -0
  12. package/abis/ZoraFactoryImpl.json +232 -0
  13. package/dist/index.cjs +953 -138
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +951 -138
  16. package/dist/index.js.map +1 -1
  17. package/dist/wagmiGenerated.d.ts +1380 -149
  18. package/dist/wagmiGenerated.d.ts.map +1 -1
  19. package/package/wagmiGenerated.ts +960 -139
  20. package/package.json +2 -2
  21. package/src/BaseCoin.sol +12 -12
  22. package/src/ContentCoin.sol +20 -1
  23. package/src/CreatorCoin.sol +3 -0
  24. package/src/TrendCoin.sol +117 -0
  25. package/src/ZoraFactoryImpl.sol +142 -1
  26. package/src/hooks/ZoraV4CoinHook.sol +14 -6
  27. package/src/interfaces/ICoin.sol +5 -1
  28. package/src/interfaces/ICreatorCoin.sol +0 -3
  29. package/src/interfaces/IPoolManager.sol +13 -0
  30. package/src/interfaces/ITrendCoin.sol +26 -0
  31. package/src/interfaces/ITrendCoinErrors.sol +18 -0
  32. package/src/interfaces/IZoraFactory.sol +60 -1
  33. package/src/libs/CoinConstants.sol +9 -1
  34. package/src/libs/CoinRewardsV4.sol +67 -19
  35. package/src/libs/TickerUtils.sol +84 -0
  36. package/src/libs/UniV4SwapToCurrency.sol +2 -1
  37. package/src/version/ContractVersionBase.sol +1 -1
  38. package/test/CreatorCoin.t.sol +2 -1
  39. package/test/Factory.t.sol +31 -5
  40. package/test/LaunchFee.t.sol +0 -2
  41. package/test/LiquidityMigration.t.sol +0 -2
  42. package/test/TrendCoin.t.sol +1077 -0
  43. package/test/Upgrades.t.sol +16 -3
  44. package/test/utils/FeeEstimatorHook.sol +33 -8
  45. package/test/utils/V4TestSetup.sol +36 -4
  46. package/wagmi.config.ts +2 -0
@@ -1,18 +1,24 @@
1
1
 
2
- > @zoralabs/coins@2.5.0 build:js /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
2
+ > @zoralabs/coins@2.6.0 build:js /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.5.0 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
6
+ > @zoralabs/coins@2.6.0 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
7
7
  > pnpm run build:contracts:minimal && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts
8
8
 
9
9
 
10
- > @zoralabs/coins@2.5.0 build:contracts:minimal /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
10
+ > @zoralabs/coins@2.6.0 build:contracts:minimal /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
11
11
  > forge build src/ --no-metadata
12
12
 
13
- Compiling 184 files with Solc 0.8.28
14
- Solc 0.8.28 finished in 46.32s
15
- Compiler run successful!
13
+ Compiling 190 files with Solc 0.8.28
14
+ Solc 0.8.28 finished in 61.05s
15
+ Compiler run successful with warnings:
16
+ Warning (2018): Function state mutability can be restricted to pure
17
+ --> src/TrendCoin.sol:90:5:
18
+ |
19
+ 90 | function initialize(
20
+ | ^ (Relevant source part starts here and spans across multiple lines).
21
+
16
22
  - Validating plugins
17
23
  ✔ Validating plugins
18
24
  - Resolving contracts
@@ -23,142 +29,148 @@ Compiler run successful!
23
29
  ✔ Writing to package/wagmiGenerated.ts
24
30
  🔄 Processing 1 file(s) to replace 'Abi' with 'ABI'...
25
31
  📝 Processing ./package/wagmiGenerated.ts...
26
- ✅ Updated ./package/wagmiGenerated.ts (10 replacements)
32
+ ✅ Updated ./package/wagmiGenerated.ts (12 replacements)
27
33
  ✨ All files processed successfully!
28
34
 
29
- > @zoralabs/coins@2.5.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
35
+ > @zoralabs/coins@2.6.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
30
36
  > pnpm exec bundle-abis
31
37
 
32
38
 
33
- > @zoralabs/coins@2.5.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
39
+ > @zoralabs/coins@2.6.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
34
40
  > prettier --write 'src/**/*.sol' 'test/**/*.sol'
35
41
 
36
- src/BaseCoin.sol 796ms (unchanged)
37
- src/ContentCoin.sol 73ms (unchanged)
38
- src/CreatorCoin.sol 86ms (unchanged)
39
- src/deployment/ForkedCoinsAddresses.sol 29ms (unchanged)
40
- src/hook-registry/ZoraHookRegistry.sol 153ms (unchanged)
41
- src/hooks/deployment/BaseCoinDeployHook.sol 57ms (unchanged)
42
- src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 249ms (unchanged)
43
- src/hooks/deployment/BuySupplyWithV4SwapHook.sol 138ms (unchanged)
44
- src/hooks/HookUpgradeGate.sol 35ms (unchanged)
45
- src/hooks/ZoraV4CoinHook.sol 317ms (unchanged)
46
- src/interfaces/IAirlock.sol 1ms (unchanged)
47
- src/interfaces/ICoin.sol 38ms (unchanged)
48
- src/interfaces/ICoinComments.sol 2ms (unchanged)
49
- src/interfaces/ICoinDeployHook.sol 1ms (unchanged)
50
- src/interfaces/ICoinV3.sol 5ms (unchanged)
51
- src/interfaces/ICreatorCoin.sol 2ms (unchanged)
52
- src/interfaces/ICreatorCoinHook.sol 2ms (unchanged)
53
- src/interfaces/IDeployedCoinVersionLookup.sol 1ms (unchanged)
54
- src/interfaces/IDopplerErrors.sol 2ms (unchanged)
55
- src/interfaces/IERC7572.sol 1ms (unchanged)
56
- src/interfaces/IHasCreationInfo.sol 1ms (unchanged)
57
- src/interfaces/IHasRewardsRecipients.sol 2ms (unchanged)
58
- src/interfaces/IHooksUpgradeGate.sol 2ms (unchanged)
59
- src/interfaces/IMsgSender.sol 1ms (unchanged)
60
- src/interfaces/INonfungiblePositionManager.sol 16ms (unchanged)
61
- src/interfaces/IPoolConfigEncoding.sol 1ms (unchanged)
62
- src/interfaces/IProtocolRewards.sol 8ms (unchanged)
63
- src/interfaces/ISupportsLimitOrderFill.sol 1ms (unchanged)
64
- src/interfaces/ISwapPathRouter.sol 2ms (unchanged)
65
- src/interfaces/ISwapRouter.sol 1ms (unchanged)
66
- src/interfaces/ITrustedMsgSenderProviderLookup.sol 1ms (unchanged)
67
- src/interfaces/IUniswapV3Factory.sol 5ms (unchanged)
68
- src/interfaces/IUniswapV3Pool.sol 6ms (unchanged)
69
- src/interfaces/IUniswapV3SwapCallback.sol 1ms (unchanged)
70
- src/interfaces/IUpgradeableV4Hook.sol 4ms (unchanged)
71
- src/interfaces/IWETH.sol 4ms (unchanged)
72
- src/interfaces/IZoraFactory.sol 16ms (unchanged)
73
- src/interfaces/IZoraHookRegistry.sol 4ms (unchanged)
74
- src/interfaces/IZoraLimitOrderBookCoinsInterface.sol 2ms (unchanged)
75
- src/interfaces/IZoraV4CoinHook.sol 5ms (unchanged)
76
- src/libs/CoinCommon.sol 9ms (unchanged)
77
- src/libs/CoinConfigurationVersions.sol 71ms (unchanged)
78
- src/libs/CoinConstants.sol 9ms (unchanged)
79
- src/libs/CoinDopplerMultiCurve.sol 172ms (unchanged)
80
- src/libs/CoinRewardsV4.sol 198ms (unchanged)
81
- src/libs/CoinSetup.sol 44ms
82
- src/libs/DopplerMath.sol 164ms (unchanged)
83
- src/libs/HooksDeployment.sol 125ms (unchanged)
84
- src/libs/PoolStateReader.sol 5ms (unchanged)
85
- src/libs/UniV4SwapHelper.sol 131ms (unchanged)
86
- src/libs/UniV4SwapToCurrency.sol 80ms (unchanged)
87
- src/libs/V3ToV4SwapLib.sol 111ms (unchanged)
88
- src/libs/V4Liquidity.sol 321ms (unchanged)
89
- src/proxy/ZoraFactory.sol 8ms (unchanged)
90
- src/types/LpPosition.sol 1ms (unchanged)
91
- src/types/PoolConfiguration.sol 2ms (unchanged)
92
- src/types/PoolState.sol 1ms (unchanged)
93
- src/utils/AutoSwapper.sol 32ms (unchanged)
94
- src/utils/DeployedCoinVersionLookup.sol 7ms (unchanged)
95
- src/utils/MultiOwnable.sol 71ms (unchanged)
96
- src/utils/ProxyShim.sol 4ms (unchanged)
97
- src/utils/TrustedMsgSenderProviderLookup.sol 38ms (unchanged)
98
- src/utils/uniswap/BitMath.sol 18ms (unchanged)
99
- src/utils/uniswap/CustomRevert.sol 57ms (unchanged)
100
- src/utils/uniswap/FixedPoint96.sol 2ms (unchanged)
101
- src/utils/uniswap/FullMath.sol 31ms (unchanged)
102
- src/utils/uniswap/LiquidityAmounts.sol 75ms (unchanged)
103
- src/utils/uniswap/SafeCast.sol 20ms (unchanged)
104
- src/utils/uniswap/SqrtPriceMath.sol 107ms (unchanged)
105
- src/utils/uniswap/TickMath.sol 122ms (unchanged)
106
- src/utils/uniswap/UnsafeMath.sol 4ms (unchanged)
107
- src/version/ContractVersionBase.sol 2ms (unchanged)
108
- src/ZoraFactoryImpl.sol 205ms (unchanged)
109
- test/AutoSwapper.t.sol 62ms (unchanged)
110
- test/BuySupplyWithV4SwapHook.t.sol 246ms (unchanged)
111
- test/Coin.t.sol 227ms (unchanged)
112
- test/CoinRewardsV4.t.sol 14ms (unchanged)
113
- test/CoinUniV4.t.sol 631ms (unchanged)
114
- test/ContentCoinRewards.t.sol 218ms (unchanged)
115
- test/CreatorCoin.t.sol 248ms (unchanged)
116
- test/CreatorCoinRewards.t.sol 172ms (unchanged)
117
- test/DeploymentHooks.t.sol 134ms (unchanged)
118
- test/Factory.t.sol 154ms (unchanged)
119
- test/HooksDeployment.t.sol 86ms (unchanged)
120
- test/LaunchFee.t.sol 161ms (unchanged)
121
- test/LiquidityMigration.t.sol 361ms (unchanged)
122
- test/mocks/MockAirlock.sol 9ms (unchanged)
123
- test/mocks/MockERC20.sol 4ms (unchanged)
124
- test/mocks/MockSwapRouter.sol 16ms (unchanged)
125
- test/mocks/MockZoraLimitOrderBook.sol 1ms (unchanged)
126
- test/mocks/SimpleERC20.sol 4ms (unchanged)
127
- test/MultiOwnable.t.sol 138ms (unchanged)
128
- test/TrustedMsgSenderProviderLookup.t.sol 86ms (unchanged)
129
- test/Upgrades.t.sol 127ms (unchanged)
130
- test/utils/BaseTest.sol 32ms (unchanged)
131
- test/utils/ContractAddresses.sol 5ms (unchanged)
132
- test/utils/DeployedCoinVersionLookup.t.sol 67ms (unchanged)
133
- test/utils/FeeEstimatorHook.sol 45ms (unchanged)
134
- test/utils/hookmate/artifacts/DeployHelper.sol 9ms (unchanged)
135
- test/utils/hookmate/artifacts/Permit2.sol 5ms (unchanged)
136
- test/utils/hookmate/artifacts/UniversalRouter.sol 8ms (unchanged)
137
- test/utils/hookmate/artifacts/V4PoolManager.sol 7ms (unchanged)
138
- test/utils/hookmate/artifacts/V4PositionManager.sol 9ms (unchanged)
139
- test/utils/hookmate/artifacts/V4Quoter.sol 6ms (unchanged)
140
- test/utils/hookmate/artifacts/V4Router.sol 8ms (unchanged)
141
- test/utils/hookmate/constants/AddressConstants.sol 60ms (unchanged)
142
- test/utils/hookmate/interfaces/router/IUniswapV4Router04.sol 13ms (unchanged)
143
- test/utils/hookmate/interfaces/router/PathKey.sol 19ms (unchanged)
144
- test/utils/hookmate/test/utils/SwapFeeEventAsserter.sol 18ms (unchanged)
145
- test/utils/ProtocolRewards.sol 542ms (unchanged)
146
- test/utils/RewardTestHelpers.sol 82ms (unchanged)
147
- test/utils/TrustedSenderTestHelper.sol 4ms (unchanged)
148
- test/utils/V4TestSetup.sol 418ms (unchanged)
149
- test/V4Liquidity.t.sol 145ms (unchanged)
150
- test/ZoraHookRegistry.t.sol 226ms (unchanged)
42
+ src/BaseCoin.sol 1133ms (unchanged)
43
+ src/ContentCoin.sol 175ms (unchanged)
44
+ src/CreatorCoin.sol 156ms (unchanged)
45
+ src/deployment/ForkedCoinsAddresses.sol 34ms (unchanged)
46
+ src/hook-registry/ZoraHookRegistry.sol 178ms (unchanged)
47
+ src/hooks/deployment/BaseCoinDeployHook.sol 69ms (unchanged)
48
+ src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 265ms (unchanged)
49
+ src/hooks/deployment/BuySupplyWithV4SwapHook.sol 154ms (unchanged)
50
+ src/hooks/HookUpgradeGate.sol 40ms (unchanged)
51
+ src/hooks/ZoraV4CoinHook.sol 323ms
52
+ src/interfaces/IAirlock.sol 4ms (unchanged)
53
+ src/interfaces/ICoin.sol 22ms (unchanged)
54
+ src/interfaces/ICoinComments.sol 3ms (unchanged)
55
+ src/interfaces/ICoinDeployHook.sol 2ms (unchanged)
56
+ src/interfaces/ICoinV3.sol 8ms (unchanged)
57
+ src/interfaces/ICreatorCoin.sol 5ms (unchanged)
58
+ src/interfaces/ICreatorCoinHook.sol 4ms (unchanged)
59
+ src/interfaces/IDeployedCoinVersionLookup.sol 2ms (unchanged)
60
+ src/interfaces/IDopplerErrors.sol 2ms (unchanged)
61
+ src/interfaces/IERC7572.sol 1ms (unchanged)
62
+ src/interfaces/IHasCreationInfo.sol 1ms (unchanged)
63
+ src/interfaces/IHasRewardsRecipients.sol 2ms (unchanged)
64
+ src/interfaces/IHooksUpgradeGate.sol 4ms (unchanged)
65
+ src/interfaces/IMsgSender.sol 1ms (unchanged)
66
+ src/interfaces/INonfungiblePositionManager.sol 8ms (unchanged)
67
+ src/interfaces/IPoolConfigEncoding.sol 2ms (unchanged)
68
+ src/interfaces/IPoolManager.sol 1ms (unchanged)
69
+ src/interfaces/IProtocolRewards.sol 5ms (unchanged)
70
+ src/interfaces/ISupportsLimitOrderFill.sol 1ms (unchanged)
71
+ src/interfaces/ISwapPathRouter.sol 2ms (unchanged)
72
+ src/interfaces/ISwapRouter.sol 1ms (unchanged)
73
+ src/interfaces/ITrendCoin.sol 2ms (unchanged)
74
+ src/interfaces/ITrendCoinErrors.sol 1ms (unchanged)
75
+ src/interfaces/ITrustedMsgSenderProviderLookup.sol 2ms (unchanged)
76
+ src/interfaces/IUniswapV3Factory.sol 5ms (unchanged)
77
+ src/interfaces/IUniswapV3Pool.sol 12ms (unchanged)
78
+ src/interfaces/IUniswapV3SwapCallback.sol 2ms (unchanged)
79
+ src/interfaces/IUpgradeableV4Hook.sol 4ms (unchanged)
80
+ src/interfaces/IWETH.sol 6ms (unchanged)
81
+ src/interfaces/IZoraFactory.sol 27ms (unchanged)
82
+ src/interfaces/IZoraHookRegistry.sol 4ms (unchanged)
83
+ src/interfaces/IZoraLimitOrderBookCoinsInterface.sol 2ms (unchanged)
84
+ src/interfaces/IZoraV4CoinHook.sol 16ms (unchanged)
85
+ src/libs/CoinCommon.sol 17ms (unchanged)
86
+ src/libs/CoinConfigurationVersions.sol 84ms (unchanged)
87
+ src/libs/CoinConstants.sol 37ms (unchanged)
88
+ src/libs/CoinDopplerMultiCurve.sol 184ms (unchanged)
89
+ src/libs/CoinRewardsV4.sol 211ms
90
+ src/libs/CoinSetup.sol 44ms (unchanged)
91
+ src/libs/DopplerMath.sol 167ms (unchanged)
92
+ src/libs/HooksDeployment.sol 128ms (unchanged)
93
+ src/libs/PoolStateReader.sol 6ms (unchanged)
94
+ src/libs/TickerUtils.sol 44ms
95
+ src/libs/UniV4SwapHelper.sol 138ms (unchanged)
96
+ src/libs/UniV4SwapToCurrency.sol 90ms
97
+ src/libs/V3ToV4SwapLib.sol 123ms (unchanged)
98
+ src/libs/V4Liquidity.sol 337ms (unchanged)
99
+ src/proxy/ZoraFactory.sol 10ms (unchanged)
100
+ src/TrendCoin.sol 39ms (unchanged)
101
+ src/types/LpPosition.sol 1ms (unchanged)
102
+ src/types/PoolConfiguration.sol 1ms (unchanged)
103
+ src/types/PoolState.sol 2ms (unchanged)
104
+ src/utils/AutoSwapper.sol 37ms (unchanged)
105
+ src/utils/DeployedCoinVersionLookup.sol 8ms (unchanged)
106
+ src/utils/MultiOwnable.sol 66ms (unchanged)
107
+ src/utils/ProxyShim.sol 5ms (unchanged)
108
+ src/utils/TrustedMsgSenderProviderLookup.sol 38ms (unchanged)
109
+ src/utils/uniswap/BitMath.sol 10ms (unchanged)
110
+ src/utils/uniswap/CustomRevert.sol 57ms (unchanged)
111
+ src/utils/uniswap/FixedPoint96.sol 2ms (unchanged)
112
+ src/utils/uniswap/FullMath.sol 34ms (unchanged)
113
+ src/utils/uniswap/LiquidityAmounts.sol 78ms (unchanged)
114
+ src/utils/uniswap/SafeCast.sol 20ms (unchanged)
115
+ src/utils/uniswap/SqrtPriceMath.sol 109ms (unchanged)
116
+ src/utils/uniswap/TickMath.sol 114ms (unchanged)
117
+ src/utils/uniswap/UnsafeMath.sol 3ms (unchanged)
118
+ src/version/ContractVersionBase.sol 2ms (unchanged)
119
+ src/ZoraFactoryImpl.sol 294ms (unchanged)
120
+ test/AutoSwapper.t.sol 68ms (unchanged)
121
+ test/BuySupplyWithV4SwapHook.t.sol 263ms (unchanged)
122
+ test/Coin.t.sol 252ms (unchanged)
123
+ test/CoinRewardsV4.t.sol 15ms (unchanged)
124
+ test/CoinUniV4.t.sol 688ms (unchanged)
125
+ test/ContentCoinRewards.t.sol 231ms (unchanged)
126
+ test/CreatorCoin.t.sol 255ms (unchanged)
127
+ test/CreatorCoinRewards.t.sol 193ms (unchanged)
128
+ test/DeploymentHooks.t.sol 145ms (unchanged)
129
+ test/Factory.t.sol 160ms
130
+ test/HooksDeployment.t.sol 102ms (unchanged)
131
+ test/LaunchFee.t.sol 189ms (unchanged)
132
+ test/LiquidityMigration.t.sol 375ms (unchanged)
133
+ test/mocks/MockAirlock.sol 6ms (unchanged)
134
+ test/mocks/MockERC20.sol 8ms (unchanged)
135
+ test/mocks/MockSwapRouter.sol 10ms (unchanged)
136
+ test/mocks/MockZoraLimitOrderBook.sol 2ms (unchanged)
137
+ test/mocks/SimpleERC20.sol 4ms (unchanged)
138
+ test/MultiOwnable.t.sol 156ms (unchanged)
139
+ test/TrendCoin.t.sol 740ms
140
+ test/TrustedMsgSenderProviderLookup.t.sol 95ms (unchanged)
141
+ test/Upgrades.t.sol 148ms
142
+ test/utils/BaseTest.sol 34ms (unchanged)
143
+ test/utils/ContractAddresses.sol 6ms (unchanged)
144
+ test/utils/DeployedCoinVersionLookup.t.sol 70ms (unchanged)
145
+ test/utils/FeeEstimatorHook.sol 68ms
146
+ test/utils/hookmate/artifacts/DeployHelper.sol 9ms (unchanged)
147
+ test/utils/hookmate/artifacts/Permit2.sol 6ms (unchanged)
148
+ test/utils/hookmate/artifacts/UniversalRouter.sol 8ms (unchanged)
149
+ test/utils/hookmate/artifacts/V4PoolManager.sol 8ms (unchanged)
150
+ test/utils/hookmate/artifacts/V4PositionManager.sol 12ms (unchanged)
151
+ test/utils/hookmate/artifacts/V4Quoter.sol 7ms (unchanged)
152
+ test/utils/hookmate/artifacts/V4Router.sol 8ms (unchanged)
153
+ test/utils/hookmate/constants/AddressConstants.sol 66ms (unchanged)
154
+ test/utils/hookmate/interfaces/router/IUniswapV4Router04.sol 10ms (unchanged)
155
+ test/utils/hookmate/interfaces/router/PathKey.sol 28ms (unchanged)
156
+ test/utils/hookmate/test/utils/SwapFeeEventAsserter.sol 17ms (unchanged)
157
+ test/utils/ProtocolRewards.sol 532ms (unchanged)
158
+ test/utils/RewardTestHelpers.sol 89ms (unchanged)
159
+ test/utils/TrustedSenderTestHelper.sol 6ms (unchanged)
160
+ test/utils/V4TestSetup.sol 452ms (unchanged)
161
+ test/V4Liquidity.t.sol 149ms (unchanged)
162
+ test/ZoraHookRegistry.t.sol 246ms (unchanged)
151
163
  CLI Building entry: package/index.ts
152
164
  CLI Using tsconfig: tsconfig.json
153
- CLI tsup v8.4.0
165
+ CLI tsup v8.5.1
154
166
  CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins/tsup.config.ts
155
167
  CLI Target: es2021
156
168
  CLI Cleaning output folder
157
169
  CJS Build start
158
170
  ESM Build start
159
- ESM dist/index.js 163.80 KB
160
- ESM dist/index.js.map 289.89 KB
161
- ESM ⚡️ Build success in 91ms
162
- CJS dist/index.cjs 165.21 KB
163
- CJS dist/index.cjs.map 290.04 KB
164
- CJS ⚡️ Build success in 92ms
171
+ ESM dist/index.js 186.86 KB
172
+ ESM dist/index.js.map 331.50 KB
173
+ ESM ⚡️ Build success in 96ms
174
+ CJS dist/index.cjs 188.36 KB
175
+ CJS dist/index.cjs.map 331.66 KB
176
+ CJS ⚡️ Build success in 96ms
package/CHANGELOG.md CHANGED
@@ -1,11 +1,30 @@
1
1
  # @zoralabs/coins
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 50134ebc: Add TrendCoin support
8
+ - New `TrendCoin` contract: 100% supply in liquidity pool, 0% swap fees
9
+ - `deployTrendCoin` factory method with ticker uniqueness enforcement and post-deploy hook support
10
+ - Owner-configurable pool parameters via `setTrendCoinPoolConfig()`
11
+ - Metadata manager role for updatable contract URIs
12
+ - Ticker validation and URI encoding for trend coin symbols
13
+
14
+ ## 2.5.1
15
+
16
+ ### Patch Changes
17
+
18
+ - 78dffbdc: Including uniswap v4 errors in lob and swap router abis, and including some uniswap v4 contracts and abis.
19
+ - 1ccca8ef: Fix swap fee distribution when price limits cause partial execution
20
+
21
+ When swapping large fee amounts, swaps can hit sqrtPriceLimit and only partially execute, leaving unsettled currency deltas. The hook now checks all currencies in the payout swap path (both the input currency and all intermediates) and takes/distributes any positive deltas as rewards. This ensures all collected fees are properly distributed even when swaps don't fully execute due to price constraints.
22
+
3
23
  ## 2.5.0
4
24
 
5
25
  ### Minor Changes
6
26
 
7
27
  - 816ceb35: Add launch fee: time-based dynamic fee that decays from 99% to 1% over 10 seconds after coin creation
8
-
9
28
  - New coins record creation timestamp and expose it via `IHasCreationInfo` interface
10
29
  - Hook calculates dynamic fee based on elapsed time since creation
11
30
  - Initial supply purchase bypasses the fee via transient storage flag
@@ -40,7 +59,6 @@
40
59
  Previously, the `burnPositions()` function was incorrectly adding `feesAccrued` to `callerDelta` when recording burned position amounts. Since `callerDelta` already includes accrued fees, this caused fees to be double-counted. This resulted in inflated token amounts being recorded in `BurnedPosition` structs, which could lead to `ERC20InsufficientBalance` errors when attempting to mint positions on a new hook during migration.
41
60
 
42
61
  The fix:
43
-
44
62
  - Use only `callerDelta` values directly without adding `feesAccrued`
45
63
  - Add defensive balance checking in `mintPositions()` to cap liquidity at available token amounts
46
64
  - Prevents migration failures from any remaining rounding discrepancies between burn and mint operations
@@ -60,7 +78,6 @@
60
78
  ### Minor Changes
61
79
 
62
80
  - 7df94915: Enable buying initial supply when deploying creator coin and refactor factory internals
63
-
64
81
  - Add new `deployCreatorCoin` overload with `postDeployHook` parameter that supports ETH transfers
65
82
  - Refactored internal factory implementation to share more code between deployment methods
66
83
  - Enables buying initial supply during creator coin deployment via post-deploy hooks
@@ -70,7 +87,6 @@
70
87
  - 6a7e2b7b: Fix LP position duplication when deploying coins. If two positions are created with the same tick ranges, they are merged and stored as one position. This reduces gas costs during swapping as there are less LP positions to iterate through when collecting fees.
71
88
  - 5093c5ef: Add bounds checking to prevent risky forced downcasting of currency deltas
72
89
  - 9c6d241a: Fix ETH transfer failures in reward distribution when platform referrers cannot accept ETH
73
-
74
90
  - Prevent swaps from reverting when platform referrers cannot accept ETH - in this case, the rewards are redirected to the protocol recipient as backup.
75
91
  - Ensures coin functionality remains intact even with ETH-incompatible platform referrers
76
92
 
@@ -79,12 +95,10 @@
79
95
  Consolidates multiple hook contracts into a single unified hook for simplified architecture and better maintainability.
80
96
 
81
97
  - d3808d55: Adjust creator coin vesting duration to account for leap years
82
-
83
98
  - Changed CREATOR*VESTING_DURATION from 5 * 365 days to 5 \_ 365.25 days
84
99
  - Addresses Cantina audit finding about 1.25 day shortfall in 5-year vesting period
85
100
 
86
101
  - b571fe54: Consolidate and clarify coin constants
87
-
88
102
  - Renamed `CREATOR_LAUNCH_REWARD` to `CONTENT_COIN_INITIAL_CREATOR_SUPPLY` for clarity
89
103
  - Renamed `CREATOR_VESTING_SUPPLY` to `CREATOR_COIN_CREATOR_VESTING_SUPPLY` for consistency
90
104
  - Removed redundant `POOL_LAUNCH_SUPPLY` constant (use `CONTENT_COIN_MARKET_SUPPLY` instead)
@@ -111,7 +125,6 @@
111
125
  - adf98059: Adds platform referral and trade referral functionality to creator coins, and unifies the fee structure between content and creator coins with a simplified 1% total fee.
112
126
 
113
127
  ## New Features:
114
-
115
128
  - Platform referral and trade referral functionality for creator coins (previously only supported on content coins)
116
129
  - Unified fee structure: Both content and creator coins use identical 1% fee distribution
117
130
 
@@ -140,11 +153,9 @@
140
153
  | LP Rewards | 33.33% | 20% |
141
154
 
142
155
  **Implementation Changes:**
143
-
144
156
  - Consolidated reward logic into `CoinRewardsV4.distributeMarketRewards()`
145
157
 
146
158
  **Backwards Compatibility:**
147
-
148
159
  - Existing `CreatorCoinRewards` event is still emitted for backwards compatibility when rewards are distributed for a CreatorCoin
149
160
  - Additionally, when market rewards are distributed for a CreatorCoin, the same `CoinMarketRewardsV4` event that is already emitted for ContentCoins is now also emitted
150
161
 
@@ -167,7 +178,6 @@
167
178
  - dac72691: Remove Uniswap V3 support and refactor coin architecture
168
179
 
169
180
  **Removal of V3 Support:**
170
-
171
181
  - Removed support for creating coins based on Uniswap V3 - only V4 coins are supported
172
182
  - Default coin deployment now creates Uniswap V4 coins when no config is provided (previously created V3)
173
183
  - Removed V3-specific test files and utilities
@@ -176,7 +186,6 @@
176
186
  - Added revert logic for V3 deployment attempts in factory deploy functions
177
187
 
178
188
  **Architecture Refactoring:**
179
-
180
189
  - Merged BaseCoinV4 functionality into BaseCoin.sol to consolidate Uniswap V4 integration
181
190
  - Combined ICoinV4 interface with ICoin interface to simplify the interface hierarchy
182
191
  - Updated ContentCoin and CreatorCoin to inherit directly from BaseCoin
@@ -197,7 +206,6 @@
197
206
  This change updates the factory contract to use Ownable2StepUpgradeable instead of OwnableUpgradeable. The change maintains storage slot compatibility while adding the two-step ownership transfer pattern for enhanced security.
198
207
 
199
208
  Key changes:
200
-
201
209
  - ZoraFactoryImpl now inherits from Ownable2StepUpgradeable
202
210
  - Adds pendingOwner() function
203
211
  - Requires acceptOwnership() call to complete ownership transfers
@@ -250,7 +258,6 @@
250
258
  - 73e95f69: Upgraded coins to use Uniswap V4:
251
259
 
252
260
  **New CoinV4 Implementation:**
253
-
254
261
  - Migrated from Uniswap V3 to Uniswap V4, with logic moved into a hook.
255
262
  - Automatic LP fee collection and multi-hop reward distribution on every swap
256
263
  - New `ZoraV4CoinHook` handles afterSwap operations
@@ -258,25 +265,21 @@
258
265
  - Multi-hop fee swapping through intermediate currencies (e.g., ContentCoin → BackingCoin → Zora)
259
266
 
260
267
  **Factory Updates:**
261
-
262
268
  - Updated `deploy()` function signature with new `poolConfig`, `message`, and `salt` parameters
263
269
  - Automatic V3/V4 version selection based on pool configuration
264
270
  - Deterministic coin deployment with salt support
265
271
  - New `CoinCreatedV4` event for V4 coin deployments
266
272
 
267
273
  **Reward System Changes:**
268
-
269
274
  - Increased trade referral rewards from 10% to 15% (1500 basis points)
270
275
  - Automatic reward distribution in single backing currency
271
276
 
272
277
  **New Interfaces and Events:**
273
-
274
278
  - Added `IHasPoolKey` and `IHasSwapPath` interfaces for V4 functionality
275
279
  - New `Swapped` event with detailed swap and price information
276
280
  - New `CoinMarketRewardsV4` event for reward distribution tracking
277
281
 
278
282
  **Breaking Changes:**
279
-
280
283
  - New deterministic factory deploy function with salt
281
284
 
282
285
  ### Patch Changes
@@ -1738,6 +1738,11 @@
1738
1738
  }
1739
1739
  ]
1740
1740
  },
1741
+ {
1742
+ "type": "error",
1743
+ "name": "InvalidCurrency",
1744
+ "inputs": []
1745
+ },
1741
1746
  {
1742
1747
  "type": "error",
1743
1748
  "name": "InvalidCurrencyLowerTick",
@@ -1764,6 +1764,11 @@
1764
1764
  }
1765
1765
  ]
1766
1766
  },
1767
+ {
1768
+ "type": "error",
1769
+ "name": "InvalidCurrency",
1770
+ "inputs": []
1771
+ },
1767
1772
  {
1768
1773
  "type": "error",
1769
1774
  "name": "InvalidCurrencyLowerTick",
package/abis/ICoin.json CHANGED
@@ -968,6 +968,11 @@
968
968
  "name": "InsufficientLiquidity",
969
969
  "inputs": []
970
970
  },
971
+ {
972
+ "type": "error",
973
+ "name": "InvalidCurrency",
974
+ "inputs": []
975
+ },
971
976
  {
972
977
  "type": "error",
973
978
  "name": "InvalidCurrencyLowerTick",
package/abis/ICoinV3.json CHANGED
@@ -1225,6 +1225,11 @@
1225
1225
  "name": "InsufficientLiquidity",
1226
1226
  "inputs": []
1227
1227
  },
1228
+ {
1229
+ "type": "error",
1230
+ "name": "InvalidCurrency",
1231
+ "inputs": []
1232
+ },
1228
1233
  {
1229
1234
  "type": "error",
1230
1235
  "name": "InvalidCurrencyLowerTick",
@@ -0,0 +1,130 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "initializeTrendCoin",
5
+ "inputs": [
6
+ {
7
+ "name": "owners_",
8
+ "type": "address[]",
9
+ "internalType": "address[]"
10
+ },
11
+ {
12
+ "name": "symbol_",
13
+ "type": "string",
14
+ "internalType": "string"
15
+ },
16
+ {
17
+ "name": "poolKey_",
18
+ "type": "tuple",
19
+ "internalType": "struct PoolKey",
20
+ "components": [
21
+ {
22
+ "name": "currency0",
23
+ "type": "address",
24
+ "internalType": "Currency"
25
+ },
26
+ {
27
+ "name": "currency1",
28
+ "type": "address",
29
+ "internalType": "Currency"
30
+ },
31
+ {
32
+ "name": "fee",
33
+ "type": "uint24",
34
+ "internalType": "uint24"
35
+ },
36
+ {
37
+ "name": "tickSpacing",
38
+ "type": "int24",
39
+ "internalType": "int24"
40
+ },
41
+ {
42
+ "name": "hooks",
43
+ "type": "address",
44
+ "internalType": "contract IHooks"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "name": "sqrtPriceX96",
50
+ "type": "uint160",
51
+ "internalType": "uint160"
52
+ },
53
+ {
54
+ "name": "poolConfiguration_",
55
+ "type": "tuple",
56
+ "internalType": "struct PoolConfiguration",
57
+ "components": [
58
+ {
59
+ "name": "version",
60
+ "type": "uint8",
61
+ "internalType": "uint8"
62
+ },
63
+ {
64
+ "name": "numPositions",
65
+ "type": "uint16",
66
+ "internalType": "uint16"
67
+ },
68
+ {
69
+ "name": "fee",
70
+ "type": "uint24",
71
+ "internalType": "uint24"
72
+ },
73
+ {
74
+ "name": "tickSpacing",
75
+ "type": "int24",
76
+ "internalType": "int24"
77
+ },
78
+ {
79
+ "name": "numDiscoveryPositions",
80
+ "type": "uint16[]",
81
+ "internalType": "uint16[]"
82
+ },
83
+ {
84
+ "name": "tickLower",
85
+ "type": "int24[]",
86
+ "internalType": "int24[]"
87
+ },
88
+ {
89
+ "name": "tickUpper",
90
+ "type": "int24[]",
91
+ "internalType": "int24[]"
92
+ },
93
+ {
94
+ "name": "maxDiscoverySupplyShare",
95
+ "type": "uint256[]",
96
+ "internalType": "uint256[]"
97
+ }
98
+ ]
99
+ }
100
+ ],
101
+ "outputs": [],
102
+ "stateMutability": "nonpayable"
103
+ },
104
+ {
105
+ "type": "error",
106
+ "name": "InvalidTickerCharacters",
107
+ "inputs": []
108
+ },
109
+ {
110
+ "type": "error",
111
+ "name": "OnlyMetadataManager",
112
+ "inputs": []
113
+ },
114
+ {
115
+ "type": "error",
116
+ "name": "TickerAlreadyUsed",
117
+ "inputs": [
118
+ {
119
+ "name": "symbol",
120
+ "type": "string",
121
+ "internalType": "string"
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ "type": "error",
127
+ "name": "UseSpecificTrendCoinInitialize",
128
+ "inputs": []
129
+ }
130
+ ]