@zoralabs/coins 2.1.2 → 2.3.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$colon$js.log +152 -0
- package/CHANGELOG.md +93 -0
- package/README.md +4 -0
- package/abis/BaseCoin.json +26 -5
- package/abis/BaseTest.json +2 -7
- package/abis/ContentCoin.json +26 -5
- package/abis/CreatorCoin.json +30 -9
- package/abis/FeeEstimatorHook.json +94 -6
- 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/{LiquidityMigrationReceiver.json → IUpgradeableDestinationV4HookWithUpdateableFee.json} +10 -18
- package/abis/IZoraFactory.json +121 -0
- package/abis/IZoraHookRegistry.json +188 -0
- package/abis/VmContractHelper226.json +233 -0
- package/abis/ZoraFactoryImpl.json +101 -6
- package/abis/ZoraHookRegistry.json +375 -0
- package/abis/{CreatorCoinHook.json → ZoraV4CoinHook.json} +95 -2
- package/addresses/8453.json +6 -5
- package/audits/report-cantinacode-zora-0827.pdf +3498 -4
- package/dist/index.cjs +93 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +93 -13
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +144 -22
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/foundry.toml +4 -1
- package/package/wagmiGenerated.ts +93 -13
- package/package.json +6 -4
- package/script/PrintRegisterUpgradePath.s.sol +0 -7
- package/script/TestBackingCoinSwap.s.sol +0 -3
- package/script/TestV4Swap.s.sol +0 -3
- package/script/UpgradeFactoryImpl.s.sol +1 -1
- package/src/BaseCoin.sol +19 -24
- package/src/ContentCoin.sol +11 -2
- package/src/CreatorCoin.sol +34 -15
- package/src/ZoraFactoryImpl.sol +163 -92
- package/src/deployment/CoinsDeployerBase.sol +24 -58
- package/src/hook-registry/ZoraHookRegistry.sol +97 -0
- package/src/hooks/{BaseZoraV4CoinHook.sol → ZoraV4CoinHook.sol} +77 -15
- package/src/interfaces/ICoin.sol +19 -1
- package/src/interfaces/ICreatorCoin.sol +4 -0
- package/src/interfaces/IUpgradeableV4Hook.sol +18 -0
- package/src/interfaces/IZoraFactory.sol +51 -10
- package/src/interfaces/IZoraHookRegistry.sol +47 -0
- package/src/libs/CoinConstants.sol +43 -32
- package/src/libs/CoinDopplerMultiCurve.sol +11 -11
- package/src/libs/CoinRewardsV4.sol +68 -37
- package/src/libs/CoinSetup.sol +2 -9
- package/src/libs/DopplerMath.sol +2 -2
- package/src/libs/HooksDeployment.sol +13 -65
- package/src/libs/V4Liquidity.sol +109 -15
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/Coin.t.sol +5 -5
- package/test/CoinRewardsV4.t.sol +33 -0
- package/test/CoinUniV4.t.sol +32 -30
- package/test/ContentCoinRewards.t.sol +363 -0
- package/test/CreatorCoin.t.sol +53 -29
- package/test/CreatorCoinRewards.t.sol +375 -0
- package/test/DeploymentHooks.t.sol +64 -12
- package/test/Factory.t.sol +24 -7
- package/test/HooksDeployment.t.sol +4 -4
- package/test/LiquidityMigration.t.sol +149 -16
- package/test/Upgrades.t.sol +44 -48
- package/test/V4Liquidity.t.sol +178 -0
- package/test/ZoraHookRegistry.t.sol +266 -0
- package/test/utils/BaseTest.sol +25 -43
- 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/CoinConstants.json +0 -158
- package/abis/CoinRewardsV4.json +0 -67
- 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/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/CreatorCoinConstants.sol +0 -16
- package/src/libs/CreatorCoinRewards.sol +0 -34
- package/src/libs/MarketConstants.sol +0 -15
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: ZORA-DELAYED-OSL-v1
|
|
2
|
-
// This software is licensed under the Zora Delayed Open Source License.
|
|
3
|
-
// Under this license, you may use, copy, modify, and distribute this software for
|
|
4
|
-
// non-commercial purposes only. Commercial use and competitive products are prohibited
|
|
5
|
-
// until the "Open Date" (3 years from first public distribution or earlier at Zora's discretion),
|
|
6
|
-
// at which point this software automatically becomes available under the MIT License.
|
|
7
|
-
// Full license terms available at: https://docs.zora.co/coins/license
|
|
8
|
-
pragma solidity ^0.8.28;
|
|
9
|
-
|
|
10
|
-
import {IPoolManager, IDeployedCoinVersionLookup, IHasRewardsRecipients, Currency, BaseZoraV4CoinHook} from "./BaseZoraV4CoinHook.sol";
|
|
11
|
-
import {CoinRewardsV4} from "../libs/CoinRewardsV4.sol";
|
|
12
|
-
import {CoinConstants} from "../libs/CoinConstants.sol";
|
|
13
|
-
import {IHooksUpgradeGate} from "../interfaces/IHooksUpgradeGate.sol";
|
|
14
|
-
|
|
15
|
-
contract ContentCoinHook is BaseZoraV4CoinHook {
|
|
16
|
-
constructor(
|
|
17
|
-
IPoolManager poolManager_,
|
|
18
|
-
IDeployedCoinVersionLookup coinVersionLookup_,
|
|
19
|
-
address[] memory trustedMessageSenders_,
|
|
20
|
-
IHooksUpgradeGate upgradeGate
|
|
21
|
-
) BaseZoraV4CoinHook(poolManager_, coinVersionLookup_, trustedMessageSenders_, upgradeGate, CoinConstants.POOL_LAUNCH_SUPPLY) {}
|
|
22
|
-
|
|
23
|
-
/// @dev Override for market reward distribution
|
|
24
|
-
function _distributeMarketRewards(Currency currency, uint128 fees, IHasRewardsRecipients coin, address tradeReferrer) internal override {
|
|
25
|
-
CoinRewardsV4.distributeMarketRewards(currency, fees, coin, tradeReferrer);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: ZORA-DELAYED-OSL-v1
|
|
2
|
-
// This software is licensed under the Zora Delayed Open Source License.
|
|
3
|
-
// Under this license, you may use, copy, modify, and distribute this software for
|
|
4
|
-
// non-commercial purposes only. Commercial use and competitive products are prohibited
|
|
5
|
-
// until the "Open Date" (3 years from first public distribution or earlier at Zora's discretion),
|
|
6
|
-
// at which point this software automatically becomes available under the MIT License.
|
|
7
|
-
// Full license terms available at: https://docs.zora.co/coins/license
|
|
8
|
-
pragma solidity ^0.8.28;
|
|
9
|
-
|
|
10
|
-
import {CreatorCoinConstants} from "../libs/CreatorCoinConstants.sol";
|
|
11
|
-
import {CreatorCoinRewards} from "../libs/CreatorCoinRewards.sol";
|
|
12
|
-
import {IPoolManager, IDeployedCoinVersionLookup, IHasRewardsRecipients, Currency, BaseZoraV4CoinHook} from "./BaseZoraV4CoinHook.sol";
|
|
13
|
-
import {IHooksUpgradeGate} from "../interfaces/IHooksUpgradeGate.sol";
|
|
14
|
-
|
|
15
|
-
contract CreatorCoinHook is BaseZoraV4CoinHook {
|
|
16
|
-
constructor(
|
|
17
|
-
IPoolManager poolManager_,
|
|
18
|
-
IDeployedCoinVersionLookup coinVersionLookup_,
|
|
19
|
-
address[] memory trustedMessageSenders_,
|
|
20
|
-
IHooksUpgradeGate upgradeGate
|
|
21
|
-
) BaseZoraV4CoinHook(poolManager_, coinVersionLookup_, trustedMessageSenders_, upgradeGate, CreatorCoinConstants.MARKET_SUPPLY) {}
|
|
22
|
-
|
|
23
|
-
/// @dev Override for distributing market rewards and vested coins to the creator
|
|
24
|
-
function _distributeMarketRewards(Currency currency, uint128 fees, IHasRewardsRecipients coin, address) internal override {
|
|
25
|
-
CreatorCoinRewards.distributeMarketRewards(currency, fees, coin);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: ZORA-DELAYED-OSL-v1
|
|
2
|
-
// This software is licensed under the Zora Delayed Open Source License.
|
|
3
|
-
// Under this license, you may use, copy, modify, and distribute this software for
|
|
4
|
-
// non-commercial purposes only. Commercial use and competitive products are prohibited
|
|
5
|
-
// until the "Open Date" (3 years from first public distribution or earlier at Zora's discretion),
|
|
6
|
-
// at which point this software automatically becomes available under the MIT License.
|
|
7
|
-
// Full license terms available at: https://docs.zora.co/coins/license
|
|
8
|
-
pragma solidity ^0.8.23;
|
|
9
|
-
|
|
10
|
-
library CreatorCoinConstants {
|
|
11
|
-
uint256 internal constant TOTAL_SUPPLY = 1_000_000_000e18; // 1b coins
|
|
12
|
-
uint256 internal constant MARKET_SUPPLY = 500_000_000e18; // 500m coins
|
|
13
|
-
uint256 internal constant CREATOR_VESTING_SUPPLY = 500_000_000e18; // 500m coins
|
|
14
|
-
uint256 internal constant CREATOR_VESTING_DURATION = 5 * 365 days; // 5 years
|
|
15
|
-
address internal constant CURRENCY = 0x1111111111166b7FE7bd91427724B487980aFc69;
|
|
16
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: ZORA-DELAYED-OSL-v1
|
|
2
|
-
// This software is licensed under the Zora Delayed Open Source License.
|
|
3
|
-
// Under this license, you may use, copy, modify, and distribute this software for
|
|
4
|
-
// non-commercial purposes only. Commercial use and competitive products are prohibited
|
|
5
|
-
// until the "Open Date" (3 years from first public distribution or earlier at Zora's discretion),
|
|
6
|
-
// at which point this software automatically becomes available under the MIT License.
|
|
7
|
-
// Full license terms available at: https://docs.zora.co/coins/license
|
|
8
|
-
pragma solidity ^0.8.28;
|
|
9
|
-
|
|
10
|
-
import {ICreatorCoinHook} from "../interfaces/ICreatorCoinHook.sol";
|
|
11
|
-
import {CoinRewardsV4, IPoolManager, Currency, IHasRewardsRecipients} from "./CoinRewardsV4.sol";
|
|
12
|
-
|
|
13
|
-
library CreatorCoinRewards {
|
|
14
|
-
function distributeMarketRewards(Currency currency, uint128 fees, IHasRewardsRecipients coin) internal {
|
|
15
|
-
address payoutRecipient = coin.payoutRecipient();
|
|
16
|
-
address protocolRewardRecipient = coin.protocolRewardRecipient();
|
|
17
|
-
|
|
18
|
-
uint256 totalAmount = uint256(fees);
|
|
19
|
-
uint256 creatorAmount = CoinRewardsV4.calculateReward(totalAmount, CoinRewardsV4.CREATOR_REWARD_BPS);
|
|
20
|
-
uint256 protocolAmount = totalAmount - creatorAmount;
|
|
21
|
-
|
|
22
|
-
CoinRewardsV4._transferCurrency(currency, creatorAmount, payoutRecipient);
|
|
23
|
-
CoinRewardsV4._transferCurrency(currency, protocolAmount, protocolRewardRecipient);
|
|
24
|
-
|
|
25
|
-
emit ICreatorCoinHook.CreatorCoinRewards(
|
|
26
|
-
address(coin),
|
|
27
|
-
Currency.unwrap(currency),
|
|
28
|
-
payoutRecipient,
|
|
29
|
-
protocolRewardRecipient,
|
|
30
|
-
creatorAmount,
|
|
31
|
-
protocolAmount
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.23;
|
|
3
|
-
|
|
4
|
-
library MarketConstants {
|
|
5
|
-
/// @dev Constant used to increase precision during calculations
|
|
6
|
-
uint256 constant WAD = 1e18;
|
|
7
|
-
|
|
8
|
-
/// @notice The LP fee
|
|
9
|
-
/// @dev 30000 basis points = 3%
|
|
10
|
-
uint24 internal constant LP_FEE_V4 = 30000;
|
|
11
|
-
|
|
12
|
-
/// @notice The spacing for 1% pools
|
|
13
|
-
/// @dev 200 ticks
|
|
14
|
-
int24 internal constant TICK_SPACING = 200;
|
|
15
|
-
}
|