@zoralabs/coins 0.9.0 → 1.0.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 +179 -114
- package/CHANGELOG.md +46 -0
- package/abis/BaseCoin.json +26 -118
- package/abis/BaseTest.json +47 -0
- package/abis/BuySupplyWithSwapRouterHook.json +40 -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 +1091 -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 +1515 -0
- package/abis/HooksDeployment.json +23 -0
- package/abis/HooksTest.json +60 -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 +210 -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 +81 -0
- package/abis/Vm.json +1482 -111
- package/abis/VmSafe.json +856 -32
- package/abis/ZoraFactoryImpl.json +339 -1
- package/abis/ZoraV4CoinHook.json +442 -5
- package/addresses/8453.json +7 -4
- package/addresses/84532.json +8 -5
- package/addresses/dev/8453.json +10 -0
- package/dist/index.cjs +1932 -167
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1928 -167
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +2606 -160
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/foundry.toml +1 -0
- package/package/wagmiGenerated.ts +1941 -164
- package/package.json +8 -3
- package/remappings.txt +6 -1
- package/script/Deploy.s.sol +1 -1
- package/script/DeployDevFactory.s.sol +21 -0
- package/script/DeployHooks.s.sol +1 -1
- package/script/PrintUpgradeCommand.s.sol +13 -0
- package/script/Simulate.s.sol +1 -10
- package/script/TestBackingCoinSwap.s.sol +147 -0
- package/script/TestV4Swap.s.sol +136 -0
- package/script/UpgradeCoinImpl.sol +2 -2
- package/script/UpgradeFactoryImpl.s.sol +2 -2
- package/src/BaseCoin.sol +190 -0
- package/src/Coin.sol +87 -202
- package/src/CoinV4.sol +121 -0
- package/src/ZoraFactoryImpl.sol +208 -36
- package/{script → src/deployment}/CoinsDeployerBase.sol +111 -17
- package/src/hooks/ZoraV4CoinHook.sol +212 -0
- package/src/hooks/{BaseCoinDeployHook.sol → deployment/BaseCoinDeployHook.sol} +3 -3
- package/src/hooks/deployment/BuySupplyWithSwapRouterHook.sol +140 -0
- 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 +67 -28
- 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 +179 -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 +128 -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 +122 -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 +777 -0
- package/test/{Hooks.t.sol → DeploymentHooks.t.sol} +53 -16
- package/test/Factory.t.sol +80 -47
- package/test/MultiOwnable.t.sol +6 -3
- package/test/Upgrades.t.sol +97 -5
- package/test/mocks/MockERC20.sol +12 -0
- package/test/utils/BaseTest.sol +162 -57
- 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/hooks/BuySupplyWithSwapRouterHook.sol +0 -78
- package/src/libs/CoinLegacy.sol +0 -48
- package/src/libs/CoinLegacyMarket.sol +0 -182
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "error",
|
|
4
|
+
"name": "HookNotDeployed",
|
|
5
|
+
"inputs": []
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"type": "error",
|
|
9
|
+
"name": "InvalidHookAddress",
|
|
10
|
+
"inputs": [
|
|
11
|
+
{
|
|
12
|
+
"name": "expected",
|
|
13
|
+
"type": "address",
|
|
14
|
+
"internalType": "address"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "actual",
|
|
18
|
+
"type": "address",
|
|
19
|
+
"internalType": "address"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
package/abis/HooksTest.json
CHANGED
|
@@ -263,6 +263,19 @@
|
|
|
263
263
|
"outputs": [],
|
|
264
264
|
"stateMutability": "nonpayable"
|
|
265
265
|
},
|
|
266
|
+
{
|
|
267
|
+
"type": "function",
|
|
268
|
+
"name": "test_buySupplyWithEthUsingV4Hook_withExactInputMultiHop",
|
|
269
|
+
"inputs": [
|
|
270
|
+
{
|
|
271
|
+
"name": "initialOrderSize",
|
|
272
|
+
"type": "uint256",
|
|
273
|
+
"internalType": "uint256"
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"outputs": [],
|
|
277
|
+
"stateMutability": "nonpayable"
|
|
278
|
+
},
|
|
266
279
|
{
|
|
267
280
|
"type": "function",
|
|
268
281
|
"name": "test_deployWithHook_revertsWhenEthAndNoHook",
|
|
@@ -647,5 +660,52 @@
|
|
|
647
660
|
}
|
|
648
661
|
],
|
|
649
662
|
"anonymous": false
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"type": "error",
|
|
666
|
+
"name": "Create2EmptyBytecode",
|
|
667
|
+
"inputs": []
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"type": "error",
|
|
671
|
+
"name": "Create2FailedDeployment",
|
|
672
|
+
"inputs": []
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"type": "error",
|
|
676
|
+
"name": "Create2InsufficientBalance",
|
|
677
|
+
"inputs": [
|
|
678
|
+
{
|
|
679
|
+
"name": "balance",
|
|
680
|
+
"type": "uint256",
|
|
681
|
+
"internalType": "uint256"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "needed",
|
|
685
|
+
"type": "uint256",
|
|
686
|
+
"internalType": "uint256"
|
|
687
|
+
}
|
|
688
|
+
]
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"type": "error",
|
|
692
|
+
"name": "HookNotDeployed",
|
|
693
|
+
"inputs": []
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"type": "error",
|
|
697
|
+
"name": "InvalidHookAddress",
|
|
698
|
+
"inputs": [
|
|
699
|
+
{
|
|
700
|
+
"name": "expected",
|
|
701
|
+
"type": "address",
|
|
702
|
+
"internalType": "address"
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"name": "actual",
|
|
706
|
+
"type": "address",
|
|
707
|
+
"internalType": "address"
|
|
708
|
+
}
|
|
709
|
+
]
|
|
650
710
|
}
|
|
651
711
|
]
|
package/abis/ICoin.json
CHANGED
|
@@ -1,60 +1,29 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"type": "function",
|
|
4
|
-
"name": "
|
|
5
|
-
"inputs": [
|
|
4
|
+
"name": "airlock",
|
|
5
|
+
"inputs": [],
|
|
6
|
+
"outputs": [
|
|
6
7
|
{
|
|
7
|
-
"name": "
|
|
8
|
-
"type": "
|
|
9
|
-
"internalType": "
|
|
8
|
+
"name": "",
|
|
9
|
+
"type": "address",
|
|
10
|
+
"internalType": "address"
|
|
10
11
|
}
|
|
11
12
|
],
|
|
12
|
-
"
|
|
13
|
-
"stateMutability": "nonpayable"
|
|
13
|
+
"stateMutability": "view"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"type": "function",
|
|
17
|
-
"name": "
|
|
17
|
+
"name": "burn",
|
|
18
18
|
"inputs": [
|
|
19
19
|
{
|
|
20
|
-
"name": "
|
|
21
|
-
"type": "address",
|
|
22
|
-
"internalType": "address"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"name": "orderSize",
|
|
26
|
-
"type": "uint256",
|
|
27
|
-
"internalType": "uint256"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "minAmountOut",
|
|
31
|
-
"type": "uint256",
|
|
32
|
-
"internalType": "uint256"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "sqrtPriceLimitX96",
|
|
36
|
-
"type": "uint160",
|
|
37
|
-
"internalType": "uint160"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "tradeReferrer",
|
|
41
|
-
"type": "address",
|
|
42
|
-
"internalType": "address"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"outputs": [
|
|
46
|
-
{
|
|
47
|
-
"name": "",
|
|
48
|
-
"type": "uint256",
|
|
49
|
-
"internalType": "uint256"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"name": "",
|
|
20
|
+
"name": "amount",
|
|
53
21
|
"type": "uint256",
|
|
54
22
|
"internalType": "uint256"
|
|
55
23
|
}
|
|
56
24
|
],
|
|
57
|
-
"
|
|
25
|
+
"outputs": [],
|
|
26
|
+
"stateMutability": "nonpayable"
|
|
58
27
|
},
|
|
59
28
|
{
|
|
60
29
|
"type": "function",
|
|
@@ -84,7 +53,7 @@
|
|
|
84
53
|
},
|
|
85
54
|
{
|
|
86
55
|
"type": "function",
|
|
87
|
-
"name": "
|
|
56
|
+
"name": "dopplerFeeRecipient",
|
|
88
57
|
"inputs": [],
|
|
89
58
|
"outputs": [
|
|
90
59
|
{
|
|
@@ -97,47 +66,42 @@
|
|
|
97
66
|
},
|
|
98
67
|
{
|
|
99
68
|
"type": "function",
|
|
100
|
-
"name": "
|
|
101
|
-
"inputs": [
|
|
69
|
+
"name": "payoutRecipient",
|
|
70
|
+
"inputs": [],
|
|
71
|
+
"outputs": [
|
|
102
72
|
{
|
|
103
|
-
"name": "
|
|
73
|
+
"name": "",
|
|
104
74
|
"type": "address",
|
|
105
75
|
"internalType": "address"
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"internalType": "uint256"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"name": "sqrtPriceLimitX96",
|
|
119
|
-
"type": "uint160",
|
|
120
|
-
"internalType": "uint160"
|
|
121
|
-
},
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"stateMutability": "view"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "function",
|
|
82
|
+
"name": "platformReferrer",
|
|
83
|
+
"inputs": [],
|
|
84
|
+
"outputs": [
|
|
122
85
|
{
|
|
123
|
-
"name": "
|
|
86
|
+
"name": "",
|
|
124
87
|
"type": "address",
|
|
125
88
|
"internalType": "address"
|
|
126
89
|
}
|
|
127
90
|
],
|
|
91
|
+
"stateMutability": "view"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "function",
|
|
95
|
+
"name": "protocolRewardRecipient",
|
|
96
|
+
"inputs": [],
|
|
128
97
|
"outputs": [
|
|
129
98
|
{
|
|
130
99
|
"name": "",
|
|
131
|
-
"type": "
|
|
132
|
-
"internalType": "
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"name": "",
|
|
136
|
-
"type": "uint256",
|
|
137
|
-
"internalType": "uint256"
|
|
100
|
+
"type": "address",
|
|
101
|
+
"internalType": "address"
|
|
138
102
|
}
|
|
139
103
|
],
|
|
140
|
-
"stateMutability": "
|
|
104
|
+
"stateMutability": "view"
|
|
141
105
|
},
|
|
142
106
|
{
|
|
143
107
|
"type": "function",
|
|
@@ -567,6 +531,11 @@
|
|
|
567
531
|
"name": "InvalidMarketType",
|
|
568
532
|
"inputs": []
|
|
569
533
|
},
|
|
534
|
+
{
|
|
535
|
+
"type": "error",
|
|
536
|
+
"name": "InvalidPoolVersion",
|
|
537
|
+
"inputs": []
|
|
538
|
+
},
|
|
570
539
|
{
|
|
571
540
|
"type": "error",
|
|
572
541
|
"name": "InvalidTickRangeMisordered",
|