@zoralabs/coins 0.3.0 → 0.3.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 +37 -35
- package/CHANGELOG.md +6 -0
- package/abis/IZoraFactory.json +5 -0
- package/abis/ZoraFactoryImpl.json +5 -0
- package/addresses/8453.json +1 -1
- package/addresses/84532.json +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +4 -0
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/wagmiGenerated.ts +4 -1
- package/package.json +1 -1
- package/src/ZoraFactoryImpl.sol +9 -9
- package/src/interfaces/IZoraFactory.sol +1 -1
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/Coin.t.sol +36 -12
- package/test/Factory.t.sol +89 -95
- package/test/utils/BaseTest.sol +24 -16
package/test/Factory.t.sol
CHANGED
|
@@ -17,12 +17,18 @@ contract FactoryTest is BaseTest {
|
|
|
17
17
|
address[] memory owners = new address[](1);
|
|
18
18
|
owners[0] = users.creator;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
(address coinAddress, ) = factory.deploy(
|
|
21
|
+
users.creator,
|
|
22
|
+
owners,
|
|
23
|
+
"https://test2.com",
|
|
24
|
+
"Test2 Token",
|
|
25
|
+
"TEST2",
|
|
26
|
+
users.platformReferrer,
|
|
27
|
+
address(weth),
|
|
28
|
+
LP_TICK_LOWER_WETH,
|
|
29
|
+
0
|
|
25
30
|
);
|
|
31
|
+
coin = Coin(payable(coinAddress));
|
|
26
32
|
pool = IUniswapV3Pool(coin.poolAddress());
|
|
27
33
|
vm.label(address(coin), "COIN");
|
|
28
34
|
vm.label(address(pool), "POOL");
|
|
@@ -62,21 +68,18 @@ contract FactoryTest is BaseTest {
|
|
|
62
68
|
|
|
63
69
|
vm.deal(users.creator, initialOrderSize);
|
|
64
70
|
vm.prank(users.creator);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
LP_TICK_LOWER_WETH,
|
|
76
|
-
initialOrderSize
|
|
77
|
-
)
|
|
78
|
-
)
|
|
71
|
+
(address coinAddress, ) = factory.deploy{value: initialOrderSize}(
|
|
72
|
+
users.creator,
|
|
73
|
+
owners,
|
|
74
|
+
"https://test2.com",
|
|
75
|
+
"Test2 Token",
|
|
76
|
+
"TEST2",
|
|
77
|
+
users.platformReferrer,
|
|
78
|
+
address(weth),
|
|
79
|
+
LP_TICK_LOWER_WETH,
|
|
80
|
+
initialOrderSize
|
|
79
81
|
);
|
|
82
|
+
coin = Coin(payable(coinAddress));
|
|
80
83
|
pool = IUniswapV3Pool(coin.poolAddress());
|
|
81
84
|
vm.label(address(coin), "COIN");
|
|
82
85
|
vm.label(address(pool), "POOL");
|
|
@@ -102,22 +105,18 @@ contract FactoryTest is BaseTest {
|
|
|
102
105
|
uint256 orderSize = 1 ether;
|
|
103
106
|
vm.deal(users.creator, orderSize);
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
address(weth),
|
|
116
|
-
LP_TICK_LOWER_WETH,
|
|
117
|
-
orderSize
|
|
118
|
-
)
|
|
119
|
-
)
|
|
108
|
+
(address coinAddress, ) = factory.deploy{value: orderSize}(
|
|
109
|
+
users.creator,
|
|
110
|
+
owners,
|
|
111
|
+
"https://test2.com",
|
|
112
|
+
"Test2 Token",
|
|
113
|
+
"TEST2",
|
|
114
|
+
users.platformReferrer,
|
|
115
|
+
address(weth),
|
|
116
|
+
LP_TICK_LOWER_WETH,
|
|
117
|
+
orderSize
|
|
120
118
|
);
|
|
119
|
+
coin = Coin(payable(coinAddress));
|
|
121
120
|
pool = IUniswapV3Pool(coin.poolAddress());
|
|
122
121
|
vm.label(address(coin), "COIN");
|
|
123
122
|
vm.label(address(pool), "POOL");
|
|
@@ -127,22 +126,18 @@ contract FactoryTest is BaseTest {
|
|
|
127
126
|
address[] memory owners = new address[](1);
|
|
128
127
|
owners[0] = users.creator;
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
USDC_ADDRESS,
|
|
141
|
-
USDC_TICK_LOWER,
|
|
142
|
-
0
|
|
143
|
-
)
|
|
144
|
-
)
|
|
129
|
+
(address coinAddress, ) = factory.deploy(
|
|
130
|
+
users.creator,
|
|
131
|
+
owners,
|
|
132
|
+
"https://testcoinusdcpair.com",
|
|
133
|
+
"Testcoinusdcpair",
|
|
134
|
+
"TESTCOINUSDCPAIR",
|
|
135
|
+
users.platformReferrer,
|
|
136
|
+
USDC_ADDRESS,
|
|
137
|
+
USDC_TICK_LOWER,
|
|
138
|
+
0
|
|
145
139
|
);
|
|
140
|
+
coin = Coin(payable(coinAddress));
|
|
146
141
|
pool = IUniswapV3Pool(coin.poolAddress());
|
|
147
142
|
vm.label(address(coin), "COIN");
|
|
148
143
|
vm.label(address(pool), "POOL");
|
|
@@ -190,22 +185,20 @@ contract FactoryTest is BaseTest {
|
|
|
190
185
|
address[] memory owners = new address[](1);
|
|
191
186
|
owners[0] = users.creator;
|
|
192
187
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
USDC_TICK_LOWER,
|
|
204
|
-
0
|
|
205
|
-
)
|
|
206
|
-
)
|
|
188
|
+
(address coinAddress, ) = factory.deploy(
|
|
189
|
+
users.creator,
|
|
190
|
+
owners,
|
|
191
|
+
"https://testcoinusdcpair.com",
|
|
192
|
+
"Testcoinusdcpair",
|
|
193
|
+
"TESTCOINUSDCPAIR",
|
|
194
|
+
address(0),
|
|
195
|
+
USDC_ADDRESS,
|
|
196
|
+
USDC_TICK_LOWER,
|
|
197
|
+
0
|
|
207
198
|
);
|
|
208
199
|
|
|
200
|
+
coin = Coin(payable(coinAddress));
|
|
201
|
+
|
|
209
202
|
assertEq(coin.platformReferrer(), coin.protocolRewardRecipient(), "platformReferrer");
|
|
210
203
|
}
|
|
211
204
|
|
|
@@ -214,20 +207,17 @@ contract FactoryTest is BaseTest {
|
|
|
214
207
|
owners[0] = users.creator;
|
|
215
208
|
|
|
216
209
|
vm.expectRevert(abi.encodeWithSelector(ICoin.InvalidWethLowerTick.selector));
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
0
|
|
229
|
-
)
|
|
230
|
-
)
|
|
210
|
+
|
|
211
|
+
factory.deploy(
|
|
212
|
+
users.creator,
|
|
213
|
+
owners,
|
|
214
|
+
"https://testcoinusdcpair.com",
|
|
215
|
+
"Testcoinusdcpair",
|
|
216
|
+
"TESTCOINUSDCPAIR",
|
|
217
|
+
users.platformReferrer,
|
|
218
|
+
address(0),
|
|
219
|
+
USDC_TICK_LOWER,
|
|
220
|
+
0
|
|
231
221
|
);
|
|
232
222
|
}
|
|
233
223
|
|
|
@@ -241,20 +231,17 @@ contract FactoryTest is BaseTest {
|
|
|
241
231
|
|
|
242
232
|
vm.prank(users.creator);
|
|
243
233
|
vm.expectRevert(abi.encodeWithSelector(ICoin.EthTransferInvalid.selector));
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
0
|
|
256
|
-
)
|
|
257
|
-
)
|
|
234
|
+
|
|
235
|
+
factory.deploy{value: 1e6}(
|
|
236
|
+
users.creator,
|
|
237
|
+
owners,
|
|
238
|
+
"https://testcoinusdcpair.com",
|
|
239
|
+
"Testcoinusdcpair",
|
|
240
|
+
"TESTCOINUSDCPAIR",
|
|
241
|
+
users.platformReferrer,
|
|
242
|
+
USDC_ADDRESS,
|
|
243
|
+
USDC_TICK_LOWER,
|
|
244
|
+
0
|
|
258
245
|
);
|
|
259
246
|
}
|
|
260
247
|
|
|
@@ -262,11 +249,18 @@ contract FactoryTest is BaseTest {
|
|
|
262
249
|
address[] memory owners = new address[](1);
|
|
263
250
|
owners[0] = users.creator;
|
|
264
251
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
252
|
+
(address coinAddress, ) = factory.deploy(
|
|
253
|
+
users.creator,
|
|
254
|
+
owners,
|
|
255
|
+
"https://test.com",
|
|
256
|
+
"Test Token",
|
|
257
|
+
"TEST",
|
|
258
|
+
users.platformReferrer,
|
|
259
|
+
address(weth),
|
|
260
|
+
LP_TICK_LOWER_WETH,
|
|
261
|
+
0
|
|
269
262
|
);
|
|
263
|
+
coin = Coin(payable(coinAddress));
|
|
270
264
|
|
|
271
265
|
assertEq(coin.balanceOf(users.creator), 10_000_000e18, "Should only have initial creator allocation");
|
|
272
266
|
}
|
package/test/utils/BaseTest.sol
CHANGED
|
@@ -110,9 +110,19 @@ contract BaseTest is Test, CoinConstants {
|
|
|
110
110
|
owners[0] = users.creator;
|
|
111
111
|
|
|
112
112
|
vm.prank(users.creator);
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
(address coinAddress, ) = factory.deploy(
|
|
114
|
+
users.creator,
|
|
115
|
+
owners,
|
|
116
|
+
"https://test.com",
|
|
117
|
+
"Testcoin",
|
|
118
|
+
"TEST",
|
|
119
|
+
users.platformReferrer,
|
|
120
|
+
address(weth),
|
|
121
|
+
LP_TICK_LOWER_WETH,
|
|
122
|
+
0
|
|
115
123
|
);
|
|
124
|
+
|
|
125
|
+
coin = Coin(payable(coinAddress));
|
|
116
126
|
pool = IUniswapV3Pool(coin.poolAddress());
|
|
117
127
|
|
|
118
128
|
vm.label(address(coin), "COIN");
|
|
@@ -124,21 +134,19 @@ contract BaseTest is Test, CoinConstants {
|
|
|
124
134
|
owners[0] = users.creator;
|
|
125
135
|
|
|
126
136
|
vm.prank(users.creator);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
USDC_TICK_LOWER,
|
|
138
|
-
0
|
|
139
|
-
)
|
|
140
|
-
)
|
|
137
|
+
(address coinAddress, ) = factory.deploy(
|
|
138
|
+
users.creator,
|
|
139
|
+
owners,
|
|
140
|
+
"https://testusdccoin.com",
|
|
141
|
+
"Testusdccoin",
|
|
142
|
+
"TESTUSDCCOIN",
|
|
143
|
+
users.platformReferrer,
|
|
144
|
+
USDC_ADDRESS,
|
|
145
|
+
USDC_TICK_LOWER,
|
|
146
|
+
0
|
|
141
147
|
);
|
|
148
|
+
|
|
149
|
+
coin = Coin(payable(coinAddress));
|
|
142
150
|
pool = IUniswapV3Pool(coin.poolAddress());
|
|
143
151
|
|
|
144
152
|
vm.label(address(coin), "COIN");
|