@zoralabs/coins 2.1.1 → 2.2.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$colon$js.log +152 -0
- package/CHANGELOG.md +60 -0
- package/abis/BaseCoin.json +26 -0
- package/abis/BaseTest.json +2 -7
- package/abis/CoinConstants.json +0 -104
- package/abis/ContentCoin.json +26 -0
- package/abis/CreatorCoin.json +30 -4
- package/abis/FeeEstimatorHook.json +0 -5
- package/abis/ICoin.json +26 -0
- package/abis/ICoinV3.json +26 -0
- package/abis/ICreatorCoin.json +39 -0
- package/abis/IERC721.json +36 -36
- package/abis/IHasCoinType.json +15 -0
- package/abis/IHasTotalSupplyForPositions.json +15 -0
- package/abis/IZoraFactory.json +52 -0
- package/abis/IZoraHookRegistry.json +188 -0
- package/abis/VmContractHelper227.json +233 -0
- package/abis/ZoraFactoryImpl.json +32 -6
- package/abis/ZoraHookRegistry.json +375 -0
- package/abis/{CreatorCoinHook.json → ZoraV4CoinHook.json} +1 -1
- package/addresses/8453.json +2 -1
- package/dist/index.cjs +72 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +72 -10
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +90 -10
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/foundry.toml +4 -1
- package/package/wagmiGenerated.ts +72 -10
- package/package.json +7 -5
- package/script/PrintRegisterUpgradePath.s.sol +0 -7
- package/script/TestBackingCoinSwap.s.sol +0 -1
- package/script/TestV4Swap.s.sol +0 -1
- package/script/UpgradeFactoryImpl.s.sol +1 -1
- package/src/BaseCoin.sol +15 -12
- package/src/ContentCoin.sol +10 -0
- package/src/CreatorCoin.sol +28 -7
- package/src/ZoraFactoryImpl.sol +62 -23
- package/src/deployment/CoinsDeployerBase.sol +24 -58
- package/src/hook-registry/ZoraHookRegistry.sol +93 -0
- package/src/hooks/{BaseZoraV4CoinHook.sol → ZoraV4CoinHook.sol} +13 -8
- package/src/interfaces/ICoin.sol +19 -1
- package/src/interfaces/ICreatorCoin.sol +4 -0
- package/src/interfaces/IZoraFactory.sol +32 -10
- package/src/interfaces/IZoraHookRegistry.sol +47 -0
- package/src/libs/CoinConstants.sol +0 -32
- package/src/libs/CoinRewardsV4.sol +53 -15
- package/src/libs/CreatorCoinConstants.sol +0 -1
- package/src/libs/HooksDeployment.sol +13 -65
- package/src/libs/MarketConstants.sol +10 -12
- package/src/libs/V4Liquidity.sol +30 -0
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/CoinUniV4.t.sol +33 -30
- package/test/ContentCoinRewards.t.sol +320 -0
- package/test/CreatorCoin.t.sol +1 -1
- package/test/CreatorCoinRewards.t.sol +375 -0
- package/test/DeploymentHooks.t.sol +10 -10
- package/test/Factory.t.sol +24 -7
- package/test/HooksDeployment.t.sol +4 -4
- package/test/LiquidityMigration.t.sol +4 -9
- package/test/Upgrades.t.sol +44 -48
- package/test/ZoraHookRegistry.t.sol +266 -0
- package/test/utils/BaseTest.sol +25 -42
- package/test/utils/FeeEstimatorHook.sol +4 -6
- package/test/utils/RewardTestHelpers.sol +106 -0
- package/.turbo/turbo-build.log +0 -199
- package/abis/AutoSwapperTest.json +0 -618
- package/abis/BadImpl.json +0 -15
- package/abis/BaseZoraV4CoinHook.json +0 -1664
- package/abis/CoinTest.json +0 -819
- package/abis/CoinUniV4Test.json +0 -1128
- package/abis/ContentCoinHook.json +0 -1733
- package/abis/CreatorCoinTest.json +0 -887
- package/abis/Deploy.json +0 -9
- package/abis/DeployHooks.json +0 -9
- package/abis/DeployScript.json +0 -35
- package/abis/DeployedCoinVersionLookupTest.json +0 -740
- package/abis/DifferentNamespaceVersionLookup.json +0 -39
- package/abis/FactoryTest.json +0 -748
- package/abis/FakeHookNoInterface.json +0 -21
- package/abis/GenerateDeterministicParams.json +0 -9
- package/abis/HooksDeploymentTest.json +0 -645
- package/abis/HooksTest.json +0 -709
- package/abis/InvalidLiquidityMigrationReceiver.json +0 -21
- package/abis/LiquidityMigrationReceiver.json +0 -103
- package/abis/LiquidityMigrationTest.json +0 -889
- package/abis/MockBadFactory.json +0 -15
- package/abis/MultiOwnableTest.json +0 -766
- package/abis/PrintUpgradeCommand.json +0 -9
- package/abis/TestDeployedCoinVersionLookupImplementation.json +0 -39
- package/abis/TestV4Swap.json +0 -9
- package/abis/UpgradeFactoryImpl.json +0 -9
- package/abis/UpgradeHooks.json +0 -35
- package/abis/UpgradesTest.json +0 -723
- package/src/hooks/ContentCoinHook.sol +0 -27
- package/src/hooks/CreatorCoinHook.sol +0 -27
- package/src/libs/CreatorCoinRewards.sol +0 -34
package/dist/wagmiGenerated.d.ts
CHANGED
|
@@ -223,6 +223,16 @@ export declare const baseCoinABI: readonly [{
|
|
|
223
223
|
readonly name: "burn";
|
|
224
224
|
readonly outputs: readonly [];
|
|
225
225
|
readonly stateMutability: "nonpayable";
|
|
226
|
+
}, {
|
|
227
|
+
readonly type: "function";
|
|
228
|
+
readonly inputs: readonly [];
|
|
229
|
+
readonly name: "coinType";
|
|
230
|
+
readonly outputs: readonly [{
|
|
231
|
+
readonly name: "";
|
|
232
|
+
readonly internalType: "enum IHasCoinType.CoinType";
|
|
233
|
+
readonly type: "uint8";
|
|
234
|
+
}];
|
|
235
|
+
readonly stateMutability: "view";
|
|
226
236
|
}, {
|
|
227
237
|
readonly type: "function";
|
|
228
238
|
readonly inputs: readonly [];
|
|
@@ -810,6 +820,16 @@ export declare const baseCoinABI: readonly [{
|
|
|
810
820
|
readonly type: "uint256";
|
|
811
821
|
}];
|
|
812
822
|
readonly stateMutability: "view";
|
|
823
|
+
}, {
|
|
824
|
+
readonly type: "function";
|
|
825
|
+
readonly inputs: readonly [];
|
|
826
|
+
readonly name: "totalSupplyForPositions";
|
|
827
|
+
readonly outputs: readonly [{
|
|
828
|
+
readonly name: "";
|
|
829
|
+
readonly internalType: "uint256";
|
|
830
|
+
readonly type: "uint256";
|
|
831
|
+
}];
|
|
832
|
+
readonly stateMutability: "view";
|
|
813
833
|
}, {
|
|
814
834
|
readonly type: "function";
|
|
815
835
|
readonly inputs: readonly [{
|
|
@@ -1830,6 +1850,16 @@ export declare const contentCoinABI: readonly [{
|
|
|
1830
1850
|
readonly name: "burn";
|
|
1831
1851
|
readonly outputs: readonly [];
|
|
1832
1852
|
readonly stateMutability: "nonpayable";
|
|
1853
|
+
}, {
|
|
1854
|
+
readonly type: "function";
|
|
1855
|
+
readonly inputs: readonly [];
|
|
1856
|
+
readonly name: "coinType";
|
|
1857
|
+
readonly outputs: readonly [{
|
|
1858
|
+
readonly name: "";
|
|
1859
|
+
readonly internalType: "enum IHasCoinType.CoinType";
|
|
1860
|
+
readonly type: "uint8";
|
|
1861
|
+
}];
|
|
1862
|
+
readonly stateMutability: "pure";
|
|
1833
1863
|
}, {
|
|
1834
1864
|
readonly type: "function";
|
|
1835
1865
|
readonly inputs: readonly [];
|
|
@@ -2417,6 +2447,16 @@ export declare const contentCoinABI: readonly [{
|
|
|
2417
2447
|
readonly type: "uint256";
|
|
2418
2448
|
}];
|
|
2419
2449
|
readonly stateMutability: "view";
|
|
2450
|
+
}, {
|
|
2451
|
+
readonly type: "function";
|
|
2452
|
+
readonly inputs: readonly [];
|
|
2453
|
+
readonly name: "totalSupplyForPositions";
|
|
2454
|
+
readonly outputs: readonly [{
|
|
2455
|
+
readonly name: "";
|
|
2456
|
+
readonly internalType: "uint256";
|
|
2457
|
+
readonly type: "uint256";
|
|
2458
|
+
}];
|
|
2459
|
+
readonly stateMutability: "pure";
|
|
2420
2460
|
}, {
|
|
2421
2461
|
readonly type: "function";
|
|
2422
2462
|
readonly inputs: readonly [{
|
|
@@ -3167,19 +3207,19 @@ export declare const contentCoinABI: readonly [{
|
|
|
3167
3207
|
export declare const creatorCoinABI: readonly [{
|
|
3168
3208
|
readonly type: "constructor";
|
|
3169
3209
|
readonly inputs: readonly [{
|
|
3170
|
-
readonly name: "
|
|
3210
|
+
readonly name: "protocolRewardRecipient_";
|
|
3171
3211
|
readonly internalType: "address";
|
|
3172
3212
|
readonly type: "address";
|
|
3173
3213
|
}, {
|
|
3174
|
-
readonly name: "
|
|
3214
|
+
readonly name: "protocolRewards_";
|
|
3175
3215
|
readonly internalType: "address";
|
|
3176
3216
|
readonly type: "address";
|
|
3177
3217
|
}, {
|
|
3178
|
-
readonly name: "
|
|
3218
|
+
readonly name: "poolManager_";
|
|
3179
3219
|
readonly internalType: "contract IPoolManager";
|
|
3180
3220
|
readonly type: "address";
|
|
3181
3221
|
}, {
|
|
3182
|
-
readonly name: "
|
|
3222
|
+
readonly name: "airlock_";
|
|
3183
3223
|
readonly internalType: "address";
|
|
3184
3224
|
readonly type: "address";
|
|
3185
3225
|
}];
|
|
@@ -3294,6 +3334,16 @@ export declare const creatorCoinABI: readonly [{
|
|
|
3294
3334
|
readonly type: "uint256";
|
|
3295
3335
|
}];
|
|
3296
3336
|
readonly stateMutability: "nonpayable";
|
|
3337
|
+
}, {
|
|
3338
|
+
readonly type: "function";
|
|
3339
|
+
readonly inputs: readonly [];
|
|
3340
|
+
readonly name: "coinType";
|
|
3341
|
+
readonly outputs: readonly [{
|
|
3342
|
+
readonly name: "";
|
|
3343
|
+
readonly internalType: "enum IHasCoinType.CoinType";
|
|
3344
|
+
readonly type: "uint8";
|
|
3345
|
+
}];
|
|
3346
|
+
readonly stateMutability: "pure";
|
|
3297
3347
|
}, {
|
|
3298
3348
|
readonly type: "function";
|
|
3299
3349
|
readonly inputs: readonly [];
|
|
@@ -3901,6 +3951,16 @@ export declare const creatorCoinABI: readonly [{
|
|
|
3901
3951
|
readonly type: "uint256";
|
|
3902
3952
|
}];
|
|
3903
3953
|
readonly stateMutability: "view";
|
|
3954
|
+
}, {
|
|
3955
|
+
readonly type: "function";
|
|
3956
|
+
readonly inputs: readonly [];
|
|
3957
|
+
readonly name: "totalSupplyForPositions";
|
|
3958
|
+
readonly outputs: readonly [{
|
|
3959
|
+
readonly name: "";
|
|
3960
|
+
readonly internalType: "uint256";
|
|
3961
|
+
readonly type: "uint256";
|
|
3962
|
+
}];
|
|
3963
|
+
readonly stateMutability: "pure";
|
|
3904
3964
|
}, {
|
|
3905
3965
|
readonly type: "function";
|
|
3906
3966
|
readonly inputs: readonly [{
|
|
@@ -5677,19 +5737,19 @@ export declare const iUniversalRouterABI: readonly [{
|
|
|
5677
5737
|
export declare const zoraFactoryImplABI: readonly [{
|
|
5678
5738
|
readonly type: "constructor";
|
|
5679
5739
|
readonly inputs: readonly [{
|
|
5680
|
-
readonly name: "
|
|
5740
|
+
readonly name: "coinV4Impl_";
|
|
5681
5741
|
readonly internalType: "address";
|
|
5682
5742
|
readonly type: "address";
|
|
5683
5743
|
}, {
|
|
5684
|
-
readonly name: "
|
|
5744
|
+
readonly name: "creatorCoinImpl_";
|
|
5685
5745
|
readonly internalType: "address";
|
|
5686
5746
|
readonly type: "address";
|
|
5687
5747
|
}, {
|
|
5688
|
-
readonly name: "
|
|
5748
|
+
readonly name: "hook_";
|
|
5689
5749
|
readonly internalType: "address";
|
|
5690
5750
|
readonly type: "address";
|
|
5691
5751
|
}, {
|
|
5692
|
-
readonly name: "
|
|
5752
|
+
readonly name: "zoraHookRegistry_";
|
|
5693
5753
|
readonly internalType: "address";
|
|
5694
5754
|
readonly type: "address";
|
|
5695
5755
|
}];
|
|
@@ -5839,7 +5899,7 @@ export declare const zoraFactoryImplABI: readonly [{
|
|
|
5839
5899
|
readonly internalType: "int24";
|
|
5840
5900
|
readonly type: "int24";
|
|
5841
5901
|
}, {
|
|
5842
|
-
readonly name: "
|
|
5902
|
+
readonly name: "";
|
|
5843
5903
|
readonly internalType: "uint256";
|
|
5844
5904
|
readonly type: "uint256";
|
|
5845
5905
|
}];
|
|
@@ -6027,7 +6087,7 @@ export declare const zoraFactoryImplABI: readonly [{
|
|
|
6027
6087
|
readonly internalType: "address";
|
|
6028
6088
|
readonly type: "address";
|
|
6029
6089
|
}, {
|
|
6030
|
-
readonly name: "
|
|
6090
|
+
readonly name: "deployHook";
|
|
6031
6091
|
readonly internalType: "address";
|
|
6032
6092
|
readonly type: "address";
|
|
6033
6093
|
}, {
|
|
@@ -6060,6 +6120,16 @@ export declare const zoraFactoryImplABI: readonly [{
|
|
|
6060
6120
|
readonly type: "uint8";
|
|
6061
6121
|
}];
|
|
6062
6122
|
readonly stateMutability: "view";
|
|
6123
|
+
}, {
|
|
6124
|
+
readonly type: "function";
|
|
6125
|
+
readonly inputs: readonly [];
|
|
6126
|
+
readonly name: "hook";
|
|
6127
|
+
readonly outputs: readonly [{
|
|
6128
|
+
readonly name: "";
|
|
6129
|
+
readonly internalType: "address";
|
|
6130
|
+
readonly type: "address";
|
|
6131
|
+
}];
|
|
6132
|
+
readonly stateMutability: "view";
|
|
6063
6133
|
}, {
|
|
6064
6134
|
readonly type: "function";
|
|
6065
6135
|
readonly inputs: readonly [];
|
|
@@ -6140,6 +6210,16 @@ export declare const zoraFactoryImplABI: readonly [{
|
|
|
6140
6210
|
readonly name: "upgradeToAndCall";
|
|
6141
6211
|
readonly outputs: readonly [];
|
|
6142
6212
|
readonly stateMutability: "payable";
|
|
6213
|
+
}, {
|
|
6214
|
+
readonly type: "function";
|
|
6215
|
+
readonly inputs: readonly [];
|
|
6216
|
+
readonly name: "zoraHookRegistry";
|
|
6217
|
+
readonly outputs: readonly [{
|
|
6218
|
+
readonly name: "";
|
|
6219
|
+
readonly internalType: "address";
|
|
6220
|
+
readonly type: "address";
|
|
6221
|
+
}];
|
|
6222
|
+
readonly stateMutability: "view";
|
|
6143
6223
|
}, {
|
|
6144
6224
|
readonly type: "event";
|
|
6145
6225
|
readonly anonymous: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wagmiGenerated.d.ts","sourceRoot":"","sources":["../package/wagmiGenerated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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|
8
8
|
optimizer_runs = 200
|
|
9
|
+
dynamic_test_linking = true
|
|
9
10
|
fs_permissions = [
|
|
10
11
|
{ access = "readwrite", path = "./addresses" },
|
|
11
12
|
{ access = "readwrite", path = "./addresses/dev" },
|
|
@@ -19,4 +20,6 @@ fs_permissions = [
|
|
|
19
20
|
runs = 100
|
|
20
21
|
|
|
21
22
|
[rpc_endpoints]
|
|
22
|
-
base = "https://base.
|
|
23
|
+
base = "https://base-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
|
|
24
|
+
mainnet = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
|
|
25
|
+
zora = "https://rpc.zora.energy"
|
|
@@ -164,6 +164,15 @@ export const baseCoinABI = [
|
|
|
164
164
|
outputs: [],
|
|
165
165
|
stateMutability: 'nonpayable',
|
|
166
166
|
},
|
|
167
|
+
{
|
|
168
|
+
type: 'function',
|
|
169
|
+
inputs: [],
|
|
170
|
+
name: 'coinType',
|
|
171
|
+
outputs: [
|
|
172
|
+
{ name: '', internalType: 'enum IHasCoinType.CoinType', type: 'uint8' },
|
|
173
|
+
],
|
|
174
|
+
stateMutability: 'view',
|
|
175
|
+
},
|
|
167
176
|
{
|
|
168
177
|
type: 'function',
|
|
169
178
|
inputs: [],
|
|
@@ -545,6 +554,13 @@ export const baseCoinABI = [
|
|
|
545
554
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
546
555
|
stateMutability: 'view',
|
|
547
556
|
},
|
|
557
|
+
{
|
|
558
|
+
type: 'function',
|
|
559
|
+
inputs: [],
|
|
560
|
+
name: 'totalSupplyForPositions',
|
|
561
|
+
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
562
|
+
stateMutability: 'view',
|
|
563
|
+
},
|
|
548
564
|
{
|
|
549
565
|
type: 'function',
|
|
550
566
|
inputs: [
|
|
@@ -1341,6 +1357,15 @@ export const contentCoinABI = [
|
|
|
1341
1357
|
outputs: [],
|
|
1342
1358
|
stateMutability: 'nonpayable',
|
|
1343
1359
|
},
|
|
1360
|
+
{
|
|
1361
|
+
type: 'function',
|
|
1362
|
+
inputs: [],
|
|
1363
|
+
name: 'coinType',
|
|
1364
|
+
outputs: [
|
|
1365
|
+
{ name: '', internalType: 'enum IHasCoinType.CoinType', type: 'uint8' },
|
|
1366
|
+
],
|
|
1367
|
+
stateMutability: 'pure',
|
|
1368
|
+
},
|
|
1344
1369
|
{
|
|
1345
1370
|
type: 'function',
|
|
1346
1371
|
inputs: [],
|
|
@@ -1722,6 +1747,13 @@ export const contentCoinABI = [
|
|
|
1722
1747
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
1723
1748
|
stateMutability: 'view',
|
|
1724
1749
|
},
|
|
1750
|
+
{
|
|
1751
|
+
type: 'function',
|
|
1752
|
+
inputs: [],
|
|
1753
|
+
name: 'totalSupplyForPositions',
|
|
1754
|
+
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
1755
|
+
stateMutability: 'pure',
|
|
1756
|
+
},
|
|
1725
1757
|
{
|
|
1726
1758
|
type: 'function',
|
|
1727
1759
|
inputs: [
|
|
@@ -2349,17 +2381,17 @@ export const creatorCoinABI = [
|
|
|
2349
2381
|
type: 'constructor',
|
|
2350
2382
|
inputs: [
|
|
2351
2383
|
{
|
|
2352
|
-
name: '
|
|
2384
|
+
name: 'protocolRewardRecipient_',
|
|
2353
2385
|
internalType: 'address',
|
|
2354
2386
|
type: 'address',
|
|
2355
2387
|
},
|
|
2356
|
-
{ name: '
|
|
2388
|
+
{ name: 'protocolRewards_', internalType: 'address', type: 'address' },
|
|
2357
2389
|
{
|
|
2358
|
-
name: '
|
|
2390
|
+
name: 'poolManager_',
|
|
2359
2391
|
internalType: 'contract IPoolManager',
|
|
2360
2392
|
type: 'address',
|
|
2361
2393
|
},
|
|
2362
|
-
{ name: '
|
|
2394
|
+
{ name: 'airlock_', internalType: 'address', type: 'address' },
|
|
2363
2395
|
],
|
|
2364
2396
|
stateMutability: 'nonpayable',
|
|
2365
2397
|
},
|
|
@@ -2434,6 +2466,15 @@ export const creatorCoinABI = [
|
|
|
2434
2466
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
2435
2467
|
stateMutability: 'nonpayable',
|
|
2436
2468
|
},
|
|
2469
|
+
{
|
|
2470
|
+
type: 'function',
|
|
2471
|
+
inputs: [],
|
|
2472
|
+
name: 'coinType',
|
|
2473
|
+
outputs: [
|
|
2474
|
+
{ name: '', internalType: 'enum IHasCoinType.CoinType', type: 'uint8' },
|
|
2475
|
+
],
|
|
2476
|
+
stateMutability: 'pure',
|
|
2477
|
+
},
|
|
2437
2478
|
{
|
|
2438
2479
|
type: 'function',
|
|
2439
2480
|
inputs: [],
|
|
@@ -2829,6 +2870,13 @@ export const creatorCoinABI = [
|
|
|
2829
2870
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
2830
2871
|
stateMutability: 'view',
|
|
2831
2872
|
},
|
|
2873
|
+
{
|
|
2874
|
+
type: 'function',
|
|
2875
|
+
inputs: [],
|
|
2876
|
+
name: 'totalSupplyForPositions',
|
|
2877
|
+
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
2878
|
+
stateMutability: 'pure',
|
|
2879
|
+
},
|
|
2832
2880
|
{
|
|
2833
2881
|
type: 'function',
|
|
2834
2882
|
inputs: [
|
|
@@ -4213,10 +4261,10 @@ export const zoraFactoryImplABI = [
|
|
|
4213
4261
|
{
|
|
4214
4262
|
type: 'constructor',
|
|
4215
4263
|
inputs: [
|
|
4216
|
-
{ name: '
|
|
4217
|
-
{ name: '
|
|
4218
|
-
{ name: '
|
|
4219
|
-
{ name: '
|
|
4264
|
+
{ name: 'coinV4Impl_', internalType: 'address', type: 'address' },
|
|
4265
|
+
{ name: 'creatorCoinImpl_', internalType: 'address', type: 'address' },
|
|
4266
|
+
{ name: 'hook_', internalType: 'address', type: 'address' },
|
|
4267
|
+
{ name: 'zoraHookRegistry_', internalType: 'address', type: 'address' },
|
|
4220
4268
|
],
|
|
4221
4269
|
stateMutability: 'nonpayable',
|
|
4222
4270
|
},
|
|
@@ -4301,7 +4349,7 @@ export const zoraFactoryImplABI = [
|
|
|
4301
4349
|
{ name: 'platformReferrer', internalType: 'address', type: 'address' },
|
|
4302
4350
|
{ name: 'currency', internalType: 'address', type: 'address' },
|
|
4303
4351
|
{ name: '', internalType: 'int24', type: 'int24' },
|
|
4304
|
-
{ name: '
|
|
4352
|
+
{ name: '', internalType: 'uint256', type: 'uint256' },
|
|
4305
4353
|
],
|
|
4306
4354
|
name: 'deploy',
|
|
4307
4355
|
outputs: [
|
|
@@ -4376,7 +4424,7 @@ export const zoraFactoryImplABI = [
|
|
|
4376
4424
|
{ name: 'symbol', internalType: 'string', type: 'string' },
|
|
4377
4425
|
{ name: 'poolConfig', internalType: 'bytes', type: 'bytes' },
|
|
4378
4426
|
{ name: 'platformReferrer', internalType: 'address', type: 'address' },
|
|
4379
|
-
{ name: '
|
|
4427
|
+
{ name: 'deployHook', internalType: 'address', type: 'address' },
|
|
4380
4428
|
{ name: 'hookData', internalType: 'bytes', type: 'bytes' },
|
|
4381
4429
|
],
|
|
4382
4430
|
name: 'deployWithHook',
|
|
@@ -4393,6 +4441,13 @@ export const zoraFactoryImplABI = [
|
|
|
4393
4441
|
outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }],
|
|
4394
4442
|
stateMutability: 'view',
|
|
4395
4443
|
},
|
|
4444
|
+
{
|
|
4445
|
+
type: 'function',
|
|
4446
|
+
inputs: [],
|
|
4447
|
+
name: 'hook',
|
|
4448
|
+
outputs: [{ name: '', internalType: 'address', type: 'address' }],
|
|
4449
|
+
stateMutability: 'view',
|
|
4450
|
+
},
|
|
4396
4451
|
{
|
|
4397
4452
|
type: 'function',
|
|
4398
4453
|
inputs: [],
|
|
@@ -4454,6 +4509,13 @@ export const zoraFactoryImplABI = [
|
|
|
4454
4509
|
outputs: [],
|
|
4455
4510
|
stateMutability: 'payable',
|
|
4456
4511
|
},
|
|
4512
|
+
{
|
|
4513
|
+
type: 'function',
|
|
4514
|
+
inputs: [],
|
|
4515
|
+
name: 'zoraHookRegistry',
|
|
4516
|
+
outputs: [{ name: '', internalType: 'address', type: 'address' }],
|
|
4517
|
+
stateMutability: 'view',
|
|
4518
|
+
},
|
|
4457
4519
|
{
|
|
4458
4520
|
type: 'event',
|
|
4459
4521
|
anonymous: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoralabs/coins",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -35,12 +35,14 @@
|
|
|
35
35
|
"tsx": "^3.13.0",
|
|
36
36
|
"typescript": "^5.2.2",
|
|
37
37
|
"viem": "^2.21.18",
|
|
38
|
-
"@zoralabs/tsconfig": "^0.0.1",
|
|
39
38
|
"@zoralabs/shared-contracts": "^0.0.5",
|
|
40
|
-
"@zoralabs/shared-scripts": "^0.0.0"
|
|
39
|
+
"@zoralabs/shared-scripts": "^0.0.0",
|
|
40
|
+
"@zoralabs/tsconfig": "^0.0.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
|
-
"build": "
|
|
43
|
+
"build": "forge build",
|
|
44
|
+
"build:contracts:minimal": "forge build --skip test --skip script --no-metadata",
|
|
45
|
+
"build:js": "pnpm run wagmi:generate && pnpm run copy-abis && pnpm run prettier:write && tsup",
|
|
44
46
|
"build:sizes": "forge build src/ --sizes",
|
|
45
47
|
"copy-abis": "pnpm exec bundle-abis",
|
|
46
48
|
"coverage": "forge coverage --report lcov --ir-minimum --no-match-coverage '(test/|src/utils/uniswap/|script/)'",
|
|
@@ -49,6 +51,6 @@
|
|
|
49
51
|
"test": "forge test -vv",
|
|
50
52
|
"test-gas": "forge test --gas-report",
|
|
51
53
|
"update-contract-version": "pnpm exec update-contract-version",
|
|
52
|
-
"wagmi:generate": "
|
|
54
|
+
"wagmi:generate": "pnpm run build:contracts:minimal && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts"
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -12,24 +12,17 @@ contract DeployScript is CoinsDeployerBase {
|
|
|
12
12
|
CoinsDeployment memory deployment = readDeployment(false);
|
|
13
13
|
|
|
14
14
|
address existingContentCoinHook = 0xd3D133469ADC85e01A4887404D8AC12d630e9040;
|
|
15
|
-
address existingCreatorCoinHook = 0xffF800B76768dA8AB6aab527021e4a6A91219040;
|
|
16
15
|
|
|
17
16
|
address[] memory baseImpls = new address[](1);
|
|
18
17
|
baseImpls[0] = existingContentCoinHook;
|
|
19
18
|
|
|
20
19
|
bytes memory contentCoinUpgradeCall = abi.encodeWithSelector(IHooksUpgradeGate.registerUpgradePath.selector, baseImpls, deployment.zoraV4CoinHook);
|
|
21
20
|
|
|
22
|
-
baseImpls[0] = existingCreatorCoinHook;
|
|
23
|
-
|
|
24
|
-
bytes memory creatorCoinUpgradeCall = abi.encodeWithSelector(IHooksUpgradeGate.registerUpgradePath.selector, baseImpls, deployment.creatorCoinHook);
|
|
25
|
-
|
|
26
21
|
printUpgradeFactoryCommand(deployment);
|
|
27
22
|
|
|
28
23
|
console.log("register upgrade gate target", deployment.hookUpgradeGate);
|
|
29
24
|
|
|
30
25
|
console.log("contentCoinUpgradeCall");
|
|
31
26
|
console.logBytes(contentCoinUpgradeCall);
|
|
32
|
-
console.log("creatorCoinUpgradeCall");
|
|
33
|
-
console.logBytes(creatorCoinUpgradeCall);
|
|
34
27
|
}
|
|
35
28
|
}
|
|
@@ -104,7 +104,6 @@ contract TestV4Swap is CoinsDeployerBase {
|
|
|
104
104
|
vm.startBroadcast(trader);
|
|
105
105
|
|
|
106
106
|
address createReferral = 0xC077e4cC02fa01A5b7fAca1acE9BBe9f5ac5Af9F;
|
|
107
|
-
address tradeReferral = 0xC077e4cC02fa01A5b7fAca1acE9BBe9f5ac5Af9F;
|
|
108
107
|
|
|
109
108
|
ICoin backingCoin = _deployCoin(zora, trader, "Backing Coin", "BACK", "https://testc.com", createReferral, bytes32("creator"));
|
|
110
109
|
ICoin contentCoin = _deployCoin(
|
package/script/TestV4Swap.s.sol
CHANGED
|
@@ -96,7 +96,6 @@ contract TestV4Swap is CoinsDeployerBase {
|
|
|
96
96
|
|
|
97
97
|
vm.startBroadcast(trader);
|
|
98
98
|
|
|
99
|
-
address createReferral = 0xC077e4cC02fa01A5b7fAca1acE9BBe9f5ac5Af9F;
|
|
100
99
|
address tradeReferral = 0xC077e4cC02fa01A5b7fAca1acE9BBe9f5ac5Af9F;
|
|
101
100
|
|
|
102
101
|
// MockERC20 currency = _deployMockCurrency();
|
|
@@ -14,7 +14,7 @@ contract UpgradeFactoryImpl is CoinsDeployerBase {
|
|
|
14
14
|
deployment.coinV4Impl,
|
|
15
15
|
deployment.creatorCoinImpl,
|
|
16
16
|
deployment.zoraV4CoinHook,
|
|
17
|
-
deployment.
|
|
17
|
+
deployment.zoraHookRegistry
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
deployment.zoraFactoryImpl = address(zoraFactoryImpl);
|
package/src/BaseCoin.sol
CHANGED
|
@@ -9,7 +9,7 @@ pragma solidity ^0.8.23;
|
|
|
9
9
|
|
|
10
10
|
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
11
11
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
12
|
-
import {ICoin} from "./interfaces/ICoin.sol";
|
|
12
|
+
import {ICoin, IHasTotalSupplyForPositions, IHasCoinType} from "./interfaces/ICoin.sol";
|
|
13
13
|
import {IHasRewardsRecipients} from "./interfaces/IHasRewardsRecipients.sol";
|
|
14
14
|
import {ICoinComments} from "./interfaces/ICoinComments.sol";
|
|
15
15
|
import {IERC7572} from "./interfaces/IERC7572.sol";
|
|
@@ -89,28 +89,29 @@ abstract contract BaseCoin is ICoin, ContractVersionBase, ERC20PermitUpgradeable
|
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* @notice The constructor for the static Coin contract deployment shared across all Coins.
|
|
92
|
-
* @param
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
92
|
+
* @param protocolRewardRecipient_ The address of the protocol reward recipient
|
|
93
|
+
* @param protocolRewards_ The address of the protocol rewards contract
|
|
94
|
+
* @param poolManager_ The address of the pool manager
|
|
95
|
+
* @param airlock_ The address of the Airlock contract
|
|
95
96
|
*/
|
|
96
|
-
constructor(address
|
|
97
|
-
if (
|
|
97
|
+
constructor(address protocolRewardRecipient_, address protocolRewards_, IPoolManager poolManager_, address airlock_) initializer {
|
|
98
|
+
if (protocolRewardRecipient_ == address(0)) {
|
|
98
99
|
revert AddressZero();
|
|
99
100
|
}
|
|
100
|
-
if (
|
|
101
|
+
if (protocolRewards_ == address(0)) {
|
|
101
102
|
revert AddressZero();
|
|
102
103
|
}
|
|
103
104
|
if (address(poolManager_) == address(0)) {
|
|
104
105
|
revert AddressZero();
|
|
105
106
|
}
|
|
106
|
-
if (
|
|
107
|
+
if (airlock_ == address(0)) {
|
|
107
108
|
revert AddressZero();
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
protocolRewardRecipient =
|
|
111
|
-
protocolRewards =
|
|
111
|
+
protocolRewardRecipient = protocolRewardRecipient_;
|
|
112
|
+
protocolRewards = protocolRewards_;
|
|
112
113
|
poolManager = poolManager_;
|
|
113
|
-
airlock =
|
|
114
|
+
airlock = airlock_;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
/// @inheritdoc ICoin
|
|
@@ -258,7 +259,9 @@ abstract contract BaseCoin is ICoin, ContractVersionBase, ERC20PermitUpgradeable
|
|
|
258
259
|
interfaceId == type(IERC7572).interfaceId ||
|
|
259
260
|
interfaceId == type(IHasRewardsRecipients).interfaceId ||
|
|
260
261
|
interfaceId == type(IHasPoolKey).interfaceId ||
|
|
261
|
-
type(
|
|
262
|
+
interfaceId == type(IHasCoinType).interfaceId ||
|
|
263
|
+
interfaceId == type(IHasTotalSupplyForPositions).interfaceId ||
|
|
264
|
+
interfaceId == type(IHasSwapPath).interfaceId;
|
|
262
265
|
}
|
|
263
266
|
|
|
264
267
|
/// @dev Overrides ERC20's _update function to emit a superset `CoinTransfer` event
|
package/src/ContentCoin.sol
CHANGED
|
@@ -10,6 +10,8 @@ pragma solidity ^0.8.23;
|
|
|
10
10
|
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
|
|
11
11
|
import {BaseCoin} from "./BaseCoin.sol";
|
|
12
12
|
import {CoinConstants} from "./libs/CoinConstants.sol";
|
|
13
|
+
import {MarketConstants} from "./libs/MarketConstants.sol";
|
|
14
|
+
import {IHasCoinType} from "./interfaces/ICoin.sol";
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* @title ContentCoin
|
|
@@ -42,4 +44,12 @@ contract ContentCoin is BaseCoin {
|
|
|
42
44
|
// Transfer the market supply to the hook for liquidity
|
|
43
45
|
_transfer(address(this), address(poolKey.hooks), balanceOf(address(this)));
|
|
44
46
|
}
|
|
47
|
+
|
|
48
|
+
function totalSupplyForPositions() external pure override returns (uint256) {
|
|
49
|
+
return MarketConstants.CONTENT_COIN_MARKET_SUPPLY;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function coinType() external pure override returns (IHasCoinType.CoinType) {
|
|
53
|
+
return IHasCoinType.CoinType.Content;
|
|
54
|
+
}
|
|
45
55
|
}
|
package/src/CreatorCoin.sol
CHANGED
|
@@ -12,6 +12,8 @@ import {CreatorCoinConstants} from "./libs/CreatorCoinConstants.sol";
|
|
|
12
12
|
import {IHooks, PoolConfiguration, PoolKey, ICoin} from "./interfaces/ICoin.sol";
|
|
13
13
|
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
|
|
14
14
|
import {BaseCoin} from "./BaseCoin.sol";
|
|
15
|
+
import {IHasCoinType} from "./interfaces/ICoin.sol";
|
|
16
|
+
import {MarketConstants} from "./libs/MarketConstants.sol";
|
|
15
17
|
|
|
16
18
|
contract CreatorCoin is ICreatorCoin, BaseCoin {
|
|
17
19
|
uint256 public vestingStartTime;
|
|
@@ -19,11 +21,19 @@ contract CreatorCoin is ICreatorCoin, BaseCoin {
|
|
|
19
21
|
uint256 public totalClaimed;
|
|
20
22
|
|
|
21
23
|
constructor(
|
|
22
|
-
address
|
|
23
|
-
address
|
|
24
|
-
IPoolManager
|
|
25
|
-
address
|
|
26
|
-
) BaseCoin(
|
|
24
|
+
address protocolRewardRecipient_,
|
|
25
|
+
address protocolRewards_,
|
|
26
|
+
IPoolManager poolManager_,
|
|
27
|
+
address airlock_
|
|
28
|
+
) BaseCoin(protocolRewardRecipient_, protocolRewards_, poolManager_, airlock_) initializer {}
|
|
29
|
+
|
|
30
|
+
function totalSupplyForPositions() external pure override returns (uint256) {
|
|
31
|
+
return MarketConstants.CREATOR_COIN_MARKET_SUPPLY;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function coinType() external pure override returns (IHasCoinType.CoinType) {
|
|
35
|
+
return IHasCoinType.CoinType.Creator;
|
|
36
|
+
}
|
|
27
37
|
|
|
28
38
|
function initialize(
|
|
29
39
|
address payoutRecipient_,
|
|
@@ -39,7 +49,18 @@ contract CreatorCoin is ICreatorCoin, BaseCoin {
|
|
|
39
49
|
) public override(BaseCoin, ICoin) {
|
|
40
50
|
require(currency_ == CreatorCoinConstants.CURRENCY, InvalidCurrency());
|
|
41
51
|
|
|
42
|
-
super.initialize(
|
|
52
|
+
super.initialize({
|
|
53
|
+
payoutRecipient_: payoutRecipient_,
|
|
54
|
+
owners_: owners_,
|
|
55
|
+
tokenURI_: tokenURI_,
|
|
56
|
+
name_: name_,
|
|
57
|
+
symbol_: symbol_,
|
|
58
|
+
platformReferrer_: platformReferrer_,
|
|
59
|
+
currency_: currency_,
|
|
60
|
+
poolKey_: poolKey_,
|
|
61
|
+
sqrtPriceX96: sqrtPriceX96,
|
|
62
|
+
poolConfiguration_: poolConfiguration_
|
|
63
|
+
});
|
|
43
64
|
|
|
44
65
|
vestingStartTime = block.timestamp;
|
|
45
66
|
vestingEndTime = block.timestamp + CreatorCoinConstants.CREATOR_VESTING_DURATION;
|
|
@@ -50,7 +71,7 @@ contract CreatorCoin is ICreatorCoin, BaseCoin {
|
|
|
50
71
|
function _handleInitialDistribution() internal override {
|
|
51
72
|
_mint(address(this), CreatorCoinConstants.TOTAL_SUPPLY);
|
|
52
73
|
|
|
53
|
-
_transfer(address(this), address(poolKey.hooks),
|
|
74
|
+
_transfer(address(this), address(poolKey.hooks), MarketConstants.CREATOR_COIN_MARKET_SUPPLY);
|
|
54
75
|
}
|
|
55
76
|
|
|
56
77
|
/// @notice Allows the creator payout recipient to claim vested tokens
|