@pendle/core-v2 0.15.2-mainnet → 0.16.0-testnet
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/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +48 -110
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +21 -75
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.json +0 -39
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -15
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -15
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +0 -13
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -15
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -15
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -46
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +8 -52
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -15
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +17 -77
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +1018 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/{base → ConvexCurveLP}/PendleConvexLPSY.sol/PendleConvexLPSY.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +76 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStaking.sol/PendleLooksStaking.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/{PendleLooksStakingSY.sol/PendleLooksStakingSY.json → PendleLooksStaking.sol/PendleLooksStaking.json} +4 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -15
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +4 -85
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +4 -17
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.json +2 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +38 -3
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.json +2 -2
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.json +0 -13
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +35 -319
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +85 -39
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.json +53 -0
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.json +45 -0
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.json +0 -7
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +17 -91
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +0 -50
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +0 -20
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +0 -20
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +17 -181
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.json +2 -2
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.json +2 -12
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.json +0 -45
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +2 -15
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +80 -2
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +60 -299
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +41 -118
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +24 -61
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +24 -31
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +24 -31
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -15
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -191
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +1 -1
- package/contracts/core/Market/PendleMarket.sol +7 -18
- package/contracts/core/Market/PendleMarketFactory.sol +5 -15
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +167 -0
- package/contracts/core/StandardizedYield/implementations/Convex/{base → ConvexCurveLP}/PendleConvexLPSY.sol +4 -2
- package/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol +83 -0
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +4 -19
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +7 -21
- package/contracts/core/YieldContracts/PendleYieldToken.sol +21 -54
- package/contracts/core/erc20/PendleERC20.sol +7 -4
- package/contracts/core/libraries/BaseSplitCodeFactory.sol +1 -1
- package/contracts/core/libraries/BoringOwnableUpgradeable.sol +1 -1
- package/contracts/core/libraries/Errors.sol +2 -28
- package/contracts/core/libraries/TokenHelper.sol +0 -9
- package/contracts/interfaces/ConvexCurve/IBooster.sol +1 -1
- package/contracts/interfaces/Curve/ICrvPool.sol +31 -12
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +5 -3
- package/contracts/interfaces/IPActionMintRedeem.sol +0 -2
- package/contracts/interfaces/IPMarketFactory.sol +1 -1
- package/contracts/interfaces/IPYieldContractFactory.sol +1 -1
- package/contracts/interfaces/IStETH.sol +0 -6
- package/contracts/interfaces/IStandardizedYield.sol +10 -15
- package/contracts/offchain-helpers/ImplicitSwapfeeContract.sol +30 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +173 -0
- package/contracts/offchain-helpers/RouterStatic.sol +50 -189
- package/contracts/router/ActionAddRemoveLiq.sol +52 -71
- package/contracts/router/ActionCallback.sol +8 -4
- package/contracts/router/ActionMintRedeem.sol +18 -27
- package/contracts/router/ActionSwapPT.sol +9 -8
- package/contracts/router/ActionSwapPTYT.sol +7 -3
- package/contracts/router/ActionSwapYT.sol +10 -15
- package/contracts/router/PendleRouter.sol +0 -3
- package/contracts/router/base/ActionBaseMintRedeem.sol +83 -78
- package/contracts/router/base/MarketApproxLib.sol +1 -1
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +1 -17
- package/contracts/router/kyberswap/KyberSwapHelper.sol +8 -21
- package/deployments/43113-core.json +16 -0
- package/deployments/43113-helper.json +3 -0
- package/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/deployments/43113-testenv.json +22 -0
- package/deployments/80001-core.json +15 -0
- package/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/deployments/80001-testenv.json +22 -0
- package/package.json +2 -3
- package/typechain-types/ActionAddRemoveLiq.ts +52 -64
- package/typechain-types/ActionBaseMintRedeem.ts +8 -8
- package/typechain-types/ActionMintRedeem.ts +16 -48
- package/typechain-types/ActionSwapPT.ts +12 -34
- package/typechain-types/ActionSwapYT.ts +12 -34
- package/typechain-types/AggregationRouterHelper.ts +3 -287
- package/typechain-types/BaseSplitCodeFactoryContract.ts +0 -9
- package/typechain-types/BoringOwnableUpgradeable.ts +0 -9
- package/typechain-types/IBooster.ts +3 -9
- package/typechain-types/ICrvPool.ts +172 -69
- package/typechain-types/ILooksStaking.ts +0 -27
- package/typechain-types/IPActionAddRemoveLiq.ts +44 -56
- package/typechain-types/IPActionMintRedeem.ts +8 -40
- package/typechain-types/IPActionSwapPT.ts +4 -26
- package/typechain-types/IPActionSwapYT.ts +4 -26
- package/typechain-types/IPAllAction.ts +54 -76
- package/typechain-types/IPMarketFactory.ts +2 -2
- package/typechain-types/IPMsgSendEndpoint.ts +14 -24
- package/typechain-types/IPYieldContractFactory.ts +3 -3
- package/typechain-types/IStETH.ts +0 -56
- package/typechain-types/ImplicitSwapfeeContract.ts +17 -9
- package/typechain-types/KyberSwapHelper.ts +8 -8
- package/typechain-types/MarketMathStatic.ts +117 -0
- package/typechain-types/PendleFeeDistributor.ts +0 -9
- package/typechain-types/PendleFeeDistributorFactory.ts +0 -9
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +0 -9
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +0 -9
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +0 -9
- package/typechain-types/PendleMarketFactory.ts +2 -51
- package/typechain-types/PendleMsgReceiveEndpointUpg.ts +68 -135
- package/typechain-types/PendleMsgSendEndpointUpg.ts +39 -108
- package/typechain-types/PendleMsgSenderAppUpg.ts +0 -64
- package/typechain-types/PendlePrincipalToken.ts +0 -9
- package/typechain-types/PendleRouter.ts +0 -9
- package/typechain-types/PendleVotingControllerUpg.ts +0 -64
- package/typechain-types/PendleYieldContractFactory.ts +8 -57
- package/typechain-types/PendleYieldToken.ts +0 -21
- package/typechain-types/RouterStatic.ts +20 -302
- package/typechain-types/VotingEscrowPendleMainchain.ts +6 -70
- package/typechain-types/VotingEscrowPendleSidechain.ts +0 -9
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +59 -122
- package/typechain-types/factories/ActionBaseMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +42 -65
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +42 -35
- package/typechain-types/factories/ActionSwapYT__factory.ts +42 -35
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -190
- package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +1 -14
- package/typechain-types/factories/BaseSplitCodeFactory__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeable__factory.ts +0 -13
- package/typechain-types/factories/ERC20__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +34 -318
- package/typechain-types/factories/IBooster__factory.ts +1 -1
- package/typechain-types/factories/ICrvPool__factory.ts +85 -39
- package/typechain-types/factories/ILooksStaking__factory.ts +0 -7
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +17 -91
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +0 -50
- package/typechain-types/factories/IPActionSwapPT__factory.ts +0 -20
- package/typechain-types/factories/IPActionSwapYT__factory.ts +0 -20
- package/typechain-types/factories/IPAllAction__factory.ts +17 -181
- package/typechain-types/factories/IPMarketFactory__factory.ts +2 -2
- package/typechain-types/factories/IPMsgSendEndpoint__factory.ts +2 -12
- package/typechain-types/factories/IPYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/IStETH__factory.ts +0 -45
- package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +12 -4
- package/typechain-types/factories/KyberSwapHelper__factory.ts +1 -1
- package/typechain-types/factories/MarketMathStatic__factory.ts +79 -1
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -14
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -14
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +0 -13
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -14
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -14
- package/typechain-types/factories/PendleMarketFactory__factory.ts +16 -76
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +51 -113
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +23 -84
- package/typechain-types/factories/PendleMsgSenderAppUpg__factory.ts +0 -39
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -14
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -14
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +2 -57
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -84
- package/typechain-types/factories/PendleYieldToken__factory.ts +3 -16
- package/typechain-types/factories/RouterStatic__factory.ts +1 -244
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +8 -63
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -14
- package/typechain-types/hardhat.d.ts +39 -219
- package/typechain-types/index.ts +12 -48
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.json +0 -10
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +0 -10
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +0 -4
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +0 -699
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +0 -4
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +0 -515
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +0 -4
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +0 -1003
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +0 -1068
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.json +0 -213
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.json +0 -119
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.json +0 -39
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.json +0 -173
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.json +0 -86
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.json +0 -34
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +0 -35
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json +0 -35
- package/contracts/core/BulkSeller/BulkSeller.sol +0 -259
- package/contracts/core/BulkSeller/BulkSellerFactory.sol +0 -88
- package/contracts/core/BulkSeller/BulkSellerMathCore.sol +0 -143
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol +0 -102
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol +0 -160
- package/contracts/core/StandardizedYield/implementations/Convex/README.md +0 -29
- package/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol +0 -215
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol +0 -127
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol +0 -152
- package/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol +0 -122
- package/contracts/interfaces/Curve/ITriCrvPool.sol +0 -41
- package/contracts/interfaces/ILooksFeeSharing.sol +0 -5
- package/contracts/interfaces/ILooksStaking.sol +0 -13
- package/contracts/interfaces/IPBulkSeller.sol +0 -28
- package/contracts/interfaces/IPBulkSellerFactory.sol +0 -12
- package/contracts/interfaces/IPBulkSellerSYCallback.sol +0 -10
- package/contracts/offchain-helpers/BulkSellerOffchain.sol +0 -43
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +0 -10
- package/deployments/1-core.json +0 -16
- package/deployments/1-markets/FRAX_30_MAR_23.json +0 -8
- package/deployments/1-markets/LOOKS_30_MAR_23.json +0 -8
- package/deployments/1-markets/STETH_MARCH_30.json +0 -8
- package/deployments/1-markets/USDD_MARCH_30.json +0 -8
- package/deployments/1-offchain-helper.json +0 -3
- package/typechain-types/AccessControl.ts +0 -360
- package/typechain-types/AccessControlUpgradeable.ts +0 -369
- package/typechain-types/BeaconProxy.ts +0 -97
- package/typechain-types/BulkSeller.ts +0 -777
- package/typechain-types/BulkSellerFactory.ts +0 -707
- package/typechain-types/BulkSellerOffchain.ts +0 -117
- package/typechain-types/ContextUpgradeable.ts +0 -68
- package/typechain-types/Curve3CrvPoolHelper.ts +0 -236
- package/typechain-types/CurveFraxUsdcPoolHelper.ts +0 -158
- package/typechain-types/CurveUsdd3CrvPoolHelper.ts +0 -184
- package/typechain-types/ERC165.ts +0 -102
- package/typechain-types/ERC165Upgradeable.ts +0 -113
- package/typechain-types/IAccessControl.ts +0 -305
- package/typechain-types/IAccessControlUpgradeable.ts +0 -305
- package/typechain-types/IAggregationRouterHelper.ts +0 -108
- package/typechain-types/IERC165.ts +0 -102
- package/typechain-types/IERC165Upgradeable.ts +0 -102
- package/typechain-types/IPBulkSeller.ts +0 -290
- package/typechain-types/IPBulkSellerCallback.ts +0 -115
- package/typechain-types/IPBulkSellerFactory.ts +0 -147
- package/typechain-types/ITriCrvPool.ts +0 -345
- package/typechain-types/Initializable.ts +0 -68
- package/typechain-types/PendleConvex2TokensSY.ts +0 -1215
- package/typechain-types/PendleCurveFraxUsdcSY.ts +0 -1228
- package/typechain-types/PendleCurveUsdd3CrvSY.ts +0 -1299
- package/typechain-types/PendleLooksStakingSY.ts +0 -1052
- package/typechain-types/ReentrancyGuardUpgradeable.ts +0 -68
- package/typechain-types/factories/AccessControlUpgradeable__factory.ts +0 -247
- package/typechain-types/factories/AccessControl__factory.ts +0 -227
- package/typechain-types/factories/BeaconProxy__factory.ts +0 -141
- package/typechain-types/factories/BulkSellerFactory__factory.ts +0 -568
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +0 -88
- package/typechain-types/factories/BulkSeller__factory.ts +0 -749
- package/typechain-types/factories/ContextUpgradeable__factory.ts +0 -39
- package/typechain-types/factories/Curve3CrvPoolHelper__factory.ts +0 -220
- package/typechain-types/factories/CurveFraxUsdcPoolHelper__factory.ts +0 -146
- package/typechain-types/factories/CurveUsdd3CrvPoolHelper__factory.ts +0 -172
- package/typechain-types/factories/ERC165Upgradeable__factory.ts +0 -58
- package/typechain-types/factories/ERC165__factory.ts +0 -39
- package/typechain-types/factories/IAccessControlUpgradeable__factory.ts +0 -202
- package/typechain-types/factories/IAccessControl__factory.ts +0 -198
- package/typechain-types/factories/IAggregationRouterHelper__factory.ts +0 -54
- package/typechain-types/factories/IERC165Upgradeable__factory.ts +0 -45
- package/typechain-types/factories/IERC165__factory.ts +0 -42
- package/typechain-types/factories/IPBulkSellerCallback__factory.ts +0 -53
- package/typechain-types/factories/IPBulkSellerFactory__factory.ts +0 -101
- package/typechain-types/factories/IPBulkSeller__factory.ts +0 -185
- package/typechain-types/factories/ITriCrvPool__factory.ts +0 -225
- package/typechain-types/factories/Initializable__factory.ts +0 -36
- package/typechain-types/factories/PendleConvex2TokensSY__factory.ts +0 -1093
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +0 -1068
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +0 -1133
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +0 -937
- package/typechain-types/factories/ReentrancyGuardUpgradeable__factory.ts +0 -43
package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.json
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "IPBulkSellerFactory",
|
|
4
|
-
"sourceName": "contracts/interfaces/IPBulkSellerFactory.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"anonymous": false,
|
|
8
|
-
"inputs": [
|
|
9
|
-
{
|
|
10
|
-
"indexed": true,
|
|
11
|
-
"internalType": "address",
|
|
12
|
-
"name": "implementation",
|
|
13
|
-
"type": "address"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"name": "UpgradedBeacon",
|
|
17
|
-
"type": "event"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"inputs": [
|
|
21
|
-
{
|
|
22
|
-
"internalType": "address",
|
|
23
|
-
"name": "token",
|
|
24
|
-
"type": "address"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"internalType": "address",
|
|
28
|
-
"name": "SY",
|
|
29
|
-
"type": "address"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"name": "get",
|
|
33
|
-
"outputs": [
|
|
34
|
-
{
|
|
35
|
-
"internalType": "address",
|
|
36
|
-
"name": "",
|
|
37
|
-
"type": "address"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"stateMutability": "view",
|
|
41
|
-
"type": "function"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"inputs": [
|
|
45
|
-
{
|
|
46
|
-
"internalType": "address",
|
|
47
|
-
"name": "addr",
|
|
48
|
-
"type": "address"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"name": "isAdmin",
|
|
52
|
-
"outputs": [
|
|
53
|
-
{
|
|
54
|
-
"internalType": "bool",
|
|
55
|
-
"name": "",
|
|
56
|
-
"type": "bool"
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"stateMutability": "view",
|
|
60
|
-
"type": "function"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"inputs": [
|
|
64
|
-
{
|
|
65
|
-
"internalType": "address",
|
|
66
|
-
"name": "addr",
|
|
67
|
-
"type": "address"
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"name": "isMaintainer",
|
|
71
|
-
"outputs": [
|
|
72
|
-
{
|
|
73
|
-
"internalType": "bool",
|
|
74
|
-
"name": "",
|
|
75
|
-
"type": "bool"
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"stateMutability": "view",
|
|
79
|
-
"type": "function"
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
"bytecode": "0x",
|
|
83
|
-
"deployedBytecode": "0x",
|
|
84
|
-
"linkReferences": {},
|
|
85
|
-
"deployedLinkReferences": {}
|
|
86
|
-
}
|
package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "IPBulkSellerCallback",
|
|
4
|
-
"sourceName": "contracts/interfaces/IPBulkSellerSYCallback.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [
|
|
8
|
-
{
|
|
9
|
-
"internalType": "int256",
|
|
10
|
-
"name": "ptToAccount",
|
|
11
|
-
"type": "int256"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"internalType": "int256",
|
|
15
|
-
"name": "syToAccount",
|
|
16
|
-
"type": "int256"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"internalType": "bytes",
|
|
20
|
-
"name": "data",
|
|
21
|
-
"type": "bytes"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"name": "swapCallback",
|
|
25
|
-
"outputs": [],
|
|
26
|
-
"stateMutability": "nonpayable",
|
|
27
|
-
"type": "function"
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
"bytecode": "0x",
|
|
31
|
-
"deployedBytecode": "0x",
|
|
32
|
-
"linkReferences": {},
|
|
33
|
-
"deployedLinkReferences": {}
|
|
34
|
-
}
|
package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "BulkSellerOffchain",
|
|
4
|
-
"sourceName": "contracts/offchain-helpers/BulkSellerOffchain.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [
|
|
8
|
-
{
|
|
9
|
-
"internalType": "contract IPBulkSeller",
|
|
10
|
-
"name": "bulk",
|
|
11
|
-
"type": "address"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"name": "calcCurrentRates",
|
|
15
|
-
"outputs": [
|
|
16
|
-
{
|
|
17
|
-
"internalType": "uint256",
|
|
18
|
-
"name": "rateTokenToSy",
|
|
19
|
-
"type": "uint256"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"internalType": "uint256",
|
|
23
|
-
"name": "rateSyToToken",
|
|
24
|
-
"type": "uint256"
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"stateMutability": "view",
|
|
28
|
-
"type": "function"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"bytecode": "0x608060405234801561001057600080fd5b506104cd806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c307974d14610030575b600080fd5b61004361003e366004610351565b61005c565b6040805192835260208301919091520160405180910390f35b6000806000836001600160a01b0316632778c3346040518163ffffffff1660e01b815260040160a060405180830381865afa15801561009f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100c39190610375565b90506000846001600160a01b031663afd27bf56040518163ffffffff1660e01b8152600401602060405180830381865afa158015610105573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012991906103f2565b90506000856001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561016b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018f91906103f2565b905060006101ae846020015185606001516102ee90919063ffffffff16565b84604001516101bd9190610425565b90506000836001600160a01b031663b8f82b2684846040518363ffffffff1660e01b81526004016101ef929190610438565b602060405180830381865afa15801561020c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102309190610451565b905061023c8183610313565b855160408701519198506000935061025492506102ee565b84606001516102639190610425565b90506000836001600160a01b031663cbe52ae384846040518363ffffffff1660e01b8152600401610295929190610438565b602060405180830381865afa1580156102b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d69190610451565b90506102e28183610313565b95505050505050915091565b6000806102fb838561046a565b9050670de0b6b3a7640000815b049150505b92915050565b600080610328670de0b6b3a76400008561046a565b905082818161030857610308610481565b6001600160a01b038116811461034e57600080fd5b50565b60006020828403121561036357600080fd5b813561036e81610339565b9392505050565b600060a0828403121561038757600080fd5b60405160a081016001600160401b03811182821017156103b757634e487b7160e01b600052604160045260246000fd5b806040525082518152602083015160208201526040830151604082015260608301516060820152608083015160808201528091505092915050565b60006020828403121561040457600080fd5b815161036e81610339565b634e487b7160e01b600052601160045260246000fd5b8082018082111561030d5761030d61040f565b6001600160a01b03929092168252602082015260400190565b60006020828403121561046357600080fd5b5051919050565b808202811582820484141761030d5761030d61040f565b634e487b7160e01b600052601260045260246000fdfea264697066735822122035b8e09de0ea554e568eb1df3a9f98eaf9b4e3a4992f28409f4c399fded48ffa64736f6c63430008110033",
|
|
32
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c307974d14610030575b600080fd5b61004361003e366004610351565b61005c565b6040805192835260208301919091520160405180910390f35b6000806000836001600160a01b0316632778c3346040518163ffffffff1660e01b815260040160a060405180830381865afa15801561009f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100c39190610375565b90506000846001600160a01b031663afd27bf56040518163ffffffff1660e01b8152600401602060405180830381865afa158015610105573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012991906103f2565b90506000856001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561016b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018f91906103f2565b905060006101ae846020015185606001516102ee90919063ffffffff16565b84604001516101bd9190610425565b90506000836001600160a01b031663b8f82b2684846040518363ffffffff1660e01b81526004016101ef929190610438565b602060405180830381865afa15801561020c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102309190610451565b905061023c8183610313565b855160408701519198506000935061025492506102ee565b84606001516102639190610425565b90506000836001600160a01b031663cbe52ae384846040518363ffffffff1660e01b8152600401610295929190610438565b602060405180830381865afa1580156102b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d69190610451565b90506102e28183610313565b95505050505050915091565b6000806102fb838561046a565b9050670de0b6b3a7640000815b049150505b92915050565b600080610328670de0b6b3a76400008561046a565b905082818161030857610308610481565b6001600160a01b038116811461034e57600080fd5b50565b60006020828403121561036357600080fd5b813561036e81610339565b9392505050565b600060a0828403121561038757600080fd5b60405160a081016001600160401b03811182821017156103b757634e487b7160e01b600052604160045260246000fd5b806040525082518152602083015160208201526040830151604082015260608301516060820152608083015160808201528091505092915050565b60006020828403121561040457600080fd5b815161036e81610339565b634e487b7160e01b600052601160045260246000fd5b8082018082111561030d5761030d61040f565b6001600160a01b03929092168252602082015260400190565b60006020828403121561046357600080fd5b5051919050565b808202811582820484141761030d5761030d61040f565b634e487b7160e01b600052601260045260246000fdfea264697066735822122035b8e09de0ea554e568eb1df3a9f98eaf9b4e3a4992f28409f4c399fded48ffa64736f6c63430008110033",
|
|
33
|
-
"linkReferences": {},
|
|
34
|
-
"deployedLinkReferences": {}
|
|
35
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "IAggregationRouterHelper",
|
|
4
|
-
"sourceName": "contracts/router/kyberswap/IAggregatorRouterHelper.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [
|
|
8
|
-
{
|
|
9
|
-
"internalType": "bytes",
|
|
10
|
-
"name": "kybercall",
|
|
11
|
-
"type": "bytes"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"internalType": "uint256",
|
|
15
|
-
"name": "newAmount",
|
|
16
|
-
"type": "uint256"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"name": "getScaledInputData",
|
|
20
|
-
"outputs": [
|
|
21
|
-
{
|
|
22
|
-
"internalType": "bytes",
|
|
23
|
-
"name": "",
|
|
24
|
-
"type": "bytes"
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"stateMutability": "pure",
|
|
28
|
-
"type": "function"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"bytecode": "0x",
|
|
32
|
-
"deployedBytecode": "0x",
|
|
33
|
-
"linkReferences": {},
|
|
34
|
-
"deployedLinkReferences": {}
|
|
35
|
-
}
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
3
|
-
|
|
4
|
-
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
|
|
5
|
-
|
|
6
|
-
import "../../interfaces/IStandardizedYield.sol";
|
|
7
|
-
import "../../interfaces/IPBulkSellerFactory.sol";
|
|
8
|
-
import "../../interfaces/IPBulkSeller.sol";
|
|
9
|
-
|
|
10
|
-
import "../libraries/TokenHelper.sol";
|
|
11
|
-
import "../libraries/math/Math.sol";
|
|
12
|
-
import "../libraries/Errors.sol";
|
|
13
|
-
|
|
14
|
-
import "./BulkSellerMathCore.sol";
|
|
15
|
-
|
|
16
|
-
contract BulkSeller is IPBulkSeller, Initializable, TokenHelper, ReentrancyGuardUpgradeable {
|
|
17
|
-
using Math for uint256;
|
|
18
|
-
using SafeERC20 for IERC20;
|
|
19
|
-
using BulkSellerMathCore for BulkSellerState;
|
|
20
|
-
|
|
21
|
-
event SwapExactTokenForSy(address receiver, uint256 netTokenIn, uint256 netSyOut);
|
|
22
|
-
event SwapExactSyForToken(address receiver, uint256 netSyIn, uint256 netTokenOut);
|
|
23
|
-
event RateUpdated(
|
|
24
|
-
uint256 newRateTokenToSy,
|
|
25
|
-
uint256 newRateSyToToken,
|
|
26
|
-
uint256 oldRateTokenToSy,
|
|
27
|
-
uint256 oldRateSyToToken
|
|
28
|
-
);
|
|
29
|
-
event ReBalanceTokenToSy(
|
|
30
|
-
uint256 netTokenDeposit,
|
|
31
|
-
uint256 netSyFromToken,
|
|
32
|
-
uint256 newTokenProp,
|
|
33
|
-
uint256 oldTokenProp
|
|
34
|
-
);
|
|
35
|
-
event ReBalanceSyToToken(
|
|
36
|
-
uint256 netSyRedeem,
|
|
37
|
-
uint256 netTokenFromSy,
|
|
38
|
-
uint256 newTokenProp,
|
|
39
|
-
uint256 oldTokenProp
|
|
40
|
-
);
|
|
41
|
-
event ReserveUpdated(uint256 totalToken, uint256 totalSy);
|
|
42
|
-
event FeeRateUpdated(uint256 newFeeRate, uint256 oldFeeRate);
|
|
43
|
-
|
|
44
|
-
struct BulkSellerStorage {
|
|
45
|
-
uint128 rateTokenToSy;
|
|
46
|
-
uint128 rateSyToToken;
|
|
47
|
-
uint128 totalSy;
|
|
48
|
-
uint128 totalToken;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
address public token;
|
|
52
|
-
address public SY;
|
|
53
|
-
uint64 public feeRate;
|
|
54
|
-
|
|
55
|
-
address public factory;
|
|
56
|
-
BulkSellerStorage public _storage;
|
|
57
|
-
|
|
58
|
-
modifier onlyMaintainer() {
|
|
59
|
-
if (!IPBulkSellerFactory(factory).isMaintainer(msg.sender))
|
|
60
|
-
revert Errors.BulkNotMaintainer();
|
|
61
|
-
_;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
modifier onlyAdmin() {
|
|
65
|
-
if (!IPBulkSellerFactory(factory).isAdmin(msg.sender)) revert Errors.BulkNotAdmin();
|
|
66
|
-
_;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Since this contract is a beacon contract, no constructor should be defined.
|
|
70
|
-
function initialize(
|
|
71
|
-
address _token,
|
|
72
|
-
address _SY,
|
|
73
|
-
address _factory
|
|
74
|
-
) external initializer {
|
|
75
|
-
__ReentrancyGuard_init();
|
|
76
|
-
token = _token;
|
|
77
|
-
SY = _SY;
|
|
78
|
-
factory = _factory;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function swapExactTokenForSy(
|
|
82
|
-
address receiver,
|
|
83
|
-
uint256 netTokenIn,
|
|
84
|
-
uint256 minSyOut
|
|
85
|
-
) external nonReentrant returns (uint256 netSyOut) {
|
|
86
|
-
BulkSellerState memory state = readState();
|
|
87
|
-
|
|
88
|
-
netSyOut = state.swapExactTokenForSy(netTokenIn);
|
|
89
|
-
|
|
90
|
-
if (netSyOut < minSyOut) revert Errors.BulkInSufficientSyOut(netSyOut, minSyOut);
|
|
91
|
-
|
|
92
|
-
if (receiver != address(this)) _transferOut(SY, receiver, netSyOut);
|
|
93
|
-
|
|
94
|
-
_writeState(state);
|
|
95
|
-
|
|
96
|
-
if (_selfBalance(token) < state.totalToken)
|
|
97
|
-
revert Errors.BulkInsufficientTokenReceived(_selfBalance(token), state.totalToken);
|
|
98
|
-
|
|
99
|
-
emit SwapExactTokenForSy(receiver, netTokenIn, netSyOut);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function swapExactSyForToken(
|
|
103
|
-
address receiver,
|
|
104
|
-
uint256 exactSyIn,
|
|
105
|
-
uint256 minTokenOut
|
|
106
|
-
) external nonReentrant returns (uint256 netTokenOut) {
|
|
107
|
-
BulkSellerState memory state = readState();
|
|
108
|
-
|
|
109
|
-
netTokenOut = state.swapExactSyForToken(exactSyIn);
|
|
110
|
-
|
|
111
|
-
if (netTokenOut < minTokenOut)
|
|
112
|
-
revert Errors.BulkInSufficientTokenOut(netTokenOut, minTokenOut);
|
|
113
|
-
if (receiver != address(this)) _transferOut(token, receiver, netTokenOut);
|
|
114
|
-
|
|
115
|
-
_writeState(state);
|
|
116
|
-
|
|
117
|
-
if (_selfBalance(SY) < state.totalSy)
|
|
118
|
-
revert Errors.BulkInsufficientSyReceived(_selfBalance(SY), state.totalSy);
|
|
119
|
-
|
|
120
|
-
emit SwapExactSyForToken(receiver, exactSyIn, netTokenOut);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function calcSwapExactTokenForSy(uint256 netTokenIn) external view returns (uint256 netSyOut) {
|
|
124
|
-
assert(_storage.rateTokenToSy != 0);
|
|
125
|
-
netSyOut = netTokenIn.mulDown(_storage.rateTokenToSy);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function calcSwapExactSyForToken(uint256 netSyIn) external view returns (uint256 netTokenOut) {
|
|
129
|
-
assert(_storage.rateSyToToken != 0);
|
|
130
|
-
netTokenOut = netSyIn.mulDown(_storage.rateSyToToken);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function readState() public view returns (BulkSellerState memory state) {
|
|
134
|
-
BulkSellerStorage storage s = _storage;
|
|
135
|
-
|
|
136
|
-
state = BulkSellerState({
|
|
137
|
-
rateTokenToSy: s.rateTokenToSy,
|
|
138
|
-
rateSyToToken: s.rateSyToToken,
|
|
139
|
-
totalToken: s.totalToken,
|
|
140
|
-
totalSy: s.totalSy,
|
|
141
|
-
feeRate: feeRate
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function _writeState(BulkSellerState memory state) internal {
|
|
146
|
-
BulkSellerStorage memory tmp = BulkSellerStorage({
|
|
147
|
-
rateTokenToSy: state.rateTokenToSy.Uint128(),
|
|
148
|
-
rateSyToToken: state.rateSyToToken.Uint128(),
|
|
149
|
-
totalSy: state.totalSy.Uint128(),
|
|
150
|
-
totalToken: state.totalToken.Uint128()
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
_storage = tmp;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// ----------------- BulkSeller management -----------------
|
|
157
|
-
|
|
158
|
-
function increaseReserve(uint256 netTokenIn, uint256 netSyIn) external payable onlyMaintainer {
|
|
159
|
-
BulkSellerState memory state = readState();
|
|
160
|
-
|
|
161
|
-
state.totalToken += netTokenIn;
|
|
162
|
-
state.totalSy += netSyIn;
|
|
163
|
-
|
|
164
|
-
_transferIn(token, msg.sender, netTokenIn);
|
|
165
|
-
_transferIn(SY, msg.sender, netSyIn);
|
|
166
|
-
|
|
167
|
-
emit ReserveUpdated(state.totalToken, state.totalSy);
|
|
168
|
-
|
|
169
|
-
_writeState(state);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function decreaseReserve(uint256 netTokenOut, uint256 netSyOut) external onlyAdmin {
|
|
173
|
-
BulkSellerState memory state = readState();
|
|
174
|
-
|
|
175
|
-
if (netTokenOut == type(uint256).max) netTokenOut = state.totalToken;
|
|
176
|
-
if (netSyOut == type(uint256).max) netSyOut = state.totalSy;
|
|
177
|
-
|
|
178
|
-
state.totalToken -= netTokenOut;
|
|
179
|
-
state.totalSy -= netSyOut;
|
|
180
|
-
|
|
181
|
-
_transferOut(token, msg.sender, netTokenOut);
|
|
182
|
-
_transferOut(SY, msg.sender, netSyOut);
|
|
183
|
-
|
|
184
|
-
emit ReserveUpdated(state.totalToken, state.totalSy);
|
|
185
|
-
|
|
186
|
-
_writeState(state);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function reBalance(uint256 targetProp, uint256 maxDiff) external onlyMaintainer {
|
|
190
|
-
BulkSellerState memory state = readState();
|
|
191
|
-
uint256 oldTokenProp = state.getTokenProp();
|
|
192
|
-
|
|
193
|
-
(uint256 netTokenDeposit, uint256 netSyRedeem) = state.getReBalanceParams(targetProp);
|
|
194
|
-
|
|
195
|
-
if (netTokenDeposit > 0) {
|
|
196
|
-
uint256 netSyFromToken = _depositToken(netTokenDeposit);
|
|
197
|
-
state.reBalanceTokenToSy(netTokenDeposit, netSyFromToken, maxDiff);
|
|
198
|
-
|
|
199
|
-
uint256 newTokenProp = state.getTokenProp();
|
|
200
|
-
emit ReBalanceTokenToSy(netTokenDeposit, netSyFromToken, newTokenProp, oldTokenProp);
|
|
201
|
-
} else {
|
|
202
|
-
uint256 netTokenFromSy = _redeemSy(netSyRedeem);
|
|
203
|
-
state.reBalanceSyToToken(netSyRedeem, netTokenFromSy, maxDiff);
|
|
204
|
-
|
|
205
|
-
uint256 newTokenProp = state.getTokenProp();
|
|
206
|
-
emit ReBalanceSyToToken(netSyRedeem, netTokenFromSy, newTokenProp, oldTokenProp);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
_writeState(state);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function setRate(
|
|
213
|
-
uint256 newRateSyToToken,
|
|
214
|
-
uint256 newRateTokenToSy,
|
|
215
|
-
uint256 maxDiff
|
|
216
|
-
) external onlyMaintainer {
|
|
217
|
-
BulkSellerState memory state = readState();
|
|
218
|
-
|
|
219
|
-
emit RateUpdated(
|
|
220
|
-
newRateTokenToSy,
|
|
221
|
-
newRateSyToToken,
|
|
222
|
-
state.rateTokenToSy,
|
|
223
|
-
state.rateSyToToken
|
|
224
|
-
);
|
|
225
|
-
|
|
226
|
-
state.setRate(newRateSyToToken, newRateTokenToSy, maxDiff);
|
|
227
|
-
|
|
228
|
-
_writeState(state);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function setFeeRate(uint64 newFeeRate) external onlyMaintainer {
|
|
232
|
-
emit FeeRateUpdated(newFeeRate, feeRate);
|
|
233
|
-
feeRate = newFeeRate;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
function getTokenProp() external view returns (uint256) {
|
|
237
|
-
BulkSellerState memory state = readState();
|
|
238
|
-
return state.getTokenProp();
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function _depositToken(uint256 netTokenDeposit) internal returns (uint256 netSyFromToken) {
|
|
242
|
-
_safeApprove(token, SY, netTokenDeposit);
|
|
243
|
-
uint256 nativeToDeposit = token == NATIVE ? netTokenDeposit : 0;
|
|
244
|
-
return
|
|
245
|
-
IStandardizedYield(SY).deposit{ value: nativeToDeposit }(
|
|
246
|
-
address(this),
|
|
247
|
-
token,
|
|
248
|
-
netTokenDeposit,
|
|
249
|
-
0
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function _redeemSy(uint256 netSyRedeem) internal returns (uint256 netTokenFromSy) {
|
|
254
|
-
_transferOut(SY, SY, netSyRedeem);
|
|
255
|
-
return IStandardizedYield(SY).redeem(address(this), netSyRedeem, token, 0, true);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
receive() external payable {}
|
|
259
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
3
|
-
|
|
4
|
-
import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
|
|
5
|
-
import "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";
|
|
6
|
-
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
7
|
-
|
|
8
|
-
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
|
9
|
-
import "../libraries/BoringOwnableUpgradeable.sol";
|
|
10
|
-
|
|
11
|
-
import "../../interfaces/IStandardizedYield.sol";
|
|
12
|
-
import "../../interfaces/IPBulkSellerFactory.sol";
|
|
13
|
-
import "../libraries/Errors.sol";
|
|
14
|
-
|
|
15
|
-
contract BulkSellerFactory is
|
|
16
|
-
IBeacon,
|
|
17
|
-
IPBulkSellerFactory,
|
|
18
|
-
Initializable,
|
|
19
|
-
AccessControlUpgradeable,
|
|
20
|
-
UUPSUpgradeable
|
|
21
|
-
{
|
|
22
|
-
bytes32 public constant MAINTAINER = keccak256("MAINTAINER");
|
|
23
|
-
|
|
24
|
-
address public implementation;
|
|
25
|
-
|
|
26
|
-
mapping(address => mapping(address => address)) internal syToBulkSeller;
|
|
27
|
-
|
|
28
|
-
modifier onlyAdmin() {
|
|
29
|
-
if (!isAdmin(msg.sender)) revert Errors.BulkNotAdmin();
|
|
30
|
-
_;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
constructor() initializer {}
|
|
34
|
-
|
|
35
|
-
function initialize(address implementation_) external initializer {
|
|
36
|
-
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
|
37
|
-
upgradeBeacon(implementation_);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function createBulkSeller(address token, address SY)
|
|
41
|
-
external
|
|
42
|
-
onlyAdmin
|
|
43
|
-
returns (address bulk)
|
|
44
|
-
{
|
|
45
|
-
IStandardizedYield _SY = IStandardizedYield(SY);
|
|
46
|
-
if (syToBulkSeller[token][SY] != address(0))
|
|
47
|
-
revert Errors.BulkSellerAlreadyExisted(token, SY, syToBulkSeller[token][SY]);
|
|
48
|
-
if (_SY.isValidTokenIn(token) == false || _SY.isValidTokenOut(token) == false)
|
|
49
|
-
revert Errors.BulkSellerInvalidToken(token, SY);
|
|
50
|
-
|
|
51
|
-
bytes memory data = abi.encodeWithSignature(
|
|
52
|
-
"initialize(address,address,address)",
|
|
53
|
-
token,
|
|
54
|
-
SY,
|
|
55
|
-
address(this)
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
bulk = address(new BeaconProxy(address(this), data));
|
|
59
|
-
|
|
60
|
-
syToBulkSeller[token][SY] = bulk;
|
|
61
|
-
|
|
62
|
-
return bulk;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function get(address token, address SY) external view override returns (address) {
|
|
66
|
-
return syToBulkSeller[token][SY];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function isMaintainer(address addr) public view override returns (bool) {
|
|
70
|
-
return (hasRole(DEFAULT_ADMIN_ROLE, addr) || hasRole(MAINTAINER, addr));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function isAdmin(address addr) public view override returns (bool) {
|
|
74
|
-
return hasRole(DEFAULT_ADMIN_ROLE, addr);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// ----------------- upgrade-related -----------------
|
|
78
|
-
function upgradeBeacon(address newImplementation) public onlyAdmin {
|
|
79
|
-
require(
|
|
80
|
-
AddressUpgradeable.isContract(newImplementation),
|
|
81
|
-
"UpgradeableBeacon: implementation is not a contract"
|
|
82
|
-
);
|
|
83
|
-
implementation = newImplementation;
|
|
84
|
-
emit UpgradedBeacon(newImplementation);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function _authorizeUpgrade(address) internal override onlyAdmin {}
|
|
88
|
-
}
|