@zoralabs/coins 1.1.2 → 2.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 +96 -95
- package/CHANGELOG.md +22 -0
- package/README.md +126 -0
- package/abis/BaseCoinV4.json +1840 -0
- package/abis/BaseZoraV4CoinHook.json +6 -2
- package/abis/CoinUniV4Test.json +20 -0
- package/abis/ContentCoinHook.json +6 -2
- package/abis/CreatorCoinHook.json +6 -2
- package/abis/FactoryTest.json +7 -0
- package/abis/FeeEstimatorHook.json +6 -2
- package/abis/IZoraV4CoinHook.json +2 -2
- package/abis/Ownable2StepUpgradeable.json +138 -0
- package/abis/ZoraFactoryImpl.json +39 -0
- package/addresses/8453.json +5 -5
- package/dist/index.cjs +36 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -2
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +32 -1
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/wagmiGenerated.ts +35 -2
- package/package.json +1 -1
- package/script/TestBackingCoinSwap.s.sol +1 -1
- package/script/TestV4Swap.s.sol +1 -1
- package/src/{CoinV4.sol → BaseCoinV4.sol} +8 -16
- package/src/ContentCoin.sol +45 -0
- package/src/CreatorCoin.sol +7 -5
- package/src/ZoraFactoryImpl.sol +3 -3
- package/src/deployment/CoinsDeployerBase.sol +3 -3
- package/src/hooks/BaseZoraV4CoinHook.sol +3 -1
- package/src/interfaces/IZoraV4CoinHook.sol +1 -1
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/CoinUniV4.t.sol +61 -5
- package/test/Factory.t.sol +41 -0
- package/test/Upgrades.t.sol +8 -8
- package/test/utils/BaseTest.sol +23 -15
- package/wagmi.config.ts +1 -1
- /package/abis/{CoinV4.json → ContentCoin.json} +0 -0
package/test/utils/BaseTest.sol
CHANGED
|
@@ -13,7 +13,7 @@ import {IZoraFactory} from "../../src/interfaces/IZoraFactory.sol";
|
|
|
13
13
|
import {ZoraFactoryImpl} from "../../src/ZoraFactoryImpl.sol";
|
|
14
14
|
import {ZoraFactory} from "../../src/proxy/ZoraFactory.sol";
|
|
15
15
|
import {Coin} from "../../src/Coin.sol";
|
|
16
|
-
import {
|
|
16
|
+
import {ContentCoin} from "../../src/ContentCoin.sol";
|
|
17
17
|
import {MultiOwnable} from "../../src/utils/MultiOwnable.sol";
|
|
18
18
|
import {ICoin} from "../../src/interfaces/ICoin.sol";
|
|
19
19
|
import {IERC7572} from "../../src/interfaces/IERC7572.sol";
|
|
@@ -75,14 +75,14 @@ contract BaseTest is Test, ContractAddresses {
|
|
|
75
75
|
IUniversalRouter internal router;
|
|
76
76
|
IPoolManager internal poolManager;
|
|
77
77
|
IV4Quoter internal quoter;
|
|
78
|
-
|
|
78
|
+
ContentCoin internal coinV4;
|
|
79
79
|
|
|
80
80
|
ISwapRouter internal swapRouter;
|
|
81
81
|
IAirlock internal airlock;
|
|
82
82
|
Users internal users;
|
|
83
83
|
|
|
84
84
|
Coin internal coinV3Impl;
|
|
85
|
-
|
|
85
|
+
ContentCoin internal coinV4Impl;
|
|
86
86
|
CreatorCoin internal creatorCoinImpl;
|
|
87
87
|
ZoraFactoryImpl internal factoryImpl;
|
|
88
88
|
IZoraFactory internal factory;
|
|
@@ -157,7 +157,7 @@ contract BaseTest is Test, ContractAddresses {
|
|
|
157
157
|
salt
|
|
158
158
|
);
|
|
159
159
|
|
|
160
|
-
coinV4 =
|
|
160
|
+
coinV4 = ContentCoin(payable(coinAddress));
|
|
161
161
|
return coinV4;
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -206,11 +206,15 @@ contract BaseTest is Test, ContractAddresses {
|
|
|
206
206
|
);
|
|
207
207
|
|
|
208
208
|
vm.startPrank(trader);
|
|
209
|
-
|
|
209
|
+
if (currency != address(0)) {
|
|
210
|
+
UniV4SwapHelper.approveTokenWithPermit2(permit2, address(router), currency, amountIn, uint48(block.timestamp + 1 days));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
uint256 value = currency == address(0) ? amountIn : 0;
|
|
210
214
|
|
|
211
215
|
// Execute the swap
|
|
212
216
|
uint256 deadline = block.timestamp + 20;
|
|
213
|
-
router.execute(commands, inputs, deadline);
|
|
217
|
+
router.execute{value: value}(commands, inputs, deadline);
|
|
214
218
|
|
|
215
219
|
vm.stopPrank();
|
|
216
220
|
}
|
|
@@ -269,18 +273,22 @@ contract BaseTest is Test, ContractAddresses {
|
|
|
269
273
|
(bytes32 contentCoinSalt, bytes32 creatorCoinSalt) = getSalts(trustedMessageSenders);
|
|
270
274
|
|
|
271
275
|
contentCoinHook = ContentCoinHook(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
HooksDeployment.
|
|
275
|
-
|
|
276
|
+
payable(
|
|
277
|
+
address(
|
|
278
|
+
HooksDeployment.deployHookWithSalt(
|
|
279
|
+
HooksDeployment.contentCoinCreationCode(V4_POOL_MANAGER, address(factory), trustedMessageSenders, address(hookUpgradeGate)),
|
|
280
|
+
contentCoinSalt
|
|
281
|
+
)
|
|
276
282
|
)
|
|
277
283
|
)
|
|
278
284
|
);
|
|
279
285
|
creatorCoinHook = CreatorCoinHook(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
HooksDeployment.
|
|
283
|
-
|
|
286
|
+
payable(
|
|
287
|
+
address(
|
|
288
|
+
HooksDeployment.deployHookWithSalt(
|
|
289
|
+
HooksDeployment.creatorCoinHookCreationCode(V4_POOL_MANAGER, address(factory), trustedMessageSenders, address(hookUpgradeGate)),
|
|
290
|
+
creatorCoinSalt
|
|
291
|
+
)
|
|
284
292
|
)
|
|
285
293
|
)
|
|
286
294
|
);
|
|
@@ -324,7 +332,7 @@ contract BaseTest is Test, ContractAddresses {
|
|
|
324
332
|
|
|
325
333
|
_deployHooks();
|
|
326
334
|
|
|
327
|
-
coinV4Impl = new
|
|
335
|
+
coinV4Impl = new ContentCoin(users.feeRecipient, address(protocolRewards), IPoolManager(V4_POOL_MANAGER), DOPPLER_AIRLOCK);
|
|
328
336
|
|
|
329
337
|
creatorCoinImpl = new CreatorCoin(users.feeRecipient, address(protocolRewards), IPoolManager(V4_POOL_MANAGER), DOPPLER_AIRLOCK);
|
|
330
338
|
|
package/wagmi.config.ts
CHANGED
|
File without changes
|