@zoralabs/coins 2.0.0 → 2.1.1
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 +107 -114
- package/CHANGELOG.md +34 -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/foundry.toml +1 -3
- 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 +111 -7
- 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/ContentCoinHook.sol +2 -2
- 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/MarketConstants.sol +0 -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 +7 -7
- 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/abis/ICoin.json
CHANGED
|
@@ -64,6 +64,299 @@
|
|
|
64
64
|
],
|
|
65
65
|
"stateMutability": "view"
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"type": "function",
|
|
69
|
+
"name": "getPayoutSwapPath",
|
|
70
|
+
"inputs": [
|
|
71
|
+
{
|
|
72
|
+
"name": "coinVersionLookup",
|
|
73
|
+
"type": "address",
|
|
74
|
+
"internalType": "contract IDeployedCoinVersionLookup"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"outputs": [
|
|
78
|
+
{
|
|
79
|
+
"name": "",
|
|
80
|
+
"type": "tuple",
|
|
81
|
+
"internalType": "struct IHasSwapPath.PayoutSwapPath",
|
|
82
|
+
"components": [
|
|
83
|
+
{
|
|
84
|
+
"name": "path",
|
|
85
|
+
"type": "tuple[]",
|
|
86
|
+
"internalType": "struct PathKey[]",
|
|
87
|
+
"components": [
|
|
88
|
+
{
|
|
89
|
+
"name": "intermediateCurrency",
|
|
90
|
+
"type": "address",
|
|
91
|
+
"internalType": "Currency"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "fee",
|
|
95
|
+
"type": "uint24",
|
|
96
|
+
"internalType": "uint24"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "tickSpacing",
|
|
100
|
+
"type": "int24",
|
|
101
|
+
"internalType": "int24"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "hooks",
|
|
105
|
+
"type": "address",
|
|
106
|
+
"internalType": "contract IHooks"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "hookData",
|
|
110
|
+
"type": "bytes",
|
|
111
|
+
"internalType": "bytes"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "currencyIn",
|
|
117
|
+
"type": "address",
|
|
118
|
+
"internalType": "Currency"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"stateMutability": "view"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "function",
|
|
127
|
+
"name": "getPoolConfiguration",
|
|
128
|
+
"inputs": [],
|
|
129
|
+
"outputs": [
|
|
130
|
+
{
|
|
131
|
+
"name": "",
|
|
132
|
+
"type": "tuple",
|
|
133
|
+
"internalType": "struct PoolConfiguration",
|
|
134
|
+
"components": [
|
|
135
|
+
{
|
|
136
|
+
"name": "version",
|
|
137
|
+
"type": "uint8",
|
|
138
|
+
"internalType": "uint8"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "numPositions",
|
|
142
|
+
"type": "uint16",
|
|
143
|
+
"internalType": "uint16"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "fee",
|
|
147
|
+
"type": "uint24",
|
|
148
|
+
"internalType": "uint24"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "tickSpacing",
|
|
152
|
+
"type": "int24",
|
|
153
|
+
"internalType": "int24"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "numDiscoveryPositions",
|
|
157
|
+
"type": "uint16[]",
|
|
158
|
+
"internalType": "uint16[]"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "tickLower",
|
|
162
|
+
"type": "int24[]",
|
|
163
|
+
"internalType": "int24[]"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "tickUpper",
|
|
167
|
+
"type": "int24[]",
|
|
168
|
+
"internalType": "int24[]"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "maxDiscoverySupplyShare",
|
|
172
|
+
"type": "uint256[]",
|
|
173
|
+
"internalType": "uint256[]"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"stateMutability": "view"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"type": "function",
|
|
182
|
+
"name": "getPoolKey",
|
|
183
|
+
"inputs": [],
|
|
184
|
+
"outputs": [
|
|
185
|
+
{
|
|
186
|
+
"name": "",
|
|
187
|
+
"type": "tuple",
|
|
188
|
+
"internalType": "struct PoolKey",
|
|
189
|
+
"components": [
|
|
190
|
+
{
|
|
191
|
+
"name": "currency0",
|
|
192
|
+
"type": "address",
|
|
193
|
+
"internalType": "Currency"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "currency1",
|
|
197
|
+
"type": "address",
|
|
198
|
+
"internalType": "Currency"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "fee",
|
|
202
|
+
"type": "uint24",
|
|
203
|
+
"internalType": "uint24"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "tickSpacing",
|
|
207
|
+
"type": "int24",
|
|
208
|
+
"internalType": "int24"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "hooks",
|
|
212
|
+
"type": "address",
|
|
213
|
+
"internalType": "contract IHooks"
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"stateMutability": "view"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"type": "function",
|
|
222
|
+
"name": "hooks",
|
|
223
|
+
"inputs": [],
|
|
224
|
+
"outputs": [
|
|
225
|
+
{
|
|
226
|
+
"name": "",
|
|
227
|
+
"type": "address",
|
|
228
|
+
"internalType": "contract IHooks"
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"stateMutability": "view"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"type": "function",
|
|
235
|
+
"name": "initialize",
|
|
236
|
+
"inputs": [
|
|
237
|
+
{
|
|
238
|
+
"name": "payoutRecipient_",
|
|
239
|
+
"type": "address",
|
|
240
|
+
"internalType": "address"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "owners_",
|
|
244
|
+
"type": "address[]",
|
|
245
|
+
"internalType": "address[]"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "tokenURI_",
|
|
249
|
+
"type": "string",
|
|
250
|
+
"internalType": "string"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "name_",
|
|
254
|
+
"type": "string",
|
|
255
|
+
"internalType": "string"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "symbol_",
|
|
259
|
+
"type": "string",
|
|
260
|
+
"internalType": "string"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "platformReferrer_",
|
|
264
|
+
"type": "address",
|
|
265
|
+
"internalType": "address"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "currency_",
|
|
269
|
+
"type": "address",
|
|
270
|
+
"internalType": "address"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "poolKey_",
|
|
274
|
+
"type": "tuple",
|
|
275
|
+
"internalType": "struct PoolKey",
|
|
276
|
+
"components": [
|
|
277
|
+
{
|
|
278
|
+
"name": "currency0",
|
|
279
|
+
"type": "address",
|
|
280
|
+
"internalType": "Currency"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"name": "currency1",
|
|
284
|
+
"type": "address",
|
|
285
|
+
"internalType": "Currency"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "fee",
|
|
289
|
+
"type": "uint24",
|
|
290
|
+
"internalType": "uint24"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "tickSpacing",
|
|
294
|
+
"type": "int24",
|
|
295
|
+
"internalType": "int24"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"name": "hooks",
|
|
299
|
+
"type": "address",
|
|
300
|
+
"internalType": "contract IHooks"
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"name": "sqrtPriceX96",
|
|
306
|
+
"type": "uint160",
|
|
307
|
+
"internalType": "uint160"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "poolConfiguration_",
|
|
311
|
+
"type": "tuple",
|
|
312
|
+
"internalType": "struct PoolConfiguration",
|
|
313
|
+
"components": [
|
|
314
|
+
{
|
|
315
|
+
"name": "version",
|
|
316
|
+
"type": "uint8",
|
|
317
|
+
"internalType": "uint8"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "numPositions",
|
|
321
|
+
"type": "uint16",
|
|
322
|
+
"internalType": "uint16"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"name": "fee",
|
|
326
|
+
"type": "uint24",
|
|
327
|
+
"internalType": "uint24"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "tickSpacing",
|
|
331
|
+
"type": "int24",
|
|
332
|
+
"internalType": "int24"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"name": "numDiscoveryPositions",
|
|
336
|
+
"type": "uint16[]",
|
|
337
|
+
"internalType": "uint16[]"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "tickLower",
|
|
341
|
+
"type": "int24[]",
|
|
342
|
+
"internalType": "int24[]"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "tickUpper",
|
|
346
|
+
"type": "int24[]",
|
|
347
|
+
"internalType": "int24[]"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "maxDiscoverySupplyShare",
|
|
351
|
+
"type": "uint256[]",
|
|
352
|
+
"internalType": "uint256[]"
|
|
353
|
+
}
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
"outputs": [],
|
|
358
|
+
"stateMutability": "nonpayable"
|
|
359
|
+
},
|
|
67
360
|
{
|
|
68
361
|
"type": "function",
|
|
69
362
|
"name": "payoutRecipient",
|
|
@@ -484,6 +777,91 @@
|
|
|
484
777
|
"inputs": [],
|
|
485
778
|
"anonymous": false
|
|
486
779
|
},
|
|
780
|
+
{
|
|
781
|
+
"type": "event",
|
|
782
|
+
"name": "LiquidityMigrated",
|
|
783
|
+
"inputs": [
|
|
784
|
+
{
|
|
785
|
+
"name": "fromPoolKey",
|
|
786
|
+
"type": "tuple",
|
|
787
|
+
"indexed": false,
|
|
788
|
+
"internalType": "struct PoolKey",
|
|
789
|
+
"components": [
|
|
790
|
+
{
|
|
791
|
+
"name": "currency0",
|
|
792
|
+
"type": "address",
|
|
793
|
+
"internalType": "Currency"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"name": "currency1",
|
|
797
|
+
"type": "address",
|
|
798
|
+
"internalType": "Currency"
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
"name": "fee",
|
|
802
|
+
"type": "uint24",
|
|
803
|
+
"internalType": "uint24"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"name": "tickSpacing",
|
|
807
|
+
"type": "int24",
|
|
808
|
+
"internalType": "int24"
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"name": "hooks",
|
|
812
|
+
"type": "address",
|
|
813
|
+
"internalType": "contract IHooks"
|
|
814
|
+
}
|
|
815
|
+
]
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
"name": "fromPoolKeyHash",
|
|
819
|
+
"type": "bytes32",
|
|
820
|
+
"indexed": false,
|
|
821
|
+
"internalType": "bytes32"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"name": "toPoolKey",
|
|
825
|
+
"type": "tuple",
|
|
826
|
+
"indexed": false,
|
|
827
|
+
"internalType": "struct PoolKey",
|
|
828
|
+
"components": [
|
|
829
|
+
{
|
|
830
|
+
"name": "currency0",
|
|
831
|
+
"type": "address",
|
|
832
|
+
"internalType": "Currency"
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
"name": "currency1",
|
|
836
|
+
"type": "address",
|
|
837
|
+
"internalType": "Currency"
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"name": "fee",
|
|
841
|
+
"type": "uint24",
|
|
842
|
+
"internalType": "uint24"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
"name": "tickSpacing",
|
|
846
|
+
"type": "int24",
|
|
847
|
+
"internalType": "int24"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"name": "hooks",
|
|
851
|
+
"type": "address",
|
|
852
|
+
"internalType": "contract IHooks"
|
|
853
|
+
}
|
|
854
|
+
]
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
"name": "toPoolKeyHash",
|
|
858
|
+
"type": "bytes32",
|
|
859
|
+
"indexed": false,
|
|
860
|
+
"internalType": "bytes32"
|
|
861
|
+
}
|
|
862
|
+
],
|
|
863
|
+
"anonymous": false
|
|
864
|
+
},
|
|
487
865
|
{
|
|
488
866
|
"type": "event",
|
|
489
867
|
"name": "NameAndSymbolUpdated",
|