@zoralabs/coins 1.1.1 → 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.
- package/.turbo/turbo-build.log +97 -93
- package/CHANGELOG.md +28 -0
- package/LICENSE +90 -21
- package/README.md +126 -0
- package/abis/BaseCoinV4.json +1840 -0
- package/abis/BaseZoraV4CoinHook.json +6 -2
- package/abis/CoinUniV4Test.json +20 -0
- package/abis/ContentCoinHook.json +6 -2
- package/abis/CreatorCoinHook.json +6 -2
- package/abis/FactoryTest.json +7 -0
- package/abis/FeeEstimatorHook.json +6 -2
- package/abis/IZoraV4CoinHook.json +2 -2
- package/abis/Ownable2StepUpgradeable.json +138 -0
- package/abis/ZoraFactoryImpl.json +39 -0
- package/addresses/8453.json +5 -5
- package/dist/index.cjs +36 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -2
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +32 -1
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/wagmiGenerated.ts +35 -2
- package/package.json +1 -1
- package/script/TestBackingCoinSwap.s.sol +1 -1
- package/script/TestV4Swap.s.sol +1 -1
- package/src/BaseCoin.sol +7 -2
- package/src/{CoinV4.sol → BaseCoinV4.sol} +15 -17
- package/src/Coin.sol +7 -1
- package/src/ContentCoin.sol +45 -0
- package/src/CreatorCoin.sol +14 -6
- package/src/ZoraFactoryImpl.sol +10 -4
- package/src/deployment/CoinsDeployerBase.sol +3 -3
- package/src/hooks/BaseZoraV4CoinHook.sol +10 -2
- package/src/hooks/ContentCoinHook.sol +7 -1
- package/src/hooks/CreatorCoinHook.sol +7 -1
- package/src/hooks/HookUpgradeGate.sol +7 -1
- package/src/interfaces/IZoraV4CoinHook.sol +1 -1
- package/src/libs/CoinCommon.sol +7 -1
- package/src/libs/CoinConfigurationVersions.sol +7 -1
- package/src/libs/CoinConstants.sol +7 -1
- package/src/libs/CoinDopplerMultiCurve.sol +7 -1
- package/src/libs/CoinRewards.sol +7 -1
- package/src/libs/CoinRewardsV4.sol +7 -1
- package/src/libs/CoinSetup.sol +7 -1
- package/src/libs/CreatorCoinConstants.sol +7 -1
- package/src/libs/CreatorCoinRewards.sol +7 -1
- package/src/libs/DopplerMath.sol +7 -1
- package/src/libs/HooksDeployment.sol +7 -1
- package/src/libs/PoolStateReader.sol +7 -1
- package/src/libs/UniV4SwapHelper.sol +7 -1
- package/src/libs/UniV4SwapToCurrency.sol +7 -1
- package/src/libs/V4Liquidity.sol +7 -1
- package/src/types/PoolConfiguration.sol +7 -1
- package/src/utils/AutoSwapper.sol +7 -1
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/CoinUniV4.t.sol +61 -5
- package/test/Factory.t.sol +41 -0
- package/test/Upgrades.t.sol +8 -8
- package/test/utils/BaseTest.sol +23 -15
- package/wagmi.config.ts +1 -1
- /package/abis/{CoinV4.json → ContentCoin.json} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
> @zoralabs/coins@
|
|
2
|
+
> @zoralabs/coins@2.0.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@
|
|
6
|
+
> @zoralabs/coins@2.0.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 246 files with Solc 0.8.28
|
|
10
|
+
Solc 0.8.28 finished in 226.34s
|
|
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
|
+
|
|
12
15
|
Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
|
13
16
|
--> src/deployment/CoinsDeployerBase.sol:117:31:
|
|
14
17
|
|
|
|
15
|
-
117 | function deployCoinV4Impl(address zoraV4CoinHook) internal returns (
|
|
18
|
+
117 | function deployCoinV4Impl(address zoraV4CoinHook) internal returns (ContentCoin) {
|
|
16
19
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
17
20
|
|
|
18
21
|
Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
|
@@ -70,122 +73,123 @@ Warning (2072): Unused local variable.
|
|
|
70
73
|
✅ Updated ./package/wagmiGenerated.ts (10 replacements)
|
|
71
74
|
✨ All files processed successfully!
|
|
72
75
|
|
|
73
|
-
> @zoralabs/coins@
|
|
76
|
+
> @zoralabs/coins@2.0.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
|
|
74
77
|
> pnpm exec bundle-abis
|
|
75
78
|
|
|
76
79
|
|
|
77
|
-
> @zoralabs/coins@
|
|
80
|
+
> @zoralabs/coins@2.0.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
|
|
78
81
|
> prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
|
|
79
82
|
|
|
80
|
-
src/BaseCoin.sol
|
|
81
|
-
src/
|
|
82
|
-
src/
|
|
83
|
-
src/
|
|
84
|
-
src/
|
|
85
|
-
src/
|
|
86
|
-
src/hooks/
|
|
87
|
-
src/hooks/
|
|
88
|
-
src/hooks/
|
|
89
|
-
src/hooks/deployment/
|
|
83
|
+
src/BaseCoin.sol 331ms (unchanged)
|
|
84
|
+
src/BaseCoinV4.sol 110ms (unchanged)
|
|
85
|
+
src/Coin.sol 124ms (unchanged)
|
|
86
|
+
src/ContentCoin.sol 25ms (unchanged)
|
|
87
|
+
src/CreatorCoin.sol 47ms (unchanged)
|
|
88
|
+
src/deployment/CoinsDeployerBase.sol 189ms (unchanged)
|
|
89
|
+
src/hooks/BaseZoraV4CoinHook.sol 183ms (unchanged)
|
|
90
|
+
src/hooks/ContentCoinHook.sol 9ms (unchanged)
|
|
91
|
+
src/hooks/CreatorCoinHook.sol 6ms (unchanged)
|
|
92
|
+
src/hooks/deployment/BaseCoinDeployHook.sol 11ms (unchanged)
|
|
93
|
+
src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 130ms (unchanged)
|
|
90
94
|
src/hooks/HookUpgradeGate.sol 23ms (unchanged)
|
|
91
|
-
src/interfaces/IAirlock.sol
|
|
95
|
+
src/interfaces/IAirlock.sol 2ms (unchanged)
|
|
92
96
|
src/interfaces/ICoin.sol 13ms (unchanged)
|
|
93
|
-
src/interfaces/ICoinComments.sol
|
|
97
|
+
src/interfaces/ICoinComments.sol 2ms (unchanged)
|
|
94
98
|
src/interfaces/ICoinDeployHook.sol 1ms (unchanged)
|
|
95
|
-
src/interfaces/ICoinV3.sol
|
|
99
|
+
src/interfaces/ICoinV3.sol 3ms (unchanged)
|
|
96
100
|
src/interfaces/ICoinV4.sol 2ms (unchanged)
|
|
97
101
|
src/interfaces/ICreatorCoin.sol 1ms (unchanged)
|
|
98
|
-
src/interfaces/ICreatorCoinHook.sol
|
|
99
|
-
src/interfaces/IDeployedCoinVersionLookup.sol
|
|
100
|
-
src/interfaces/IDopplerErrors.sol
|
|
102
|
+
src/interfaces/ICreatorCoinHook.sol 1ms (unchanged)
|
|
103
|
+
src/interfaces/IDeployedCoinVersionLookup.sol 1ms (unchanged)
|
|
104
|
+
src/interfaces/IDopplerErrors.sol 0ms (unchanged)
|
|
101
105
|
src/interfaces/IERC7572.sol 1ms (unchanged)
|
|
102
106
|
src/interfaces/IHasRewardsRecipients.sol 1ms (unchanged)
|
|
103
107
|
src/interfaces/IHooksUpgradeGate.sol 2ms (unchanged)
|
|
104
108
|
src/interfaces/IMsgSender.sol 1ms (unchanged)
|
|
105
|
-
src/interfaces/INonfungiblePositionManager.sol
|
|
109
|
+
src/interfaces/INonfungiblePositionManager.sol 8ms (unchanged)
|
|
106
110
|
src/interfaces/IPoolConfigEncoding.sol 2ms (unchanged)
|
|
107
|
-
src/interfaces/IProtocolRewards.sol
|
|
108
|
-
src/interfaces/ISwapPathRouter.sol
|
|
109
|
-
src/interfaces/ISwapRouter.sol
|
|
110
|
-
src/interfaces/IUniswapV3Factory.sol
|
|
111
|
-
src/interfaces/IUniswapV3Pool.sol
|
|
112
|
-
src/interfaces/IUniswapV3SwapCallback.sol
|
|
113
|
-
src/interfaces/IUpgradeableV4Hook.sol
|
|
111
|
+
src/interfaces/IProtocolRewards.sol 3ms (unchanged)
|
|
112
|
+
src/interfaces/ISwapPathRouter.sol 1ms (unchanged)
|
|
113
|
+
src/interfaces/ISwapRouter.sol 0ms (unchanged)
|
|
114
|
+
src/interfaces/IUniswapV3Factory.sol 2ms (unchanged)
|
|
115
|
+
src/interfaces/IUniswapV3Pool.sol 3ms (unchanged)
|
|
116
|
+
src/interfaces/IUniswapV3SwapCallback.sol 2ms (unchanged)
|
|
117
|
+
src/interfaces/IUpgradeableV4Hook.sol 2ms (unchanged)
|
|
114
118
|
src/interfaces/IWETH.sol 2ms (unchanged)
|
|
115
|
-
src/interfaces/IZoraFactory.sol
|
|
116
|
-
src/interfaces/IZoraV4CoinHook.sol
|
|
117
|
-
src/libs/CoinCommon.sol
|
|
118
|
-
src/libs/CoinConfigurationVersions.sol
|
|
119
|
-
src/libs/CoinConstants.sol
|
|
119
|
+
src/interfaces/IZoraFactory.sol 10ms (unchanged)
|
|
120
|
+
src/interfaces/IZoraV4CoinHook.sol 7ms (unchanged)
|
|
121
|
+
src/libs/CoinCommon.sol 10ms (unchanged)
|
|
122
|
+
src/libs/CoinConfigurationVersions.sol 52ms (unchanged)
|
|
123
|
+
src/libs/CoinConstants.sol 3ms (unchanged)
|
|
120
124
|
src/libs/CoinDopplerMultiCurve.sol 106ms (unchanged)
|
|
121
|
-
src/libs/CoinDopplerUniV3.sol
|
|
122
|
-
src/libs/CoinRewards.sol
|
|
123
|
-
src/libs/CoinRewardsV4.sol
|
|
124
|
-
src/libs/CoinSetup.sol
|
|
125
|
-
src/libs/CoinSetupV3.sol
|
|
125
|
+
src/libs/CoinDopplerUniV3.sol 28ms (unchanged)
|
|
126
|
+
src/libs/CoinRewards.sol 113ms (unchanged)
|
|
127
|
+
src/libs/CoinRewardsV4.sol 102ms (unchanged)
|
|
128
|
+
src/libs/CoinSetup.sol 23ms (unchanged)
|
|
129
|
+
src/libs/CoinSetupV3.sol 14ms (unchanged)
|
|
126
130
|
src/libs/CreatorCoinConstants.sol 2ms (unchanged)
|
|
127
|
-
src/libs/CreatorCoinRewards.sol
|
|
128
|
-
src/libs/DopplerMath.sol
|
|
129
|
-
src/libs/HooksDeployment.sol
|
|
130
|
-
src/libs/MarketConstants.sol
|
|
131
|
-
src/libs/PoolStateReader.sol
|
|
132
|
-
src/libs/UniV3BuySell.sol
|
|
131
|
+
src/libs/CreatorCoinRewards.sol 10ms (unchanged)
|
|
132
|
+
src/libs/DopplerMath.sol 88ms (unchanged)
|
|
133
|
+
src/libs/HooksDeployment.sol 85ms (unchanged)
|
|
134
|
+
src/libs/MarketConstants.sol 2ms (unchanged)
|
|
135
|
+
src/libs/PoolStateReader.sol 7ms (unchanged)
|
|
136
|
+
src/libs/UniV3BuySell.sol 78ms (unchanged)
|
|
133
137
|
src/libs/UniV3Errors.sol 1ms (unchanged)
|
|
134
138
|
src/libs/UniV4SwapHelper.sol 24ms (unchanged)
|
|
135
|
-
src/libs/UniV4SwapToCurrency.sol
|
|
136
|
-
src/libs/V4Liquidity.sol
|
|
137
|
-
src/proxy/ZoraFactory.sol
|
|
138
|
-
src/types/LpPosition.sol
|
|
139
|
+
src/libs/UniV4SwapToCurrency.sol 52ms (unchanged)
|
|
140
|
+
src/libs/V4Liquidity.sol 136ms (unchanged)
|
|
141
|
+
src/proxy/ZoraFactory.sol 7ms (unchanged)
|
|
142
|
+
src/types/LpPosition.sol 1ms (unchanged)
|
|
139
143
|
src/types/PoolConfiguration.sol 1ms (unchanged)
|
|
140
144
|
src/types/PoolState.sol 1ms (unchanged)
|
|
141
|
-
src/utils/AutoSwapper.sol
|
|
142
|
-
src/utils/DeployedCoinVersionLookup.sol
|
|
143
|
-
src/utils/MultiOwnable.sol
|
|
144
|
-
src/utils/uniswap/BitMath.sol
|
|
145
|
-
src/utils/uniswap/BytesLib.sol
|
|
146
|
-
src/utils/uniswap/CustomRevert.sol
|
|
147
|
-
src/utils/uniswap/FixedPoint96.sol
|
|
145
|
+
src/utils/AutoSwapper.sol 19ms (unchanged)
|
|
146
|
+
src/utils/DeployedCoinVersionLookup.sol 4ms (unchanged)
|
|
147
|
+
src/utils/MultiOwnable.sol 39ms (unchanged)
|
|
148
|
+
src/utils/uniswap/BitMath.sol 11ms (unchanged)
|
|
149
|
+
src/utils/uniswap/BytesLib.sol 15ms (unchanged)
|
|
150
|
+
src/utils/uniswap/CustomRevert.sol 34ms (unchanged)
|
|
151
|
+
src/utils/uniswap/FixedPoint96.sol 2ms (unchanged)
|
|
148
152
|
src/utils/uniswap/FullMath.sol 21ms (unchanged)
|
|
149
|
-
src/utils/uniswap/LiquidityAmounts.sol
|
|
150
|
-
src/utils/uniswap/Path.sol
|
|
153
|
+
src/utils/uniswap/LiquidityAmounts.sol 41ms (unchanged)
|
|
154
|
+
src/utils/uniswap/Path.sol 5ms (unchanged)
|
|
151
155
|
src/utils/uniswap/SafeCast.sol 11ms (unchanged)
|
|
152
|
-
src/utils/uniswap/SqrtPriceMath.sol
|
|
153
|
-
src/utils/uniswap/TickMath.sol
|
|
156
|
+
src/utils/uniswap/SqrtPriceMath.sol 63ms (unchanged)
|
|
157
|
+
src/utils/uniswap/TickMath.sol 59ms (unchanged)
|
|
154
158
|
src/utils/uniswap/UnsafeMath.sol 2ms (unchanged)
|
|
155
159
|
src/version/ContractVersionBase.sol 1ms (unchanged)
|
|
156
|
-
src/ZoraFactoryImpl.sol
|
|
157
|
-
test/AutoSwapper.t.sol
|
|
158
|
-
test/Coin.t.sol
|
|
159
|
-
test/CoinDopplerUniV3.t.sol
|
|
160
|
-
test/CoinUniV4.t.sol
|
|
161
|
-
test/CreatorCoin.t.sol
|
|
162
|
-
test/DeploymentHooks.t.sol
|
|
163
|
-
test/Factory.t.sol
|
|
164
|
-
test/HooksDeployment.t.sol
|
|
165
|
-
test/LiquidityMigration.t.sol
|
|
166
|
-
test/mocks/MockERC20.sol
|
|
167
|
-
test/MultiOwnable.t.sol
|
|
168
|
-
test/Upgrades.t.sol
|
|
169
|
-
test/utils/BaseTest.sol
|
|
170
|
-
test/utils/ContractAddresses.sol
|
|
171
|
-
test/utils/DeployedCoinVersionLookup.t.sol
|
|
172
|
-
test/utils/FeeEstimatorHook.sol
|
|
173
|
-
test/utils/ProtocolRewards.sol
|
|
160
|
+
src/ZoraFactoryImpl.sol 152ms (unchanged)
|
|
161
|
+
test/AutoSwapper.t.sol 36ms (unchanged)
|
|
162
|
+
test/Coin.t.sol 315ms (unchanged)
|
|
163
|
+
test/CoinDopplerUniV3.t.sol 159ms (unchanged)
|
|
164
|
+
test/CoinUniV4.t.sol 337ms (unchanged)
|
|
165
|
+
test/CreatorCoin.t.sol 141ms (unchanged)
|
|
166
|
+
test/DeploymentHooks.t.sol 99ms (unchanged)
|
|
167
|
+
test/Factory.t.sol 202ms (unchanged)
|
|
168
|
+
test/HooksDeployment.t.sol 29ms (unchanged)
|
|
169
|
+
test/LiquidityMigration.t.sol 87ms (unchanged)
|
|
170
|
+
test/mocks/MockERC20.sol 4ms (unchanged)
|
|
171
|
+
test/MultiOwnable.t.sol 97ms (unchanged)
|
|
172
|
+
test/Upgrades.t.sol 111ms (unchanged)
|
|
173
|
+
test/utils/BaseTest.sol 175ms (unchanged)
|
|
174
|
+
test/utils/ContractAddresses.sol 3ms (unchanged)
|
|
175
|
+
test/utils/DeployedCoinVersionLookup.t.sol 36ms (unchanged)
|
|
176
|
+
test/utils/FeeEstimatorHook.sol 30ms (unchanged)
|
|
177
|
+
test/utils/ProtocolRewards.sol 283ms (unchanged)
|
|
174
178
|
test/utils/ProxyShim.sol 3ms (unchanged)
|
|
175
179
|
script/Deploy.s.sol 3ms (unchanged)
|
|
176
|
-
script/DeployAutoSwapper.s.sol
|
|
180
|
+
script/DeployAutoSwapper.s.sol 8ms (unchanged)
|
|
177
181
|
script/DeployDevFactory.s.sol 4ms (unchanged)
|
|
178
|
-
script/DeployPostDeploymentHooks.s.sol
|
|
182
|
+
script/DeployPostDeploymentHooks.s.sol 9ms (unchanged)
|
|
179
183
|
script/DeployUpgradeGate.s.sol 5ms (unchanged)
|
|
180
|
-
script/GenerateDeterministicParams.s.sol
|
|
181
|
-
script/PrintRegisterUpgradePath.s.sol
|
|
184
|
+
script/GenerateDeterministicParams.s.sol 11ms (unchanged)
|
|
185
|
+
script/PrintRegisterUpgradePath.s.sol 18ms (unchanged)
|
|
182
186
|
script/PrintUpgradeCommand.s.sol 2ms (unchanged)
|
|
183
|
-
script/Simulate.s.sol
|
|
187
|
+
script/Simulate.s.sol 16ms (unchanged)
|
|
184
188
|
script/TestBackingCoinSwap.s.sol 34ms (unchanged)
|
|
185
|
-
script/TestV4Swap.s.sol
|
|
186
|
-
script/UpgradeCoinImpl.sol
|
|
189
|
+
script/TestV4Swap.s.sol 33ms (unchanged)
|
|
190
|
+
script/UpgradeCoinImpl.sol 6ms (unchanged)
|
|
187
191
|
script/UpgradeFactoryImpl.s.sol 6ms (unchanged)
|
|
188
|
-
script/UpgradeHooks.s.sol
|
|
192
|
+
script/UpgradeHooks.s.sol 4ms (unchanged)
|
|
189
193
|
[34mCLI[39m Building entry: package/index.ts
|
|
190
194
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
191
195
|
[34mCLI[39m tsup v8.4.0
|
|
@@ -194,9 +198,9 @@ script/UpgradeHooks.s.sol 3ms (unchanged)
|
|
|
194
198
|
[34mCLI[39m Cleaning output folder
|
|
195
199
|
[34mCJS[39m Build start
|
|
196
200
|
[34mESM[39m Build start
|
|
197
|
-
[
|
|
198
|
-
[
|
|
201
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m131.00 KB[39m
|
|
202
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m232.35 KB[39m
|
|
203
|
+
[32mCJS[39m ⚡️ Build success in 42ms
|
|
204
|
+
[32mESM[39m [1mdist/index.js [22m[32m129.58 KB[39m
|
|
205
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m232.20 KB[39m
|
|
199
206
|
[32mESM[39m ⚡️ Build success in 42ms
|
|
200
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m130.34 KB[39m
|
|
201
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m231.16 KB[39m
|
|
202
|
-
[32mCJS[39m ⚡️ Build success in 43ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @zoralabs/coins
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- acb9ff94: Move ZoraFactoryImpl to 2-step ownable with same storage slots
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
Key changes:
|
|
12
|
+
|
|
13
|
+
- ZoraFactoryImpl now inherits from Ownable2StepUpgradeable
|
|
14
|
+
- Adds pendingOwner() function
|
|
15
|
+
- Requires acceptOwnership() call to complete ownership transfers
|
|
16
|
+
- Maintains storage slot compatibility for upgrades
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 65d36dbb: Refactor coinv4 into basecoinv4 and content coin
|
|
21
|
+
|
|
22
|
+
This refactoring splits the coinv4 implementation into a base coin contract and content coin contract for better modularity and separation of concerns.
|
|
23
|
+
|
|
24
|
+
## 1.1.2
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 522a7c33: Update LICENSE for coins
|
|
29
|
+
- 5c561b01: Fixed bug where hooks could not receive taken eth for paying out rewards
|
|
30
|
+
|
|
3
31
|
## 1.1.1
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
License
|
|
2
|
+
|
|
3
|
+
All source code specified as: SPDX-Identifier: ZORA-DELAYED-OSL-v1
|
|
4
|
+
follows this license.
|
|
5
|
+
|
|
6
|
+
Other licenses are specified on a file by file basis
|
|
7
|
+
|
|
8
|
+
Definitions:
|
|
9
|
+
"Licensed Work" means the software, code, or content distributed under this License,
|
|
10
|
+
including any copies or derivative works thereof.
|
|
11
|
+
|
|
12
|
+
"Licensor" means Zora Labs, Inc., a Delaware corporation.
|
|
13
|
+
|
|
14
|
+
"Commercial Purpose" means any use that generates, or is intended to generate, revenue,
|
|
15
|
+
monetary value, or other commercial benefit, whether through fees, subscriptions, token
|
|
16
|
+
issuance, staking incentives, or other monetization mechanisms.
|
|
17
|
+
|
|
18
|
+
"Competitive Product" means a Product provided for Commercial Purposes, and provides
|
|
19
|
+
functionality substantially similar to or substitutable for, in whole or in part, the
|
|
20
|
+
Licensed Work, and that is made available to third parties directly or indirectly,
|
|
21
|
+
whether operated independently or as part of a broader offering.
|
|
22
|
+
|
|
23
|
+
"Product" means any software application, protocol, service, or system that (i) makes
|
|
24
|
+
the Licensed Work (or any derivative work thereof) available for third-party
|
|
25
|
+
interaction, directly or indirectly, including but not limited to through interfaces,
|
|
26
|
+
middleware, aggregators, composable integrations, or smart contract deployment; (ii)
|
|
27
|
+
uses the Licensed Work (or any derivative work thereof) in a production environment or
|
|
28
|
+
mainnet context; (iii) integrates or incorporates the Licensed Work as part of a
|
|
29
|
+
broader software or financial service offering; or (iv) is operated for a Commercial
|
|
30
|
+
Purpose, whether or not publicly accessible.
|
|
31
|
+
|
|
32
|
+
"Open Date" means the earlier of: (i) the third anniversary of the first public
|
|
33
|
+
distribution of the Licensed Work, and (ii) the date specified by the Licensor as the
|
|
34
|
+
official date the Licensed Work shall become available under the MIT License.
|
|
35
|
+
|
|
36
|
+
Terms:
|
|
37
|
+
|
|
38
|
+
The Licensor hereby grants you a non-exclusive, non-transferable, worldwide,
|
|
39
|
+
royalty-free license to (i) use, copy, modify, and create derivative works of the
|
|
40
|
+
Licensed Work; (ii) distribute the Licensed Work (or any derivative works thereof), in
|
|
41
|
+
each of (i) and (ii), solely for purposes other than (a) Commercial Purposes, or (b) as
|
|
42
|
+
a Competitive Product. You are not granted rights to, and you may not exploit, the
|
|
43
|
+
Licensed Work for Commercial Purposes or as a Competitive Product. For the avoidance of
|
|
44
|
+
doubt, deploying modified versions of the Licensed Work that preserve the core
|
|
45
|
+
functionality or interface of the Licensed Work shall be considered a derivative work
|
|
46
|
+
and subject to this License. This License governs your use even if you receive the
|
|
47
|
+
Licensed Work from a third party, whether in its original form or in a derivative or
|
|
48
|
+
modified form.
|
|
49
|
+
|
|
50
|
+
You must retain, in all copies and substantial portions of the Licensed Work and in all
|
|
51
|
+
derivative works, (i) all copyright notices, author credits, and licensing notices
|
|
52
|
+
included by the Licensor, and (ii) a notice stating, "This software includes original
|
|
53
|
+
work licensed under the Delayed Open Source License by Zora Labs, Inc."
|
|
54
|
+
|
|
55
|
+
Your rights under this License terminate immediately for all versions of the Licensed
|
|
56
|
+
Work if you violate its terms.
|
|
57
|
+
|
|
58
|
+
THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
59
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
|
|
60
|
+
A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
61
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
62
|
+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE LICENSED
|
|
63
|
+
WORK OR THE USE OR OTHER DEALINGS IN THE LICENSED WORK.
|
|
64
|
+
|
|
65
|
+
Effective on the Open Date, the Licensed Work becomes available under the MIT License
|
|
66
|
+
(attached hereto as Appendix A).
|
|
67
|
+
|
|
68
|
+
Contact:
|
|
69
|
+
|
|
70
|
+
To request written consent for unlicensed uses, please contact: support@zora.co
|
|
71
|
+
|
|
72
|
+
Appendix A – MIT License
|
|
73
|
+
|
|
74
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
|
75
|
+
software and associated documentation files (the "Software"), to deal in the Software
|
|
76
|
+
without restriction, including without limitation the rights to use, copy, modify,
|
|
77
|
+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
78
|
+
permit persons to whom the Software is furnished to do so, subject to the following
|
|
79
|
+
conditions:
|
|
80
|
+
|
|
81
|
+
The above copyright notice and this permission notice shall be included in all copies
|
|
82
|
+
or substantial portions of the Software.
|
|
83
|
+
|
|
84
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
85
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
86
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
87
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
88
|
+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
|
89
|
+
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
90
|
+
|
package/README.md
CHANGED
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
# Coins
|
|
2
2
|
|
|
3
|
+
A protocol for creating and trading creator and content coins with automatic rewards distribution on top of Uniswap V4 hooks.
|
|
4
|
+
|
|
5
|
+
## Architecture Overview
|
|
6
|
+
|
|
7
|
+
The Coins protocol consists of several key contracts that work together to enable coin creation, trading, and customization:
|
|
8
|
+
|
|
9
|
+
### Core Contracts
|
|
10
|
+
|
|
11
|
+
#### BaseCoin
|
|
12
|
+
|
|
13
|
+
The abstract base contract that provides core ERC20 functionality with additional features:
|
|
14
|
+
|
|
15
|
+
- **ERC20 with Permit**: Standard token functionality with gasless approvals
|
|
16
|
+
- **Multi-ownership**: Support for multiple owners
|
|
17
|
+
- **Reward Distribution**: Distributes rewards on swaps
|
|
18
|
+
- **Comment System**: Support for on-chain comments via `ICoinComments`
|
|
19
|
+
|
|
20
|
+
#### BaseCoinV4
|
|
21
|
+
|
|
22
|
+
Abstract base contract that provides shared Uniswap V4 functionality:
|
|
23
|
+
|
|
24
|
+
- **V4 Pool Manager**: Direct integration with Uniswap V4's singleton pool manager
|
|
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
|
|
29
|
+
|
|
30
|
+
#### ContentCoin
|
|
31
|
+
|
|
32
|
+
Content coin implementation that inherits from `BaseCoinV4`:
|
|
33
|
+
|
|
34
|
+
- **Creator Coin Backing**: Always uses the creator's CreatorCoin as the backing currency
|
|
35
|
+
- **Supply**: 1 billion total supply (990M for liquidity pool, 10M creator reward)
|
|
36
|
+
- **Multiple per Creator**: Each creator can have multiple content coins
|
|
37
|
+
|
|
38
|
+
#### CreatorCoin
|
|
39
|
+
|
|
40
|
+
Specialized coin implementation for creators (one per creator) that inherits from `BaseCoinV4`:
|
|
41
|
+
|
|
42
|
+
- **Vesting Schedule**: Built-in token vesting for creator rewards (5-year vesting)
|
|
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
|
|
48
|
+
|
|
49
|
+
#### Coin (V3 Implementation - Legacy)
|
|
50
|
+
|
|
51
|
+
The V3 implementation of coins using Uniswap V3 integration, predating the V4 architecture:
|
|
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
|
+
|
|
3
129
|
## Deployment
|
|
4
130
|
|
|
5
131
|
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).
|