@zoralabs/coins 2.0.0 → 2.1.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.
- package/.turbo/turbo-build.log +106 -110
- package/CHANGELOG.md +28 -0
- package/README.md +30 -109
- package/abis/BaseCoin.json +442 -0
- package/abis/CoinTest.json +3 -246
- package/abis/FactoryTest.json +5 -137
- package/abis/HooksTest.json +0 -26
- package/abis/ICoin.json +378 -0
- package/abis/ICoinV3.json +378 -0
- package/abis/IZoraFactory.json +0 -18
- package/abis/LiquidityMigrationTest.json +101 -0
- package/abis/MockBadFactory.json +15 -0
- package/abis/ZoraFactoryImpl.json +1 -67
- package/dist/index.cjs +236 -265
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +235 -264
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +389 -493
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/wagmiGenerated.ts +240 -269
- package/package.json +3 -3
- package/script/DeployPostDeploymentHooks.s.sol +2 -2
- package/script/TestBackingCoinSwap.s.sol +8 -8
- package/script/TestV4Swap.s.sol +8 -8
- package/script/UpgradeFactoryImpl.s.sol +0 -1
- package/src/BaseCoin.sol +109 -6
- package/src/ContentCoin.sol +4 -4
- package/src/CreatorCoin.sol +5 -5
- package/src/ZoraFactoryImpl.sol +10 -93
- package/src/deployment/CoinsDeployerBase.sol +10 -27
- package/src/hooks/BaseZoraV4CoinHook.sol +5 -5
- package/src/hooks/deployment/BuySupplyWithSwapRouterHook.sol +4 -5
- package/src/interfaces/ICoin.sol +67 -1
- package/src/interfaces/ICreatorCoin.sol +2 -2
- package/src/interfaces/IZoraFactory.sol +0 -5
- package/src/libs/CoinConfigurationVersions.sol +1 -39
- package/src/libs/CoinRewardsV4.sol +2 -2
- package/src/libs/CoinSetup.sol +1 -4
- package/src/libs/UniV4SwapHelper.sol +1 -1
- package/src/libs/UniV4SwapToCurrency.sol +2 -2
- package/src/libs/V4Liquidity.sol +1 -1
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/Coin.t.sol +112 -535
- package/test/CoinUniV4.t.sol +5 -5
- package/test/DeploymentHooks.t.sol +5 -102
- package/test/Factory.t.sol +23 -306
- package/test/LiquidityMigration.t.sol +160 -2
- package/test/MultiOwnable.t.sol +36 -36
- package/test/Upgrades.t.sol +16 -35
- package/test/utils/BaseTest.sol +16 -69
- package/test/utils/FeeEstimatorHook.sol +3 -3
- package/wagmi.config.ts +1 -1
- package/abis/BaseCoinV4.json +0 -1840
- package/abis/Coin.json +0 -1912
- package/abis/DopplerUniswapV3Test.json +0 -800
- package/abis/ICoinV4.json +0 -1048
- package/abis/Simulate.json +0 -29
- package/abis/UniV3BuySell.json +0 -12
- package/abis/UniV3Errors.json +0 -32
- package/script/Simulate.s.sol +0 -59
- package/src/BaseCoinV4.sol +0 -143
- package/src/Coin.sol +0 -236
- package/src/interfaces/ICoinV4.sol +0 -74
- package/src/libs/CoinDopplerUniV3.sol +0 -50
- package/src/libs/CoinRewards.sol +0 -201
- package/src/libs/CoinSetupV3.sol +0 -50
- package/src/libs/UniV3BuySell.sol +0 -231
- package/src/libs/UniV3Errors.sol +0 -11
- package/test/CoinDopplerUniV3.t.sol +0 -310
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
|
|
2
|
-
> @zoralabs/coins@2.
|
|
2
|
+
> @zoralabs/coins@2.1.0 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.
|
|
6
|
+
> @zoralabs/coins@2.1.0 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
|
-
Compiling
|
|
10
|
-
Solc 0.8.28 finished in
|
|
9
|
+
Compiling 236 files with Solc 0.8.28
|
|
10
|
+
Solc 0.8.28 finished in 186.86s
|
|
11
11
|
Compiler run successful with warnings:
|
|
12
12
|
Warning (3420): Source file does not specify required compiler version! Consider adding "pragma solidity ^0.8.28;"
|
|
13
13
|
--> src/BaseCoin.sol
|
|
14
14
|
|
|
15
15
|
Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
|
16
|
-
--> src/
|
|
16
|
+
--> src/ZoraFactoryImpl.sol:214:9:
|
|
17
17
|
|
|
|
18
|
-
|
|
18
|
+
214 | uint256 orderSize
|
|
19
|
+
| ^^^^^^^^^^^^^^^^^
|
|
20
|
+
|
|
21
|
+
Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
|
22
|
+
--> src/deployment/CoinsDeployerBase.sol:104:31:
|
|
23
|
+
|
|
|
24
|
+
104 | function deployCoinV4Impl(address zoraV4CoinHook) internal returns (ContentCoin) {
|
|
19
25
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
20
26
|
|
|
21
27
|
Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
|
22
|
-
--> src/deployment/CoinsDeployerBase.sol:
|
|
28
|
+
--> src/deployment/CoinsDeployerBase.sol:114:36:
|
|
23
29
|
|
|
|
24
|
-
|
|
30
|
+
114 | function deployCreatorCoinImpl(address creatorCoinHook) internal returns (CreatorCoin) {
|
|
25
31
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
26
32
|
|
|
27
33
|
Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
|
28
|
-
--> src/deployment/CoinsDeployerBase.sol:
|
|
34
|
+
--> src/deployment/CoinsDeployerBase.sol:273:84:
|
|
29
35
|
|
|
|
30
|
-
|
|
36
|
+
273 | function deployDevFactory(CoinsDeployment memory deployment) internal returns (ZoraFactory devFactory) {
|
|
31
37
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
32
38
|
|
|
33
39
|
Warning (2072): Unused local variable.
|
|
@@ -49,15 +55,15 @@ Warning (2072): Unused local variable.
|
|
|
49
55
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
50
56
|
|
|
51
57
|
Warning (2072): Unused local variable.
|
|
52
|
-
--> test/LiquidityMigration.t.sol:
|
|
58
|
+
--> test/LiquidityMigration.t.sol:188:9:
|
|
53
59
|
|
|
|
54
|
-
|
|
60
|
+
188 | address originalHook = address(contentCoinHook);
|
|
55
61
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
56
62
|
|
|
57
63
|
Warning (2072): Unused local variable.
|
|
58
|
-
--> test/LiquidityMigration.t.sol:
|
|
64
|
+
--> test/LiquidityMigration.t.sol:210:9:
|
|
59
65
|
|
|
|
60
|
-
|
|
66
|
+
210 | PoolKey memory poolKey = coinV4.getPoolKey();
|
|
61
67
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
62
68
|
|
|
63
69
|
[33m-[39m Validating plugins
|
|
@@ -73,123 +79,113 @@ Warning (2072): Unused local variable.
|
|
|
73
79
|
✅ Updated ./package/wagmiGenerated.ts (10 replacements)
|
|
74
80
|
✨ All files processed successfully!
|
|
75
81
|
|
|
76
|
-
> @zoralabs/coins@2.
|
|
82
|
+
> @zoralabs/coins@2.1.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
|
|
77
83
|
> pnpm exec bundle-abis
|
|
78
84
|
|
|
79
85
|
|
|
80
|
-
> @zoralabs/coins@2.
|
|
86
|
+
> @zoralabs/coins@2.1.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
|
|
81
87
|
> prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
|
|
82
88
|
|
|
83
|
-
src/BaseCoin.sol
|
|
84
|
-
src/
|
|
85
|
-
src/
|
|
86
|
-
src/
|
|
87
|
-
src/
|
|
88
|
-
src/
|
|
89
|
-
src/hooks/
|
|
90
|
-
src/hooks/
|
|
91
|
-
src/hooks/
|
|
92
|
-
src/hooks/
|
|
93
|
-
src/
|
|
94
|
-
src/hooks/HookUpgradeGate.sol 23ms (unchanged)
|
|
95
|
-
src/interfaces/IAirlock.sol 2ms (unchanged)
|
|
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)
|
|
94
|
+
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)
|
|
99
|
+
src/interfaces/IAirlock.sol 1ms (unchanged)
|
|
96
100
|
src/interfaces/ICoin.sol 13ms (unchanged)
|
|
97
|
-
src/interfaces/ICoinComments.sol
|
|
101
|
+
src/interfaces/ICoinComments.sol 1ms (unchanged)
|
|
98
102
|
src/interfaces/ICoinDeployHook.sol 1ms (unchanged)
|
|
99
103
|
src/interfaces/ICoinV3.sol 3ms (unchanged)
|
|
100
|
-
src/interfaces/
|
|
101
|
-
src/interfaces/
|
|
102
|
-
src/interfaces/ICreatorCoinHook.sol 1ms (unchanged)
|
|
104
|
+
src/interfaces/ICreatorCoin.sol 2ms (unchanged)
|
|
105
|
+
src/interfaces/ICreatorCoinHook.sol 2ms (unchanged)
|
|
103
106
|
src/interfaces/IDeployedCoinVersionLookup.sol 1ms (unchanged)
|
|
104
|
-
src/interfaces/IDopplerErrors.sol
|
|
105
|
-
src/interfaces/IERC7572.sol
|
|
107
|
+
src/interfaces/IDopplerErrors.sol 1ms (unchanged)
|
|
108
|
+
src/interfaces/IERC7572.sol 0ms (unchanged)
|
|
106
109
|
src/interfaces/IHasRewardsRecipients.sol 1ms (unchanged)
|
|
107
|
-
src/interfaces/IHooksUpgradeGate.sol
|
|
110
|
+
src/interfaces/IHooksUpgradeGate.sol 1ms (unchanged)
|
|
108
111
|
src/interfaces/IMsgSender.sol 1ms (unchanged)
|
|
109
|
-
src/interfaces/INonfungiblePositionManager.sol
|
|
112
|
+
src/interfaces/INonfungiblePositionManager.sol 4ms (unchanged)
|
|
110
113
|
src/interfaces/IPoolConfigEncoding.sol 2ms (unchanged)
|
|
111
|
-
src/interfaces/IProtocolRewards.sol
|
|
114
|
+
src/interfaces/IProtocolRewards.sol 2ms (unchanged)
|
|
112
115
|
src/interfaces/ISwapPathRouter.sol 1ms (unchanged)
|
|
113
|
-
src/interfaces/ISwapRouter.sol
|
|
114
|
-
src/interfaces/IUniswapV3Factory.sol
|
|
116
|
+
src/interfaces/ISwapRouter.sol 1ms (unchanged)
|
|
117
|
+
src/interfaces/IUniswapV3Factory.sol 5ms (unchanged)
|
|
115
118
|
src/interfaces/IUniswapV3Pool.sol 3ms (unchanged)
|
|
116
|
-
src/interfaces/IUniswapV3SwapCallback.sol
|
|
119
|
+
src/interfaces/IUniswapV3SwapCallback.sol 1ms (unchanged)
|
|
117
120
|
src/interfaces/IUpgradeableV4Hook.sol 2ms (unchanged)
|
|
118
|
-
src/interfaces/IWETH.sol
|
|
119
|
-
src/interfaces/IZoraFactory.sol
|
|
120
|
-
src/interfaces/IZoraV4CoinHook.sol
|
|
121
|
-
src/libs/CoinCommon.sol
|
|
122
|
-
src/libs/CoinConfigurationVersions.sol
|
|
123
|
-
src/libs/CoinConstants.sol
|
|
124
|
-
src/libs/CoinDopplerMultiCurve.sol
|
|
125
|
-
src/libs/
|
|
126
|
-
src/libs/
|
|
127
|
-
src/libs/CoinRewardsV4.sol 102ms (unchanged)
|
|
128
|
-
src/libs/CoinSetup.sol 23ms (unchanged)
|
|
129
|
-
src/libs/CoinSetupV3.sol 14ms (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
130
|
src/libs/CreatorCoinConstants.sol 2ms (unchanged)
|
|
131
|
-
src/libs/CreatorCoinRewards.sol
|
|
131
|
+
src/libs/CreatorCoinRewards.sol 18ms (unchanged)
|
|
132
132
|
src/libs/DopplerMath.sol 88ms (unchanged)
|
|
133
|
-
src/libs/HooksDeployment.sol
|
|
133
|
+
src/libs/HooksDeployment.sol 79ms (unchanged)
|
|
134
134
|
src/libs/MarketConstants.sol 2ms (unchanged)
|
|
135
|
-
src/libs/PoolStateReader.sol
|
|
136
|
-
src/libs/
|
|
137
|
-
src/libs/
|
|
138
|
-
src/libs/
|
|
139
|
-
src/
|
|
140
|
-
src/libs/V4Liquidity.sol 136ms (unchanged)
|
|
141
|
-
src/proxy/ZoraFactory.sol 7ms (unchanged)
|
|
135
|
+
src/libs/PoolStateReader.sol 6ms (unchanged)
|
|
136
|
+
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)
|
|
142
140
|
src/types/LpPosition.sol 1ms (unchanged)
|
|
143
|
-
src/types/PoolConfiguration.sol
|
|
141
|
+
src/types/PoolConfiguration.sol 3ms (unchanged)
|
|
144
142
|
src/types/PoolState.sol 1ms (unchanged)
|
|
145
|
-
src/utils/AutoSwapper.sol
|
|
143
|
+
src/utils/AutoSwapper.sol 20ms (unchanged)
|
|
146
144
|
src/utils/DeployedCoinVersionLookup.sol 4ms (unchanged)
|
|
147
|
-
src/utils/MultiOwnable.sol
|
|
148
|
-
src/utils/uniswap/BitMath.sol
|
|
149
|
-
src/utils/uniswap/BytesLib.sol
|
|
150
|
-
src/utils/uniswap/CustomRevert.sol
|
|
151
|
-
src/utils/uniswap/FixedPoint96.sol
|
|
152
|
-
src/utils/uniswap/FullMath.sol
|
|
153
|
-
src/utils/uniswap/LiquidityAmounts.sol
|
|
145
|
+
src/utils/MultiOwnable.sol 45ms (unchanged)
|
|
146
|
+
src/utils/uniswap/BitMath.sol 10ms (unchanged)
|
|
147
|
+
src/utils/uniswap/BytesLib.sol 17ms (unchanged)
|
|
148
|
+
src/utils/uniswap/CustomRevert.sol 41ms (unchanged)
|
|
149
|
+
src/utils/uniswap/FixedPoint96.sol 1ms (unchanged)
|
|
150
|
+
src/utils/uniswap/FullMath.sol 20ms (unchanged)
|
|
151
|
+
src/utils/uniswap/LiquidityAmounts.sol 46ms (unchanged)
|
|
154
152
|
src/utils/uniswap/Path.sol 5ms (unchanged)
|
|
155
153
|
src/utils/uniswap/SafeCast.sol 11ms (unchanged)
|
|
156
|
-
src/utils/uniswap/SqrtPriceMath.sol
|
|
157
|
-
src/utils/uniswap/TickMath.sol
|
|
154
|
+
src/utils/uniswap/SqrtPriceMath.sol 64ms (unchanged)
|
|
155
|
+
src/utils/uniswap/TickMath.sol 68ms (unchanged)
|
|
158
156
|
src/utils/uniswap/UnsafeMath.sol 2ms (unchanged)
|
|
159
157
|
src/version/ContractVersionBase.sol 1ms (unchanged)
|
|
160
|
-
src/ZoraFactoryImpl.sol
|
|
161
|
-
test/AutoSwapper.t.sol
|
|
162
|
-
test/Coin.t.sol
|
|
163
|
-
test/
|
|
164
|
-
test/
|
|
165
|
-
test/
|
|
166
|
-
test/
|
|
167
|
-
test/
|
|
168
|
-
test/
|
|
169
|
-
test/
|
|
170
|
-
test/
|
|
171
|
-
test/
|
|
172
|
-
test/
|
|
173
|
-
test/utils/
|
|
174
|
-
test/utils/
|
|
175
|
-
test/utils/
|
|
176
|
-
test/utils/
|
|
177
|
-
test/utils/
|
|
178
|
-
test/utils/ProxyShim.sol 3ms (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)
|
|
179
176
|
script/Deploy.s.sol 3ms (unchanged)
|
|
180
|
-
script/DeployAutoSwapper.s.sol
|
|
181
|
-
script/DeployDevFactory.s.sol
|
|
182
|
-
script/DeployPostDeploymentHooks.s.sol
|
|
183
|
-
script/DeployUpgradeGate.s.sol
|
|
184
|
-
script/GenerateDeterministicParams.s.sol
|
|
185
|
-
script/PrintRegisterUpgradePath.s.sol
|
|
177
|
+
script/DeployAutoSwapper.s.sol 13ms (unchanged)
|
|
178
|
+
script/DeployDevFactory.s.sol 3ms (unchanged)
|
|
179
|
+
script/DeployPostDeploymentHooks.s.sol 2ms (unchanged)
|
|
180
|
+
script/DeployUpgradeGate.s.sol 3ms (unchanged)
|
|
181
|
+
script/GenerateDeterministicParams.s.sol 12ms (unchanged)
|
|
182
|
+
script/PrintRegisterUpgradePath.s.sol 9ms (unchanged)
|
|
186
183
|
script/PrintUpgradeCommand.s.sol 2ms (unchanged)
|
|
187
|
-
script/
|
|
188
|
-
script/
|
|
189
|
-
script/
|
|
190
|
-
script/
|
|
191
|
-
script/
|
|
192
|
-
script/UpgradeHooks.s.sol 4ms (unchanged)
|
|
184
|
+
script/TestBackingCoinSwap.s.sol 31ms (unchanged)
|
|
185
|
+
script/TestV4Swap.s.sol 30ms (unchanged)
|
|
186
|
+
script/UpgradeCoinImpl.sol 5ms (unchanged)
|
|
187
|
+
script/UpgradeFactoryImpl.s.sol 5ms (unchanged)
|
|
188
|
+
script/UpgradeHooks.s.sol 6ms (unchanged)
|
|
193
189
|
[34mCLI[39m Building entry: package/index.ts
|
|
194
190
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
195
191
|
[34mCLI[39m tsup v8.4.0
|
|
@@ -198,9 +194,9 @@ script/UpgradeHooks.s.sol 4ms (unchanged)
|
|
|
198
194
|
[34mCLI[39m Cleaning output folder
|
|
199
195
|
[34mCJS[39m Build start
|
|
200
196
|
[34mESM[39m Build start
|
|
201
|
-
[
|
|
202
|
-
[
|
|
203
|
-
[
|
|
204
|
-
[
|
|
205
|
-
[
|
|
206
|
-
[
|
|
197
|
+
[32mESM[39m [1mdist/index.js [22m[32m128.58 KB[39m
|
|
198
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m229.86 KB[39m
|
|
199
|
+
[32mESM[39m ⚡️ Build success in 44ms
|
|
200
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m130.00 KB[39m
|
|
201
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m230.01 KB[39m
|
|
202
|
+
[32mCJS[39m ⚡️ Build success in 44ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @zoralabs/coins
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- dac72691: Remove Uniswap V3 support and refactor coin architecture
|
|
8
|
+
|
|
9
|
+
**Removal of V3 Support:**
|
|
10
|
+
|
|
11
|
+
- Removed support for creating coins based on Uniswap V3 - only V4 coins are supported
|
|
12
|
+
- Default coin deployment now creates Uniswap V4 coins when no config is provided (previously created V3)
|
|
13
|
+
- Removed V3-specific test files and utilities
|
|
14
|
+
- Updated remaining tests to use V4 deployment methods
|
|
15
|
+
- Removed V3 configuration functions and encoders
|
|
16
|
+
- Added revert logic for V3 deployment attempts in factory deploy functions
|
|
17
|
+
|
|
18
|
+
**Architecture Refactoring:**
|
|
19
|
+
|
|
20
|
+
- Merged BaseCoinV4 functionality into BaseCoin.sol to consolidate Uniswap V4 integration
|
|
21
|
+
- Combined ICoinV4 interface with ICoin interface to simplify the interface hierarchy
|
|
22
|
+
- Updated ContentCoin and CreatorCoin to inherit directly from BaseCoin
|
|
23
|
+
- Removed duplicate files: BaseCoinV4.sol and ICoinV4.sol
|
|
24
|
+
- Updated all imports and references throughout the codebase
|
|
25
|
+
- This is an internal refactoring that doesn't change external functionality
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- deb9175b: Enforce 32 bytes for decoding trade referral address from hook data
|
|
30
|
+
|
|
3
31
|
## 2.0.0
|
|
4
32
|
|
|
5
33
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -2,131 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
A protocol for creating and trading creator and content coins with automatic rewards distribution on top of Uniswap V4 hooks.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 📖 Documentation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
For comprehensive documentation including architecture details, contract specifications, and usage guides, visit:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**[Coins Documentation](https://docs.zora.co/docs/coins)**
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Quick Start
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
This package contains the core smart contracts for the Zora Coins protocol. For end-user guides and detailed explanations, see the documentation link above.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- **Multi-ownership**: Support for multiple owners
|
|
17
|
-
- **Reward Distribution**: Distributes rewards on swaps
|
|
18
|
-
- **Comment System**: Support for on-chain comments via `ICoinComments`
|
|
15
|
+
### Development Setup
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
1. **Install dependencies**:
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
```bash
|
|
20
|
+
pnpm install
|
|
21
|
+
```
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
- **Pool Configuration**: Flexible pool setup with custom parameters
|
|
26
|
-
- **Hook System**: Customizable hooks for advanced trading logic
|
|
27
|
-
- **Swap Path Management**: Support for multi-hop swaps through `IHasSwapPath`
|
|
28
|
-
- **Liquidity Migration**: Ability to migrate liquidity between hook implementations
|
|
23
|
+
2. **Environment setup**:
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
```bash
|
|
26
|
+
cp .env.example .env
|
|
27
|
+
# Edit .env with your configuration
|
|
28
|
+
```
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
3. **Build contracts**:
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
```bash
|
|
33
|
+
forge build
|
|
34
|
+
```
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
4. **Run tests**:
|
|
37
|
+
```bash
|
|
38
|
+
forge test -vvv
|
|
39
|
+
```
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
### Testing
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
- **Fixed Currency**: Always uses ZORA token as backing currency
|
|
44
|
-
- **Address**: `0x1111111111166b7FE7bd91427724B487980aFc69`
|
|
45
|
-
- **Network**: Base mainnet only (protocol is deployed exclusively on Base)
|
|
46
|
-
- **Supply**: 1 billion total supply (500M for market, 500M for creator vesting)
|
|
47
|
-
- **Single per Creator**: Each creator has exactly one CreatorCoin that backs their content coins
|
|
43
|
+
For individual packages:
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
- `forge test -vvv` - Run Solidity tests with verbose output
|
|
46
|
+
- `forge test --watch -vvv` - Run tests in watch mode
|
|
47
|
+
- `forge test -vvv --match-test {test_name}` - Run specific test
|
|
48
|
+
- `pnpm test` - Run JavaScript/TypeScript tests
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- **Uniswap V3 Integration**: Uses Uniswap V3 factory and swap router for trading
|
|
54
|
-
- **Concentrated Liquidity**: Manages multiple liquidity positions with custom ranges
|
|
55
|
-
- **Currency Flexibility**: Supports any ERC20 token as backing currency (not restricted to ZORA)
|
|
56
|
-
- **Position Management**: Maintains array of `LpPosition` structs for liquidity tracking
|
|
57
|
-
- **Market Rewards**: Distributes rewards from liquidity position fees
|
|
58
|
-
- **V3 vs V4 Differences**:
|
|
59
|
-
- V3 uses traditional swap router patterns vs V4's singleton pool manager
|
|
60
|
-
- V3 requires separate pool deployment vs V4's integrated pool creation
|
|
61
|
-
- V3 has manual liquidity position management vs V4's hook-based automation
|
|
62
|
-
- **Migration Path**: Existing V3 coins continue to operate but new deployments use V4
|
|
63
|
-
|
|
64
|
-
#### ZoraFactory (Proxy Contract)
|
|
65
|
-
|
|
66
|
-
The proxy contract that delegates to ZoraFactoryImpl using the ERC1967 proxy pattern:
|
|
67
|
-
|
|
68
|
-
- **ERC1967 Proxy**: Standard upgradeable proxy implementation from OpenZeppelin
|
|
69
|
-
- **Immutable Name**: Distinguished by immutable name field (`keccak256("ZoraFactory")`) for verification
|
|
70
|
-
- **Delegation Pattern**: All function calls are delegated to the implementation contract
|
|
71
|
-
- **Upgrade Safety**: Supports safe upgrades through the UUPS pattern in the implementation
|
|
72
|
-
- **Cross-Chain Consistency**: Deterministic deployment ensures same address across chains
|
|
73
|
-
- **Critical Initialization**: Must be initialized in the same transaction as deployment
|
|
74
|
-
- Proxy deployment and initialization are separate steps for address mining
|
|
75
|
-
- Failure to initialize leaves the factory in an unusable state
|
|
76
|
-
- **Verification**: Unique bytecode allows proper contract verification on block explorers
|
|
77
|
-
|
|
78
|
-
#### ZoraFactoryImpl
|
|
79
|
-
|
|
80
|
-
The main factory contract for deploying coins:
|
|
81
|
-
|
|
82
|
-
- **Deterministic Deployment**: Uses CREATE2 for predictable addresses when deploying coins
|
|
83
|
-
- **Version Management**: Supports multiple coin implementations
|
|
84
|
-
- **Hook Integration**: Automated hook deployment and configuration
|
|
85
|
-
- **Upgrade Support**: UUPS upgradeable pattern for factory improvements and bug fixes
|
|
86
|
-
|
|
87
|
-
#### HookUpgradeGate
|
|
88
|
-
|
|
89
|
-
Manages safe upgrade paths for V4 coin hooks with strict security controls:
|
|
90
|
-
|
|
91
|
-
- **Upgrade Path Registry**: Maintains `mapping(address => mapping(address => bool))` of allowed upgrades
|
|
92
|
-
- **Multi-Path Registration**: Single upgrade can be registered for multiple base implementations
|
|
93
|
-
- **Owner Control**: Uses Ownable2Step for secure ownership transfers with two-step process
|
|
94
|
-
- **Security Features**:
|
|
95
|
-
- Only owner can register or remove upgrade paths
|
|
96
|
-
- Prevents unauthorized hook upgrades that could compromise coins
|
|
97
|
-
- Whitelist approach ensures only vetted upgrades are allowed
|
|
98
|
-
- **Upgrade Process**:
|
|
99
|
-
1. Owner registers upgrade path via `registerUpgradePath()`
|
|
100
|
-
2. Coin creators can then upgrade their hooks using registered paths
|
|
101
|
-
3. Upgrades can be revoked by owner via `removeUpgradePath()`
|
|
102
|
-
- **Event Logging**: Emits `UpgradeRegistered` and `UpgradeRemoved` events for transparency
|
|
103
|
-
- **Use Cases**: Enables safe migration of coins to new hook implementations without breaking existing functionality
|
|
104
|
-
|
|
105
|
-
### Hook System
|
|
106
|
-
|
|
107
|
-
The protocol supports various hooks for customizing coin behavior:
|
|
108
|
-
|
|
109
|
-
#### BaseZoraV4CoinHook
|
|
110
|
-
|
|
111
|
-
Immutable base hook contract providing behavior that happens after swaps:
|
|
112
|
-
|
|
113
|
-
- **Deployment Hooks**: Integrates with coin deployment process for initialization
|
|
114
|
-
- **Trading Hooks**: Hooks into swap events for custom logic execution
|
|
115
|
-
- **Reward Distribution**: Manages reward distribution during trading activities
|
|
116
|
-
- **State Management**: Maintains hook-specific state across transactions
|
|
117
|
-
- **Content Validation**: Ensures proper coin -> liquidity association
|
|
118
|
-
- **Liquidity Migration**: Supports controlled liquidity migration by the creator to a new hook.
|
|
119
|
-
|
|
120
|
-
## Supply Distribution Summary
|
|
121
|
-
|
|
122
|
-
| Coin Type | Total Supply | Liquidity Pool | Creator Allocation | Vesting Period |
|
|
123
|
-
| --------------- | ------------- | -------------- | ------------------ | -------------- |
|
|
124
|
-
| **ContentCoin** | 1,000,000,000 | 990,000,000 | 10,000,000 | None |
|
|
125
|
-
| **CreatorCoin** | 1,000,000,000 | 500,000,000 | 500,000,000 | 5 years |
|
|
126
|
-
|
|
127
|
-
_All amounts are in tokens with 18 decimals_
|
|
128
|
-
|
|
129
|
-
## Deployment
|
|
50
|
+
### Deployment
|
|
130
51
|
|
|
131
52
|
The `ZoraFactory` contract is deployed deterministically using a turnkey account. The deployment process uses a helper contract, [DeterministicDeployerAndCaller](../../packages/shared-contracts/src/deployment/DeterministicDeployerAndCaller.sol).
|
|
132
53
|
|