@zoralabs/coins 0.9.0 → 1.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 +131 -114
- package/CHANGELOG.md +40 -0
- package/abis/BaseCoin.json +26 -118
- package/abis/BaseTest.json +47 -0
- package/abis/Coin.json +171 -63
- package/abis/CoinDopplerMultiCurve.json +38 -0
- package/abis/CoinRewardsV4.json +54 -0
- package/abis/CoinTest.json +53 -20
- package/abis/CoinUniV4Test.json +1053 -0
- package/abis/CoinV4.json +234 -211
- package/abis/DeployScript.json +47 -0
- package/abis/DeployedCoinVersionLookup.json +21 -0
- package/abis/DeployedCoinVersionLookupTest.json +716 -0
- package/abis/DifferentNamespaceVersionLookup.json +39 -0
- package/abis/DopplerUniswapV3Test.json +49 -93
- package/abis/ERC20.json +310 -0
- package/abis/FactoryTest.json +85 -7
- package/abis/FeeEstimatorHook.json +1528 -0
- package/abis/HooksDeployment.json +23 -0
- package/abis/HooksTest.json +47 -0
- package/abis/ICoin.json +40 -71
- package/abis/ICoinV3.json +879 -0
- package/abis/ICoinV4.json +915 -0
- package/abis/IDeployedCoinVersionLookup.json +21 -0
- package/abis/IERC721.json +36 -36
- package/abis/IHasPoolKey.json +42 -0
- package/abis/IHasRewardsRecipients.json +54 -0
- package/abis/IHasSwapPath.json +60 -0
- package/abis/IMsgSender.json +15 -0
- package/abis/IPoolConfigEncoding.json +46 -0
- package/abis/ISwapPathRouter.json +92 -0
- package/abis/IUniversalRouter.json +61 -0
- package/abis/IUnlockCallback.json +21 -0
- package/abis/IV4Quoter.json +310 -0
- package/abis/IZoraFactory.json +191 -11
- package/abis/IZoraV4CoinHook.json +348 -4
- package/abis/MockERC20.json +21 -0
- package/abis/MultiOwnableTest.json +47 -0
- package/abis/{CoinConfigurationVersions.json → Position.json} +1 -1
- package/abis/PrintUpgradeCommand.json +9 -0
- package/abis/ProxyShim.json +24 -0
- package/abis/StateLibrary.json +80 -0
- package/abis/TestDeployedCoinVersionLookupImplementation.json +39 -0
- package/abis/TestV4Swap.json +9 -0
- package/abis/UpgradeCoinImpl.json +47 -0
- package/abis/UpgradesTest.json +67 -0
- package/abis/Vm.json +1482 -111
- package/abis/VmSafe.json +856 -32
- package/abis/ZoraFactoryImpl.json +339 -1
- package/abis/ZoraV4CoinHook.json +455 -5
- package/addresses/8453.json +8 -4
- package/addresses/84532.json +8 -4
- package/dist/index.cjs +1920 -169
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1916 -169
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +2599 -183
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/wagmiGenerated.ts +1928 -165
- package/package.json +8 -3
- package/remappings.txt +6 -1
- package/script/CoinsDeployerBase.sol +74 -11
- package/script/DeployDevFactory.s.sol +21 -0
- package/script/PrintUpgradeCommand.s.sol +13 -0
- package/script/Simulate.s.sol +1 -10
- package/script/TestBackingCoinSwap.s.sol +146 -0
- package/script/TestV4Swap.s.sol +136 -0
- package/script/UpgradeFactoryImpl.s.sol +1 -1
- package/src/BaseCoin.sol +176 -0
- package/src/Coin.sol +87 -202
- package/src/CoinV4.sol +121 -0
- package/src/ZoraFactoryImpl.sol +208 -36
- package/src/hooks/ZoraV4CoinHook.sol +195 -0
- package/src/hooks/{BaseCoinDeployHook.sol → deployment/BaseCoinDeployHook.sol} +3 -3
- package/src/hooks/{BuySupplyWithSwapRouterHook.sol → deployment/BuySupplyWithSwapRouterHook.sol} +7 -5
- package/src/interfaces/ICoin.sol +31 -39
- package/src/interfaces/ICoinV3.sol +71 -0
- package/src/interfaces/ICoinV4.sol +69 -0
- package/src/interfaces/IDeployedCoinVersionLookup.sol +11 -0
- package/src/interfaces/IMsgSender.sol +9 -0
- package/src/interfaces/IPoolConfigEncoding.sol +14 -0
- package/src/interfaces/ISwapPathRouter.sol +14 -0
- package/src/interfaces/IZoraFactory.sol +65 -27
- package/src/interfaces/IZoraV4CoinHook.sol +116 -0
- package/src/libs/CoinCommon.sol +15 -0
- package/src/libs/CoinConfigurationVersions.sol +116 -1
- package/src/libs/CoinConstants.sol +5 -0
- package/src/libs/CoinDopplerMultiCurve.sol +134 -0
- package/src/libs/CoinDopplerUniV3.sol +19 -171
- package/src/libs/CoinRewards.sol +195 -0
- package/src/libs/CoinRewardsV4.sol +180 -0
- package/src/libs/CoinSetup.sol +57 -0
- package/src/libs/CoinSetupV3.sol +6 -67
- package/src/libs/DopplerMath.sol +156 -0
- package/src/libs/HooksDeployment.sol +84 -0
- package/src/libs/MarketConstants.sol +4 -0
- package/src/libs/PoolStateReader.sol +22 -0
- package/src/libs/UniV3BuySell.sol +74 -292
- package/src/libs/UniV4SwapHelper.sol +65 -0
- package/src/libs/UniV4SwapToCurrency.sol +109 -0
- package/src/libs/V4Liquidity.sol +129 -0
- package/src/types/PoolConfiguration.sol +15 -0
- package/src/utils/DeployedCoinVersionLookup.sol +52 -0
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/Coin.t.sol +78 -88
- package/test/CoinDopplerUniV3.t.sol +32 -171
- package/test/CoinUniV4.t.sol +752 -0
- package/test/{Hooks.t.sol → DeploymentHooks.t.sol} +2 -6
- package/test/Factory.t.sol +80 -47
- package/test/MultiOwnable.t.sol +6 -3
- package/test/Upgrades.t.sol +6 -5
- package/test/mocks/MockERC20.sol +12 -0
- package/test/utils/BaseTest.sol +106 -56
- package/test/utils/DeployedCoinVersionLookup.t.sol +127 -0
- package/test/utils/FeeEstimatorHook.sol +84 -0
- package/test/utils/ProxyShim.sol +17 -0
- package/wagmi.config.ts +4 -0
- package/.env +0 -1
- package/.turbo/turbo-update-contract-version.log +0 -22
- package/abis/CoinSetupV3.json +0 -7
- package/abis/HookDeployer.json +0 -68
- package/abis/IHookDeployer.json +0 -42
- package/src/libs/CoinLegacy.sol +0 -48
- package/src/libs/CoinLegacyMarket.sol +0 -182
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
"name": "_coinImpl",
|
|
7
7
|
"type": "address",
|
|
8
8
|
"internalType": "address"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "_coinV4Impl",
|
|
12
|
+
"type": "address",
|
|
13
|
+
"internalType": "address"
|
|
9
14
|
}
|
|
10
15
|
],
|
|
11
16
|
"stateMutability": "nonpayable"
|
|
@@ -23,6 +28,50 @@
|
|
|
23
28
|
],
|
|
24
29
|
"stateMutability": "view"
|
|
25
30
|
},
|
|
31
|
+
{
|
|
32
|
+
"type": "function",
|
|
33
|
+
"name": "coinAddress",
|
|
34
|
+
"inputs": [
|
|
35
|
+
{
|
|
36
|
+
"name": "msgSender",
|
|
37
|
+
"type": "address",
|
|
38
|
+
"internalType": "address"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "name",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"internalType": "string"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "symbol",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"internalType": "string"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "poolConfig",
|
|
52
|
+
"type": "bytes",
|
|
53
|
+
"internalType": "bytes"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "platformReferrer",
|
|
57
|
+
"type": "address",
|
|
58
|
+
"internalType": "address"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "coinSalt",
|
|
62
|
+
"type": "bytes32",
|
|
63
|
+
"internalType": "bytes32"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"outputs": [
|
|
67
|
+
{
|
|
68
|
+
"name": "",
|
|
69
|
+
"type": "address",
|
|
70
|
+
"internalType": "address"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"stateMutability": "view"
|
|
74
|
+
},
|
|
26
75
|
{
|
|
27
76
|
"type": "function",
|
|
28
77
|
"name": "coinImpl",
|
|
@@ -36,6 +85,19 @@
|
|
|
36
85
|
],
|
|
37
86
|
"stateMutability": "view"
|
|
38
87
|
},
|
|
88
|
+
{
|
|
89
|
+
"type": "function",
|
|
90
|
+
"name": "coinV4Impl",
|
|
91
|
+
"inputs": [],
|
|
92
|
+
"outputs": [
|
|
93
|
+
{
|
|
94
|
+
"name": "",
|
|
95
|
+
"type": "address",
|
|
96
|
+
"internalType": "address"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"stateMutability": "view"
|
|
100
|
+
},
|
|
39
101
|
{
|
|
40
102
|
"type": "function",
|
|
41
103
|
"name": "contractName",
|
|
@@ -102,7 +164,7 @@
|
|
|
102
164
|
"internalType": "address"
|
|
103
165
|
},
|
|
104
166
|
{
|
|
105
|
-
"name": "
|
|
167
|
+
"name": "",
|
|
106
168
|
"type": "int24",
|
|
107
169
|
"internalType": "int24"
|
|
108
170
|
},
|
|
@@ -126,6 +188,75 @@
|
|
|
126
188
|
],
|
|
127
189
|
"stateMutability": "payable"
|
|
128
190
|
},
|
|
191
|
+
{
|
|
192
|
+
"type": "function",
|
|
193
|
+
"name": "deploy",
|
|
194
|
+
"inputs": [
|
|
195
|
+
{
|
|
196
|
+
"name": "payoutRecipient",
|
|
197
|
+
"type": "address",
|
|
198
|
+
"internalType": "address"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "owners",
|
|
202
|
+
"type": "address[]",
|
|
203
|
+
"internalType": "address[]"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "uri",
|
|
207
|
+
"type": "string",
|
|
208
|
+
"internalType": "string"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "name",
|
|
212
|
+
"type": "string",
|
|
213
|
+
"internalType": "string"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "symbol",
|
|
217
|
+
"type": "string",
|
|
218
|
+
"internalType": "string"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "poolConfig",
|
|
222
|
+
"type": "bytes",
|
|
223
|
+
"internalType": "bytes"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "platformReferrer",
|
|
227
|
+
"type": "address",
|
|
228
|
+
"internalType": "address"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "postDeployHook",
|
|
232
|
+
"type": "address",
|
|
233
|
+
"internalType": "address"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"name": "postDeployHookData",
|
|
237
|
+
"type": "bytes",
|
|
238
|
+
"internalType": "bytes"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "coinSalt",
|
|
242
|
+
"type": "bytes32",
|
|
243
|
+
"internalType": "bytes32"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"outputs": [
|
|
247
|
+
{
|
|
248
|
+
"name": "coin",
|
|
249
|
+
"type": "address",
|
|
250
|
+
"internalType": "address"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "postDeployHookDataOut",
|
|
254
|
+
"type": "bytes",
|
|
255
|
+
"internalType": "bytes"
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
"stateMutability": "payable"
|
|
259
|
+
},
|
|
129
260
|
{
|
|
130
261
|
"type": "function",
|
|
131
262
|
"name": "deploy",
|
|
@@ -249,6 +380,25 @@
|
|
|
249
380
|
],
|
|
250
381
|
"stateMutability": "payable"
|
|
251
382
|
},
|
|
383
|
+
{
|
|
384
|
+
"type": "function",
|
|
385
|
+
"name": "getVersionForDeployedCoin",
|
|
386
|
+
"inputs": [
|
|
387
|
+
{
|
|
388
|
+
"name": "coin",
|
|
389
|
+
"type": "address",
|
|
390
|
+
"internalType": "address"
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
"outputs": [
|
|
394
|
+
{
|
|
395
|
+
"name": "",
|
|
396
|
+
"type": "uint8",
|
|
397
|
+
"internalType": "uint8"
|
|
398
|
+
}
|
|
399
|
+
],
|
|
400
|
+
"stateMutability": "view"
|
|
401
|
+
},
|
|
252
402
|
{
|
|
253
403
|
"type": "function",
|
|
254
404
|
"name": "implementation",
|
|
@@ -406,6 +556,106 @@
|
|
|
406
556
|
],
|
|
407
557
|
"anonymous": false
|
|
408
558
|
},
|
|
559
|
+
{
|
|
560
|
+
"type": "event",
|
|
561
|
+
"name": "CoinCreatedV4",
|
|
562
|
+
"inputs": [
|
|
563
|
+
{
|
|
564
|
+
"name": "caller",
|
|
565
|
+
"type": "address",
|
|
566
|
+
"indexed": true,
|
|
567
|
+
"internalType": "address"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"name": "payoutRecipient",
|
|
571
|
+
"type": "address",
|
|
572
|
+
"indexed": true,
|
|
573
|
+
"internalType": "address"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"name": "platformReferrer",
|
|
577
|
+
"type": "address",
|
|
578
|
+
"indexed": true,
|
|
579
|
+
"internalType": "address"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "currency",
|
|
583
|
+
"type": "address",
|
|
584
|
+
"indexed": false,
|
|
585
|
+
"internalType": "address"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "uri",
|
|
589
|
+
"type": "string",
|
|
590
|
+
"indexed": false,
|
|
591
|
+
"internalType": "string"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"name": "name",
|
|
595
|
+
"type": "string",
|
|
596
|
+
"indexed": false,
|
|
597
|
+
"internalType": "string"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"name": "symbol",
|
|
601
|
+
"type": "string",
|
|
602
|
+
"indexed": false,
|
|
603
|
+
"internalType": "string"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"name": "coin",
|
|
607
|
+
"type": "address",
|
|
608
|
+
"indexed": false,
|
|
609
|
+
"internalType": "address"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"name": "poolKey",
|
|
613
|
+
"type": "tuple",
|
|
614
|
+
"indexed": false,
|
|
615
|
+
"internalType": "struct PoolKey",
|
|
616
|
+
"components": [
|
|
617
|
+
{
|
|
618
|
+
"name": "currency0",
|
|
619
|
+
"type": "address",
|
|
620
|
+
"internalType": "Currency"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"name": "currency1",
|
|
624
|
+
"type": "address",
|
|
625
|
+
"internalType": "Currency"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"name": "fee",
|
|
629
|
+
"type": "uint24",
|
|
630
|
+
"internalType": "uint24"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "tickSpacing",
|
|
634
|
+
"type": "int24",
|
|
635
|
+
"internalType": "int24"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"name": "hooks",
|
|
639
|
+
"type": "address",
|
|
640
|
+
"internalType": "contract IHooks"
|
|
641
|
+
}
|
|
642
|
+
]
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"name": "poolKeyHash",
|
|
646
|
+
"type": "bytes32",
|
|
647
|
+
"indexed": false,
|
|
648
|
+
"internalType": "bytes32"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"name": "version",
|
|
652
|
+
"type": "string",
|
|
653
|
+
"indexed": false,
|
|
654
|
+
"internalType": "string"
|
|
655
|
+
}
|
|
656
|
+
],
|
|
657
|
+
"anonymous": false
|
|
658
|
+
},
|
|
409
659
|
{
|
|
410
660
|
"type": "event",
|
|
411
661
|
"name": "Initialized",
|
|
@@ -473,6 +723,26 @@
|
|
|
473
723
|
}
|
|
474
724
|
]
|
|
475
725
|
},
|
|
726
|
+
{
|
|
727
|
+
"type": "error",
|
|
728
|
+
"name": "ArrayLengthMismatch",
|
|
729
|
+
"inputs": []
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"type": "error",
|
|
733
|
+
"name": "CannotMintZeroLiquidity",
|
|
734
|
+
"inputs": []
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"type": "error",
|
|
738
|
+
"name": "ConfigTickLowerMustBeLessThanTickUpper",
|
|
739
|
+
"inputs": []
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"type": "error",
|
|
743
|
+
"name": "Deprecated",
|
|
744
|
+
"inputs": []
|
|
745
|
+
},
|
|
476
746
|
{
|
|
477
747
|
"type": "error",
|
|
478
748
|
"name": "ERC1167FailedCreateClone",
|
|
@@ -519,11 +789,69 @@
|
|
|
519
789
|
"name": "InvalidInitialization",
|
|
520
790
|
"inputs": []
|
|
521
791
|
},
|
|
792
|
+
{
|
|
793
|
+
"type": "error",
|
|
794
|
+
"name": "InvalidPoolVersion",
|
|
795
|
+
"inputs": []
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"type": "error",
|
|
799
|
+
"name": "InvalidTickRangeMisordered",
|
|
800
|
+
"inputs": [
|
|
801
|
+
{
|
|
802
|
+
"name": "tickLower",
|
|
803
|
+
"type": "int24",
|
|
804
|
+
"internalType": "int24"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"name": "tickUpper",
|
|
808
|
+
"type": "int24",
|
|
809
|
+
"internalType": "int24"
|
|
810
|
+
}
|
|
811
|
+
]
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"type": "error",
|
|
815
|
+
"name": "InvalidTickRangeMisordered",
|
|
816
|
+
"inputs": [
|
|
817
|
+
{
|
|
818
|
+
"name": "tickLower",
|
|
819
|
+
"type": "int24",
|
|
820
|
+
"internalType": "int24"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"name": "tickUpper",
|
|
824
|
+
"type": "int24",
|
|
825
|
+
"internalType": "int24"
|
|
826
|
+
}
|
|
827
|
+
]
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"type": "error",
|
|
831
|
+
"name": "MaxShareToBeSoldExceeded",
|
|
832
|
+
"inputs": [
|
|
833
|
+
{
|
|
834
|
+
"name": "value",
|
|
835
|
+
"type": "uint256",
|
|
836
|
+
"internalType": "uint256"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"name": "limit",
|
|
840
|
+
"type": "uint256",
|
|
841
|
+
"internalType": "uint256"
|
|
842
|
+
}
|
|
843
|
+
]
|
|
844
|
+
},
|
|
522
845
|
{
|
|
523
846
|
"type": "error",
|
|
524
847
|
"name": "NotInitializing",
|
|
525
848
|
"inputs": []
|
|
526
849
|
},
|
|
850
|
+
{
|
|
851
|
+
"type": "error",
|
|
852
|
+
"name": "NumDiscoveryPositionsOutOfRange",
|
|
853
|
+
"inputs": []
|
|
854
|
+
},
|
|
527
855
|
{
|
|
528
856
|
"type": "error",
|
|
529
857
|
"name": "OwnableInvalidOwner",
|
|
@@ -593,5 +921,15 @@
|
|
|
593
921
|
"internalType": "string"
|
|
594
922
|
}
|
|
595
923
|
]
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
"type": "error",
|
|
927
|
+
"name": "ZeroDiscoveryPositions",
|
|
928
|
+
"inputs": []
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
"type": "error",
|
|
932
|
+
"name": "ZeroDiscoverySupplyShare",
|
|
933
|
+
"inputs": []
|
|
596
934
|
}
|
|
597
935
|
]
|