@pendle/core-v2 0.11.10-testnet → 0.12.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/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json +199 -30
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +1030 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +1025 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.json +948 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +76 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json +140 -25
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.json +138 -23
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.json +138 -23
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +310 -0
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/{CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.json → CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.json} +18 -85
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +336 -0
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/{CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.json → CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.json} +8 -21
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.json +131 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +297 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +376 -0
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +11 -0
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +29 -2
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +40 -86
- package/build/artifacts/contracts/core/LiquidityMining/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +228 -40
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.json +232 -12
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +164 -47
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +25 -93
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.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 +222 -9
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +106 -5
- package/build/artifacts/contracts/core/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +4 -0
- package/build/artifacts/contracts/core/PendleERC20Permit.sol/PendleERC20Permit.json +329 -0
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.json +13 -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 +87 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +80 -16
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +164 -2
- package/build/artifacts/contracts/core/actions/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +172 -4
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.json +109 -2
- package/build/artifacts/contracts/core/actions/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionMintRedeem.sol/ActionMintRedeem.json +62 -4
- package/build/artifacts/contracts/core/actions/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionMisc.sol/ActionMisc.json +7 -2
- package/build/artifacts/contracts/core/actions/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapPT.sol/ActionSwapPT.json +199 -4
- package/build/artifacts/contracts/core/actions/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapPTYT.sol/ActionSwapPTYT.json +108 -2
- package/build/artifacts/contracts/core/actions/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapYT.sol/ActionSwapYT.json +146 -4
- package/build/artifacts/contracts/core/actions/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.json +177 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICrvDepositor.sol/ICrvDepositor.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICrvDepositor.sol/ICrvDepositor.json +78 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICvxCrv.sol/ICvxCrv.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICvxCrv.sol/ICvxCrv.json +24 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +264 -0
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +305 -0
- package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.json +34 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +31 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +5 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +30 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +10 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +30 -0
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +106 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.json +112 -0
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.json +76 -0
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +13 -0
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.json +24 -0
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.json +63 -0
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.json +148 -0
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPVotingEscrow.sol/IPVotingEscrow.json → IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.json} +88 -2
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.json +4 -28
- package/build/artifacts/contracts/libraries/Errors.sol/Errors.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/Errors.sol/Errors.json +886 -0
- package/build/artifacts/contracts/libraries/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/OracleLib.sol/OracleLib.json +28 -2
- package/build/artifacts/contracts/libraries/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/{solmate/SSTORE2.sol/SSTORE2.json → VeHistoryLib.sol/CheckpointHelper.json} +4 -4
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ArrayLib.sol/ArrayLib.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/helpers/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +45 -0
- package/build/artifacts/contracts/libraries/helpers/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/helpers/{SSTORE2Deployer.sol/SSTORE2Deployer.json → BaseSplitCodeFactory.sol/CodeDeployer.json} +4 -4
- package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -2
- package/build/artifacts/contracts/libraries/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/Math.sol/Math.json +2 -2
- package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +167 -0
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +182 -4
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +126 -79
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol +3 -1
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol +19 -16
- package/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol +135 -0
- package/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol +96 -0
- package/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol +215 -0
- package/contracts/SuperComposableYield/SCY-implementations/Convex/Pendle3CrvHelper.sol +83 -0
- package/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol +10 -15
- package/contracts/SuperComposableYield/base-implementations/SCYBase.sol +30 -43
- package/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +74 -0
- package/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol +38 -0
- package/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +83 -0
- package/contracts/core/LiquidityMining/{CelerAbstracts/CelerSenderUpg.sol → CrossChainMsg/PendleMsgSenderAppUpg.sol} +12 -13
- package/contracts/core/LiquidityMining/FeeDistributor/EpochResultManager.sol +159 -0
- package/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol +96 -0
- package/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol +68 -0
- package/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +4 -3
- package/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol +6 -2
- package/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol +12 -4
- package/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +29 -19
- package/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +27 -19
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +63 -27
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol +6 -5
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol +2 -2
- package/contracts/core/Market/PendleMarket.sol +26 -24
- package/contracts/core/Market/PendleMarketFactory.sol +41 -20
- package/contracts/core/PendleERC20Permit.sol +84 -0
- package/contracts/core/PendleRouter.sol +2 -1
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +8 -7
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +37 -22
- package/contracts/core/YieldContracts/PendleYieldToken.sol +106 -35
- package/contracts/core/actions/ActionAddRemoveLiq.sol +58 -41
- package/contracts/core/actions/ActionCallback.sol +24 -14
- package/contracts/core/actions/ActionMintRedeem.sol +14 -4
- package/contracts/core/actions/ActionMisc.sol +2 -1
- package/contracts/core/actions/ActionSwapPT.sol +38 -19
- package/contracts/core/actions/ActionSwapPTYT.sol +7 -6
- package/contracts/core/actions/ActionSwapYT.sol +36 -19
- package/contracts/core/actions/base/ActionBaseMintRedeem.sol +15 -8
- package/contracts/interfaces/ConvexCurve/IBooster.sol +32 -0
- package/contracts/interfaces/ConvexCurve/ICrvDepositor.sol +20 -0
- package/contracts/interfaces/ConvexCurve/ICvxCrv.sol +6 -0
- package/contracts/interfaces/ConvexCurve/IRewards.sol +38 -0
- package/contracts/interfaces/Curve/ICrvPool.sol +69 -0
- package/contracts/interfaces/IBoringOwnableUpgradeable.sol +10 -0
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +7 -7
- package/contracts/interfaces/IPActionMintRedeem.sol +1 -0
- package/contracts/interfaces/IPActionSwapPT.sol +6 -6
- package/contracts/interfaces/IPActionSwapPTYT.sol +2 -2
- package/contracts/interfaces/IPActionSwapYT.sol +13 -13
- package/contracts/interfaces/IPFeeDistributor.sol +19 -0
- package/contracts/interfaces/IPFeeDistributorFactory.sol +14 -0
- package/contracts/interfaces/IPMarket.sol +2 -0
- package/contracts/interfaces/IPMsgReceiverApp.sol +7 -0
- package/contracts/interfaces/IPMsgSendEndpoint.sol +17 -0
- package/contracts/interfaces/IPVotingController.sol +22 -0
- package/contracts/interfaces/{IPVotingEscrow.sol → IPVotingEscrowMainchain.sol} +11 -1
- package/contracts/interfaces/ISuperComposableYield.sol +2 -7
- package/contracts/libraries/Errors.sol +121 -0
- package/contracts/libraries/OracleLib.sol +6 -3
- package/contracts/libraries/VeBalanceLib.sol +5 -1
- package/contracts/libraries/VeHistoryLib.sol +20 -31
- package/contracts/libraries/helpers/ArrayLib.sol +0 -17
- package/contracts/libraries/helpers/BaseSplitCodeFactory.sol +288 -0
- package/contracts/libraries/helpers/TokenHelper.sol +4 -0
- package/contracts/libraries/kyberswap/AggregationRouterHelper.sol +0 -7
- package/contracts/libraries/math/MarketMathCore.sol +29 -25
- package/contracts/libraries/math/Math.sol +6 -2
- package/contracts/libraries/math/WeekMath.sol +2 -2
- package/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol +43 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +36 -36
- package/contracts/offchain-helpers/RouterStatic.sol +45 -37
- package/deployments/43113-core.json +11 -10
- 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 +9 -9
- package/deployments/80001-core.json +10 -9
- 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 +16 -16
- package/package.json +1 -1
- package/typechain-types/ActionAddRemoveLiq.ts +18 -6
- package/typechain-types/ActionMintRedeem.ts +9 -2
- package/typechain-types/ActionSwapPT.ts +18 -6
- package/typechain-types/ActionSwapPTYT.ts +6 -2
- package/typechain-types/ActionSwapYT.ts +18 -6
- package/typechain-types/Errors.ts +57 -0
- package/typechain-types/ICrvPool.ts +137 -22
- package/typechain-types/IPActionAddRemoveLiq.ts +19 -7
- package/typechain-types/IPActionMintRedeem.ts +9 -2
- package/typechain-types/IPActionSwapPT.ts +18 -6
- package/typechain-types/IPActionSwapPTYT.ts +6 -2
- package/typechain-types/IPActionSwapYT.ts +18 -6
- package/typechain-types/IPAllAction.ts +70 -23
- package/typechain-types/IPBatchSeller.ts +252 -0
- package/typechain-types/IPMarket.ts +13 -0
- package/typechain-types/IPVotingController.ts +244 -7
- package/typechain-types/IPVotingEscrowMainchain.ts +461 -0
- package/typechain-types/IRewards.ts +25 -10
- package/typechain-types/ISuperComposableYield.ts +7 -46
- package/typechain-types/MarketMathStatic.ts +139 -10
- package/typechain-types/Pendle3CrvAndTokenSCY.ts +1215 -0
- package/typechain-types/Pendle3CrvTokenSCY.ts +85 -185
- package/typechain-types/PendleBatchSeller.ts +626 -0
- package/typechain-types/PendleConvexCurveLP2PoolSCY.ts +185 -220
- package/typechain-types/PendleConvexCurveLPSCY.ts +159 -182
- package/typechain-types/PendleCvxCRVSCY.ts +0 -34
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +28 -149
- package/typechain-types/PendleMarket.ts +104 -0
- package/typechain-types/PendleMarketFactory.ts +76 -13
- package/typechain-types/PendlePrincipalToken.ts +104 -0
- package/typechain-types/PendleQiTokenSCY.ts +111 -46
- package/typechain-types/PendleVotingControllerUpg.ts +133 -77
- package/typechain-types/PendleWstEthSCY.ts +111 -46
- package/typechain-types/PendleYieldContractFactory.ts +84 -21
- package/typechain-types/PendleYieldToken.ts +175 -0
- package/typechain-types/PtAMMArb.ts +587 -0
- package/typechain-types/RouterStatic.ts +99 -75
- package/typechain-types/SCYBase.ts +111 -46
- package/typechain-types/SCYBaseWithRewards.ts +111 -46
- package/typechain-types/VotingControllerStorageUpg.ts +246 -27
- package/typechain-types/VotingEscrowPendleMainchain.ts +81 -93
- package/typechain-types/VotingEscrowPendleSidechain.ts +26 -171
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +169 -1
- package/typechain-types/factories/ActionCallback__factory.ts +108 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +59 -1
- package/typechain-types/factories/ActionMisc__factory.ts +6 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +107 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +196 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +143 -1
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +933 -0
- package/typechain-types/factories/ICrvPool__factory.ts +85 -12
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +31 -1
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +5 -0
- package/typechain-types/factories/IPActionSwapPTYT__factory.ts +10 -0
- package/typechain-types/factories/IPActionSwapPT__factory.ts +30 -0
- package/typechain-types/factories/IPActionSwapYT__factory.ts +30 -0
- package/typechain-types/factories/IPAllAction__factory.ts +106 -1
- package/typechain-types/factories/IPBatchSeller__factory.ts +138 -0
- package/typechain-types/factories/IPMarket__factory.ts +13 -0
- package/typechain-types/factories/IPVotingController__factory.ts +148 -0
- package/typechain-types/factories/IPVotingEscrowMainchain__factory.ts +340 -0
- package/typechain-types/factories/IRewards__factory.ts +14 -1
- package/typechain-types/factories/ISuperComposableYield__factory.ts +4 -28
- package/typechain-types/factories/MarketMathStatic__factory.ts +181 -3
- package/typechain-types/factories/OracleLib__factory.ts +27 -1
- package/typechain-types/factories/Pendle3CrvAndTokenSCY__factory.ts +1130 -0
- package/typechain-types/factories/Pendle3CrvHelper__factory.ts +1 -1
- package/typechain-types/factories/Pendle3CrvTokenSCY__factory.ts +74 -128
- package/typechain-types/factories/PendleBatchSeller__factory.ts +558 -0
- package/typechain-types/factories/PendleConvexCurveLP2PoolSCY__factory.ts +207 -136
- package/typechain-types/factories/PendleConvexCurveLPSCY__factory.ts +170 -95
- package/typechain-types/factories/PendleCvxCRVSCY__factory.ts +1 -29
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +17 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +6 -1
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +11 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +28 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +48 -86
- package/typechain-types/factories/PendleMarketFactory__factory.ts +129 -9
- package/typechain-types/factories/PendleMarket__factory.ts +214 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +17 -1
- package/typechain-types/factories/PendleMsgReceiverAppUpg__factory.ts +11 -0
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +6 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +86 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSCY__factory.ts +198 -29
- package/typechain-types/factories/PendleRouter__factory.ts +12 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +235 -40
- package/typechain-types/factories/PendleWstEthSCY__factory.ts +137 -22
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +103 -20
- package/typechain-types/factories/PendleYieldToken__factory.ts +163 -1
- package/typechain-types/factories/PtAMMArb__factory.ts +525 -0
- package/typechain-types/factories/RouterStatic__factory.ts +67 -20
- package/typechain-types/factories/SCYBaseWithRewards__factory.ts +136 -21
- package/typechain-types/factories/SCYBase__factory.ts +136 -21
- package/typechain-types/factories/VotingControllerStorageUpg__factory.ts +232 -12
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +171 -47
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +31 -93
- package/typechain-types/hardhat.d.ts +99 -0
- package/typechain-types/index.ts +22 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.json +0 -810
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.json +0 -10
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.json +0 -833
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.json +0 -723
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.json +0 -728
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.json +0 -705
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.json +0 -864
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultSCY.sol/PendleYearnVaultSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultSCY.sol/PendleYearnVaultSCY.json +0 -718
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.json +0 -784
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.dbg.json +0 -4
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPVotingEscrow.sol/IPVotingEscrow.dbg.json +0 -4
- package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.dbg.json +0 -4
- package/build/artifacts/contracts/libraries/solmate/SSTORE2.sol/SSTORE2.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/SSTORE2DeployerContract.sol/SSTORE2DeployerContract.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/SSTORE2DeployerContract.sol/SSTORE2DeployerContract.json +0 -134
- package/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol +0 -161
- package/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol +0 -126
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol +0 -242
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol +0 -146
- package/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol +0 -176
- package/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol +0 -129
- package/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol +0 -193
- package/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultSCY.sol +0 -155
- package/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol +0 -182
- package/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol +0 -53
- package/contracts/libraries/helpers/SSTORE2Deployer.sol +0 -30
- package/contracts/libraries/solmate/SSTORE2.sol +0 -99
- package/contracts/offchain-helpers/SSTORE2DeployerContract.sol +0 -21
- package/deployments/43113-markets/benqi-market-10D931.json +0 -8
- package/deployments/43113-markets/benqi-market-9fbD64.json +0 -8
- package/deployments/43113-markets/benqi-market-A12361.json +0 -8
|
@@ -103,7 +103,7 @@ interface IPActionAddRemoveLiq {
|
|
|
103
103
|
external
|
|
104
104
|
returns (
|
|
105
105
|
uint256 netLpOut,
|
|
106
|
-
uint256
|
|
106
|
+
uint256 netScyUsed,
|
|
107
107
|
uint256 netPtUsed
|
|
108
108
|
);
|
|
109
109
|
|
|
@@ -129,7 +129,7 @@ interface IPActionAddRemoveLiq {
|
|
|
129
129
|
uint256 netPtIn,
|
|
130
130
|
uint256 minLpOut,
|
|
131
131
|
ApproxParams calldata guessPtSwapToScy
|
|
132
|
-
) external returns (uint256 netLpOut);
|
|
132
|
+
) external returns (uint256 netLpOut, uint256 netScyFee);
|
|
133
133
|
|
|
134
134
|
function addLiquiditySingleScy(
|
|
135
135
|
address receiver,
|
|
@@ -137,7 +137,7 @@ interface IPActionAddRemoveLiq {
|
|
|
137
137
|
uint256 netScyIn,
|
|
138
138
|
uint256 minLpOut,
|
|
139
139
|
ApproxParams calldata guessPtReceivedFromScy
|
|
140
|
-
) external returns (uint256 netLpOut);
|
|
140
|
+
) external returns (uint256 netLpOut, uint256 netScyFee);
|
|
141
141
|
|
|
142
142
|
function addLiquiditySingleToken(
|
|
143
143
|
address receiver,
|
|
@@ -145,7 +145,7 @@ interface IPActionAddRemoveLiq {
|
|
|
145
145
|
uint256 minLpOut,
|
|
146
146
|
ApproxParams calldata guessPtReceivedFromScy,
|
|
147
147
|
TokenInput calldata input
|
|
148
|
-
) external payable returns (uint256 netLpOut);
|
|
148
|
+
) external payable returns (uint256 netLpOut, uint256 netScyFee);
|
|
149
149
|
|
|
150
150
|
function removeLiquidityDualScyAndPt(
|
|
151
151
|
address receiver,
|
|
@@ -170,19 +170,19 @@ interface IPActionAddRemoveLiq {
|
|
|
170
170
|
uint256 netLpToRemove,
|
|
171
171
|
uint256 minPtOut,
|
|
172
172
|
ApproxParams calldata guessPtOut
|
|
173
|
-
) external returns (uint256 netPtOut);
|
|
173
|
+
) external returns (uint256 netPtOut, uint256 netScyFee);
|
|
174
174
|
|
|
175
175
|
function removeLiquiditySingleScy(
|
|
176
176
|
address receiver,
|
|
177
177
|
address market,
|
|
178
178
|
uint256 netLpToRemove,
|
|
179
179
|
uint256 minScyOut
|
|
180
|
-
) external returns (uint256 netScyOut);
|
|
180
|
+
) external returns (uint256 netScyOut, uint256 netScyFee);
|
|
181
181
|
|
|
182
182
|
function removeLiquiditySingleToken(
|
|
183
183
|
address receiver,
|
|
184
184
|
address market,
|
|
185
185
|
uint256 netLpToRemove,
|
|
186
186
|
TokenOutput calldata output
|
|
187
|
-
) external returns (uint256 netTokenOut);
|
|
187
|
+
) external returns (uint256 netTokenOut, uint256 netScyFee);
|
|
188
188
|
}
|
|
@@ -27,7 +27,7 @@ interface IPActionSwapPT {
|
|
|
27
27
|
address market,
|
|
28
28
|
uint256 exactPtIn,
|
|
29
29
|
uint256 minScyOut
|
|
30
|
-
) external returns (uint256 netScyOut);
|
|
30
|
+
) external returns (uint256 netScyOut, uint256 netScyFee);
|
|
31
31
|
|
|
32
32
|
function swapPtForExactScy(
|
|
33
33
|
address receiver,
|
|
@@ -35,14 +35,14 @@ interface IPActionSwapPT {
|
|
|
35
35
|
uint256 exactScyOut,
|
|
36
36
|
uint256 maxPtIn,
|
|
37
37
|
ApproxParams calldata guessPtIn
|
|
38
|
-
) external returns (uint256 netPtIn);
|
|
38
|
+
) external returns (uint256 netPtIn, uint256 netScyFee);
|
|
39
39
|
|
|
40
40
|
function swapScyForExactPt(
|
|
41
41
|
address receiver,
|
|
42
42
|
address market,
|
|
43
43
|
uint256 exactPtOut,
|
|
44
44
|
uint256 maxScyIn
|
|
45
|
-
) external returns (uint256 netScyIn);
|
|
45
|
+
) external returns (uint256 netScyIn, uint256 netScyFee);
|
|
46
46
|
|
|
47
47
|
function swapExactScyForPt(
|
|
48
48
|
address receiver,
|
|
@@ -50,7 +50,7 @@ interface IPActionSwapPT {
|
|
|
50
50
|
uint256 exactScyIn,
|
|
51
51
|
uint256 minPtOut,
|
|
52
52
|
ApproxParams calldata guessPtOut
|
|
53
|
-
) external returns (uint256 netPtOut);
|
|
53
|
+
) external returns (uint256 netPtOut, uint256 netScyFee);
|
|
54
54
|
|
|
55
55
|
function swapExactTokenForPt(
|
|
56
56
|
address receiver,
|
|
@@ -58,12 +58,12 @@ interface IPActionSwapPT {
|
|
|
58
58
|
uint256 minPtOut,
|
|
59
59
|
ApproxParams calldata guessPtOut,
|
|
60
60
|
TokenInput calldata input
|
|
61
|
-
) external payable returns (uint256 netPtOut);
|
|
61
|
+
) external payable returns (uint256 netPtOut, uint256 netScyFee);
|
|
62
62
|
|
|
63
63
|
function swapExactPtForToken(
|
|
64
64
|
address receiver,
|
|
65
65
|
address market,
|
|
66
66
|
uint256 exactPtIn,
|
|
67
67
|
TokenOutput calldata output
|
|
68
|
-
) external returns (uint256 netTokenOut);
|
|
68
|
+
) external returns (uint256 netTokenOut, uint256 netScyFee);
|
|
69
69
|
}
|
|
@@ -19,7 +19,7 @@ interface IPActionSwapPTYT {
|
|
|
19
19
|
uint256 exactPtIn,
|
|
20
20
|
uint256 minYtOut,
|
|
21
21
|
ApproxParams calldata guessTotalPtToSwap
|
|
22
|
-
) external returns (uint256 netYtOut);
|
|
22
|
+
) external returns (uint256 netYtOut, uint256 netScyFee);
|
|
23
23
|
|
|
24
24
|
function swapExactYtForPt(
|
|
25
25
|
address receiver,
|
|
@@ -27,5 +27,5 @@ interface IPActionSwapPTYT {
|
|
|
27
27
|
uint256 exactYtIn,
|
|
28
28
|
uint256 minPtOut,
|
|
29
29
|
ApproxParams calldata guessTotalPtSwapped
|
|
30
|
-
) external returns (uint256 netPtOut);
|
|
30
|
+
) external returns (uint256 netPtOut, uint256 netScyFee);
|
|
31
31
|
}
|
|
@@ -22,27 +22,27 @@ interface IPActionSwapYT {
|
|
|
22
22
|
int256 netTokenToAccount
|
|
23
23
|
);
|
|
24
24
|
|
|
25
|
+
function swapExactScyForYt(
|
|
26
|
+
address receiver,
|
|
27
|
+
address market,
|
|
28
|
+
uint256 exactScyIn,
|
|
29
|
+
uint256 minYtOut,
|
|
30
|
+
ApproxParams memory guessYtOut
|
|
31
|
+
) external returns (uint256 netYtOut, uint256 netScyFee);
|
|
32
|
+
|
|
25
33
|
function swapExactYtForScy(
|
|
26
34
|
address receiver,
|
|
27
35
|
address market,
|
|
28
36
|
uint256 exactYtIn,
|
|
29
37
|
uint256 minScyOut
|
|
30
|
-
) external returns (uint256 netScyOut);
|
|
38
|
+
) external returns (uint256 netScyOut, uint256 netScyFee);
|
|
31
39
|
|
|
32
40
|
function swapScyForExactYt(
|
|
33
41
|
address receiver,
|
|
34
42
|
address market,
|
|
35
43
|
uint256 exactYtOut,
|
|
36
44
|
uint256 maxScyIn
|
|
37
|
-
) external returns (uint256 netScyIn);
|
|
38
|
-
|
|
39
|
-
function swapExactScyForYt(
|
|
40
|
-
address receiver,
|
|
41
|
-
address market,
|
|
42
|
-
uint256 exactScyIn,
|
|
43
|
-
uint256 minYtOut,
|
|
44
|
-
ApproxParams memory guessYtOut
|
|
45
|
-
) external returns (uint256 netYtOut);
|
|
45
|
+
) external returns (uint256 netScyIn, uint256 netScyFee);
|
|
46
46
|
|
|
47
47
|
function swapYtForExactScy(
|
|
48
48
|
address receiver,
|
|
@@ -50,7 +50,7 @@ interface IPActionSwapYT {
|
|
|
50
50
|
uint256 exactScyOut,
|
|
51
51
|
uint256 maxYtIn,
|
|
52
52
|
ApproxParams memory guessYtIn
|
|
53
|
-
) external returns (uint256 netYtIn);
|
|
53
|
+
) external returns (uint256 netYtIn, uint256 netScyFee);
|
|
54
54
|
|
|
55
55
|
function swapExactTokenForYt(
|
|
56
56
|
address receiver,
|
|
@@ -58,12 +58,12 @@ interface IPActionSwapYT {
|
|
|
58
58
|
uint256 minYtOut,
|
|
59
59
|
ApproxParams memory guessYtOut,
|
|
60
60
|
TokenInput calldata input
|
|
61
|
-
) external payable returns (uint256 netYtOut);
|
|
61
|
+
) external payable returns (uint256 netYtOut, uint256 netScyFee);
|
|
62
62
|
|
|
63
63
|
function swapExactYtForToken(
|
|
64
64
|
address receiver,
|
|
65
65
|
address market,
|
|
66
66
|
uint256 netYtIn,
|
|
67
67
|
TokenOutput calldata output
|
|
68
|
-
) external returns (uint256 netTokenOut);
|
|
68
|
+
) external returns (uint256 netTokenOut, uint256 netScyFee);
|
|
69
69
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.15;
|
|
3
|
+
|
|
4
|
+
interface IPFeeDistributor {
|
|
5
|
+
event Fund(uint256 indexed epoch, uint256 incentive);
|
|
6
|
+
|
|
7
|
+
event ClaimReward(
|
|
8
|
+
address indexed user,
|
|
9
|
+
address indexed rewardToken,
|
|
10
|
+
uint256 lastEpochClaimed,
|
|
11
|
+
uint256 totalReward
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
function fund(uint256[] calldata rewardsForEpoch) external;
|
|
15
|
+
|
|
16
|
+
function claimReward(address user) external returns (uint256 amountRewardOut);
|
|
17
|
+
|
|
18
|
+
function incentivesForEpoch(uint256 epoch) external returns (uint256);
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.15;
|
|
3
|
+
|
|
4
|
+
interface IPFeeDistributorFactory {
|
|
5
|
+
function lastFinishedEpoch() external returns (uint256);
|
|
6
|
+
|
|
7
|
+
function updateUserShare(address user, address pool) external;
|
|
8
|
+
|
|
9
|
+
function getUserAndTotalSharesAt(
|
|
10
|
+
address user,
|
|
11
|
+
address pool,
|
|
12
|
+
uint256 epoch
|
|
13
|
+
) external view returns (uint256 userShare, uint256 totalShare);
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.8.0;
|
|
4
|
+
|
|
5
|
+
interface IPMsgSendEndpoint {
|
|
6
|
+
function calcFee(
|
|
7
|
+
address dstAddress,
|
|
8
|
+
uint256 dstChainId,
|
|
9
|
+
bytes calldata message
|
|
10
|
+
) external view returns (uint256);
|
|
11
|
+
|
|
12
|
+
function sendMessage(
|
|
13
|
+
address dstAddress,
|
|
14
|
+
uint256 dstChainId,
|
|
15
|
+
bytes calldata message
|
|
16
|
+
) external payable;
|
|
17
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
pragma solidity 0.8.15;
|
|
2
2
|
|
|
3
3
|
import "../libraries/VeBalanceLib.sol";
|
|
4
|
+
import "../libraries/VeHistoryLib.sol";
|
|
4
5
|
|
|
5
6
|
interface IPVotingController {
|
|
6
7
|
event AddPool(uint64 indexed chainId, address indexed pool);
|
|
@@ -16,4 +17,25 @@ interface IPVotingController {
|
|
|
16
17
|
uint128 indexed wTime,
|
|
17
18
|
uint128 totalPendlePerSec
|
|
18
19
|
);
|
|
20
|
+
|
|
21
|
+
function applyPoolSlopeChanges(address pool) external;
|
|
22
|
+
|
|
23
|
+
function getUserPoolHistoryLength(address user, address pool) external view returns (uint256);
|
|
24
|
+
|
|
25
|
+
function getUserPoolHistoryAt(
|
|
26
|
+
address user,
|
|
27
|
+
address pool,
|
|
28
|
+
uint256 index
|
|
29
|
+
) external view returns (Checkpoint memory);
|
|
30
|
+
|
|
31
|
+
function getWeekData(uint128 wTime, address[] calldata pools)
|
|
32
|
+
external
|
|
33
|
+
view
|
|
34
|
+
returns (
|
|
35
|
+
bool isEpochFinalized,
|
|
36
|
+
uint128 totalVotes,
|
|
37
|
+
uint128[] memory poolVotes
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
function getPoolTotalVoteAt(address pool, uint128 wTime) external view returns (uint128);
|
|
19
41
|
}
|
|
@@ -4,8 +4,9 @@ pragma solidity 0.8.15;
|
|
|
4
4
|
|
|
5
5
|
import "./IPVeToken.sol";
|
|
6
6
|
import "../libraries/VeBalanceLib.sol";
|
|
7
|
+
import "../libraries/VeHistoryLib.sol";
|
|
7
8
|
|
|
8
|
-
interface
|
|
9
|
+
interface IPVotingEscrowMainchain is IPVeToken {
|
|
9
10
|
event NewLockPosition(address indexed user, uint128 amount, uint128 expiry);
|
|
10
11
|
|
|
11
12
|
event Withdraw(address indexed user, uint128 amount);
|
|
@@ -21,4 +22,13 @@ interface IPVotingEscrow is IPVeToken {
|
|
|
21
22
|
returns (uint128);
|
|
22
23
|
|
|
23
24
|
function withdraw() external returns (uint128);
|
|
25
|
+
|
|
26
|
+
function totalSupplyAt(uint128 timestamp) external view returns (uint128);
|
|
27
|
+
|
|
28
|
+
function getUserHistoryLength(address user) external view returns (uint256);
|
|
29
|
+
|
|
30
|
+
function getUserHistoryAt(address user, uint256 index)
|
|
31
|
+
external
|
|
32
|
+
view
|
|
33
|
+
returns (Checkpoint memory);
|
|
24
34
|
}
|
|
@@ -87,13 +87,8 @@ interface ISuperComposableYield is IERC20Metadata {
|
|
|
87
87
|
address receiver,
|
|
88
88
|
uint256 amountSharesToRedeem,
|
|
89
89
|
address tokenOut,
|
|
90
|
-
uint256 minTokenOut
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
function redeemAfterTransfer(
|
|
94
|
-
address receiver,
|
|
95
|
-
address tokenOut,
|
|
96
|
-
uint256 minTokenOut
|
|
90
|
+
uint256 minTokenOut,
|
|
91
|
+
bool burnFromInternalBalance
|
|
97
92
|
) external returns (uint256 amountTokenOut);
|
|
98
93
|
|
|
99
94
|
/**
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.15;
|
|
3
|
+
|
|
4
|
+
/// Adapted from UniswapV3's Oracle
|
|
5
|
+
|
|
6
|
+
library Errors {
|
|
7
|
+
// MARKET + MARKET MATH CORE
|
|
8
|
+
error MarketExpired();
|
|
9
|
+
error MarketZeroAmountsInput();
|
|
10
|
+
error MarketZeroAmountsOutput();
|
|
11
|
+
error MarketZeroLnImpliedRate();
|
|
12
|
+
error MarketInsufficientPtForTrade(int256 currentAmount, int256 requiredAmount);
|
|
13
|
+
error MarketInsufficientPtReceived(uint256 actualBalance, uint256 requiredBalance);
|
|
14
|
+
error MarketInsufficientScyReceived(uint256 actualBalance, uint256 requiredBalance);
|
|
15
|
+
error MarketZeroTotalPtOrTotalAsset(int256 totalPt, int256 totalAsset);
|
|
16
|
+
error MarketExchangeRateBelowOne(int256 exchangeRate);
|
|
17
|
+
error MarketProportionMustNotEqualOne();
|
|
18
|
+
error MarketRateScalarBelowZero(int256 rateScalar);
|
|
19
|
+
error MarketScalarRootBelowZero(int256 scalarRoot);
|
|
20
|
+
error MarketProportionTooHigh(int256 proportion, int256 maxProportion);
|
|
21
|
+
|
|
22
|
+
error OracleUninitialized();
|
|
23
|
+
error OracleTargetTooOld(uint32 target, uint32 oldest);
|
|
24
|
+
error OracleZeroCardinality();
|
|
25
|
+
|
|
26
|
+
error MarketFactoryExpiredPt();
|
|
27
|
+
error MarketFactoryInvalidPt();
|
|
28
|
+
error MarketFactoryMarketExists();
|
|
29
|
+
|
|
30
|
+
error MFactoryLnFeeRateRootTooHigh(uint88 lnFeeRateRoot, uint256 maxLnFeeRateRoot);
|
|
31
|
+
error MFactoryReserveFeePercentTooHigh(uint8 reserveFeePercent, uint8 maxReserveFeePercent);
|
|
32
|
+
|
|
33
|
+
// ROUTER
|
|
34
|
+
error RouterInsufficientLpOut(uint256 actualLpOut, uint256 requiredLpOut);
|
|
35
|
+
error RouterInsufficientScyOut(uint256 actualScyOut, uint256 requiredScyOut);
|
|
36
|
+
error RouterInsufficientPtOut(uint256 actualPtOut, uint256 requiredPtOut);
|
|
37
|
+
error RouterInsufficientYtOut(uint256 actualYtOut, uint256 requiredYtOut);
|
|
38
|
+
error RouterInsufficientPYOut(uint256 actualPYOut, uint256 requiredPYOut);
|
|
39
|
+
error RouterInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
|
|
40
|
+
error RouterExceededLimitScyIn(uint256 actualScyIn, uint256 limitScyIn);
|
|
41
|
+
error RouterExceededLimitPtIn(uint256 actualPtIn, uint256 limitPtIn);
|
|
42
|
+
error RouterExceededLimitYtIn(uint256 actualYtIn, uint256 limitYtIn);
|
|
43
|
+
error RouterInsufficientScyRepay(uint256 actualScyRepay, uint256 requiredScyRepay);
|
|
44
|
+
error RouterInsufficientPtRepay(uint256 actualPtRepay, uint256 requiredPtRepay);
|
|
45
|
+
|
|
46
|
+
error RouterTimeRangeZero();
|
|
47
|
+
error RouterCallbackNotPendleMarket(address caller);
|
|
48
|
+
error RouterInvalidAction(bytes4 selector);
|
|
49
|
+
|
|
50
|
+
// YIELD CONTRACT
|
|
51
|
+
error YCExpired();
|
|
52
|
+
error YCNotExpired();
|
|
53
|
+
error YieldContractInsufficientScy(uint256 actualScy, uint256 requiredScy);
|
|
54
|
+
error YCNothingToRedeem();
|
|
55
|
+
error YCPostExpiryDataNotSet();
|
|
56
|
+
error YCNoFloatingScy();
|
|
57
|
+
|
|
58
|
+
// YieldFactory
|
|
59
|
+
error YCFactoryInvalidExpiry();
|
|
60
|
+
error YCFactoryYieldContractExisted();
|
|
61
|
+
|
|
62
|
+
// SCY
|
|
63
|
+
error SCYInvalidTokenIn(address token);
|
|
64
|
+
error SCYInvalidTokenOut(address token);
|
|
65
|
+
error SCYZeroDeposit();
|
|
66
|
+
error SCYZeroRedeem();
|
|
67
|
+
error SCYInsufficientSharesOut(uint256 actualSharesOut, uint256 requiredSharesOut);
|
|
68
|
+
error SCYInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
|
|
69
|
+
|
|
70
|
+
// SCY-specific
|
|
71
|
+
error SCYQiTokenMintFailed(uint256 errCode);
|
|
72
|
+
error SCYQiTokenRedeemFailed(uint256 errCode);
|
|
73
|
+
error SCYQiTokenRedeemRewardsFailed(uint256 rewardAccuredType0, uint256 rewardAccuredType1);
|
|
74
|
+
error SCYQiTokenBorrowRateTooHigh(uint256 borrowRate, uint256 borrowRateMax);
|
|
75
|
+
|
|
76
|
+
error SCYCurveInvalidPid();
|
|
77
|
+
error SCYCurve3crvPoolNotFound();
|
|
78
|
+
|
|
79
|
+
// Liquidity Mining
|
|
80
|
+
error VCInactivePool(address pool);
|
|
81
|
+
error VCPoolAlreadyActive(address pool);
|
|
82
|
+
error VCZeroVePendle(address user);
|
|
83
|
+
error VCExceededMaxWeight(uint256 totalWeight, uint256 maxWeight);
|
|
84
|
+
error VCEpochNotFinalized(uint256 wTime);
|
|
85
|
+
error VCPoolAlreadyAddAndRemoved(address pool);
|
|
86
|
+
|
|
87
|
+
error VEInvalidNewExpiry(uint256 newExpiry);
|
|
88
|
+
error VEExceededMaxLockTime();
|
|
89
|
+
error VEInsufficientLockTime();
|
|
90
|
+
error VENotAllowedReduceExpiry();
|
|
91
|
+
error VEZeroAmountLocked();
|
|
92
|
+
error VEPositionNotExpired();
|
|
93
|
+
error VEZeroPosition();
|
|
94
|
+
error VEZeroSlope(uint128 bias, uint128 slope);
|
|
95
|
+
|
|
96
|
+
error GCNotPendleMarket(address caller);
|
|
97
|
+
error GCNotVotingController(address caller);
|
|
98
|
+
|
|
99
|
+
error InvalidWTime(uint256 wTime);
|
|
100
|
+
error ExpiryInThePast(uint256 expiry);
|
|
101
|
+
error ChainNotSupported(uint256 chainId);
|
|
102
|
+
|
|
103
|
+
error FDCantFundFutureEpoch();
|
|
104
|
+
error FDFactoryDistributorAlreadyExisted(address pool, address distributor);
|
|
105
|
+
|
|
106
|
+
// Cross-Chain
|
|
107
|
+
error MsgNotFromSendEndpoint(address sender);
|
|
108
|
+
error MsgNotFromReceiveEndpoint(address sender);
|
|
109
|
+
error InsufficientFeeToSendMsg(uint256 currentFee, uint256 requiredFee);
|
|
110
|
+
|
|
111
|
+
// GENERIC MSG
|
|
112
|
+
error ArrayLengthMismatch();
|
|
113
|
+
error ArrayEmpty();
|
|
114
|
+
error ArrayOutOfBounds();
|
|
115
|
+
error ZeroAddress();
|
|
116
|
+
|
|
117
|
+
error OnlyCelerBus();
|
|
118
|
+
error OnlyYT();
|
|
119
|
+
error OnlyYCFactory();
|
|
120
|
+
error OnlyWhitelisted();
|
|
121
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.15;
|
|
3
3
|
|
|
4
|
+
import "./Errors.sol";
|
|
5
|
+
|
|
4
6
|
/// Adapted from UniswapV3's Oracle
|
|
5
7
|
|
|
6
8
|
library OracleLib {
|
|
@@ -67,7 +69,7 @@ library OracleLib {
|
|
|
67
69
|
uint16 current,
|
|
68
70
|
uint16 next
|
|
69
71
|
) public returns (uint16) {
|
|
70
|
-
|
|
72
|
+
if (current == 0) revert Errors.OracleUninitialized();
|
|
71
73
|
// no-op if the passed next value isn't greater than the current next value
|
|
72
74
|
if (next <= current) return current;
|
|
73
75
|
// store in each slot to prevent fresh SSTOREs in swaps
|
|
@@ -139,7 +141,8 @@ library OracleLib {
|
|
|
139
141
|
if (!beforeOrAt.initialized) beforeOrAt = self[0];
|
|
140
142
|
|
|
141
143
|
// ensure that the target is chronologically at or after the oldest observation
|
|
142
|
-
|
|
144
|
+
if (target < beforeOrAt.blockTimestamp)
|
|
145
|
+
revert Errors.OracleTargetTooOld(target, beforeOrAt.blockTimestamp);
|
|
143
146
|
|
|
144
147
|
// if we've reached this point, we have to binary search
|
|
145
148
|
return binarySearch(self, target, index, cardinality);
|
|
@@ -197,7 +200,7 @@ library OracleLib {
|
|
|
197
200
|
uint16 index,
|
|
198
201
|
uint16 cardinality
|
|
199
202
|
) public view returns (uint216[] memory lnImpliedRateCumulative) {
|
|
200
|
-
|
|
203
|
+
if (cardinality == 0) revert Errors.OracleZeroCardinality();
|
|
201
204
|
|
|
202
205
|
lnImpliedRateCumulative = new uint216[](secondsAgos.length);
|
|
203
206
|
for (uint256 i = 0; i < lnImpliedRateCumulative.length; ++i) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.15;
|
|
3
3
|
|
|
4
4
|
import "./math/Math.sol";
|
|
5
|
+
import "./Errors.sol";
|
|
5
6
|
|
|
6
7
|
struct VeBalance {
|
|
7
8
|
uint128 bias;
|
|
@@ -55,11 +56,14 @@ library VeBalanceLib {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
function getValueAt(VeBalance memory a, uint128 t) internal pure returns (uint128) {
|
|
59
|
+
if (a.slope * t > a.bias) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
58
62
|
return a.bias - a.slope * t;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
function getExpiry(VeBalance memory a) internal pure returns (uint128) {
|
|
62
|
-
|
|
66
|
+
if (a.slope == 0) revert Errors.VEZeroSlope(a.bias, a.slope);
|
|
63
67
|
return a.bias / a.slope;
|
|
64
68
|
}
|
|
65
69
|
|
|
@@ -4,42 +4,31 @@ pragma solidity ^0.8.0;
|
|
|
4
4
|
|
|
5
5
|
import "./math/Math.sol";
|
|
6
6
|
import "./VeBalanceLib.sol";
|
|
7
|
+
import "./math/WeekMath.sol";
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
struct Checkpoint {
|
|
10
|
+
uint128 timestamp;
|
|
11
|
+
VeBalance value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
library CheckpointHelper {
|
|
15
|
+
function assignWith(Checkpoint memory a, Checkpoint memory b) internal pure {
|
|
16
|
+
a.timestamp = b.timestamp;
|
|
17
|
+
a.value = b.value;
|
|
12
18
|
}
|
|
19
|
+
}
|
|
13
20
|
|
|
21
|
+
library Checkpoints {
|
|
14
22
|
struct History {
|
|
15
23
|
Checkpoint[] _checkpoints;
|
|
16
24
|
}
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
function getAtTimestamp(History storage self, uint256 timestamp)
|
|
23
|
-
internal
|
|
24
|
-
view
|
|
25
|
-
returns (uint128)
|
|
26
|
-
{
|
|
27
|
-
require(timestamp < block.timestamp, "Checkpoints: block not yet mined");
|
|
26
|
+
function length(History storage self) internal view returns (uint256) {
|
|
27
|
+
return self._checkpoints.length;
|
|
28
|
+
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
while (low < high) {
|
|
32
|
-
uint256 mid = (low + high) / 2;
|
|
33
|
-
if (self._checkpoints[mid]._timestamp > timestamp) {
|
|
34
|
-
high = mid;
|
|
35
|
-
} else {
|
|
36
|
-
low = mid + 1;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return
|
|
40
|
-
high == 0
|
|
41
|
-
? 0
|
|
42
|
-
: VeBalanceLib.getValueAt(self._checkpoints[high - 1]._value, uint128(timestamp));
|
|
30
|
+
function get(History storage self, uint256 index) internal view returns (Checkpoint memory) {
|
|
31
|
+
return self._checkpoints[index];
|
|
43
32
|
}
|
|
44
33
|
|
|
45
34
|
/**
|
|
@@ -49,11 +38,11 @@ library Checkpoints {
|
|
|
49
38
|
*/
|
|
50
39
|
function push(History storage self, VeBalance memory value) internal {
|
|
51
40
|
uint256 pos = self._checkpoints.length;
|
|
52
|
-
if (pos > 0 && self._checkpoints[pos - 1].
|
|
53
|
-
self._checkpoints[pos - 1].
|
|
41
|
+
if (pos > 0 && self._checkpoints[pos - 1].timestamp == WeekMath.getCurrentWeekStart()) {
|
|
42
|
+
self._checkpoints[pos - 1].value = value;
|
|
54
43
|
} else {
|
|
55
44
|
self._checkpoints.push(
|
|
56
|
-
Checkpoint({
|
|
45
|
+
Checkpoint({ timestamp: WeekMath.getCurrentWeekStart(), value: value })
|
|
57
46
|
);
|
|
58
47
|
}
|
|
59
48
|
}
|
|
@@ -39,21 +39,4 @@ library ArrayLib {
|
|
|
39
39
|
}
|
|
40
40
|
out[length] = element;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
function sub(uint256[] memory a, uint256[] memory b)
|
|
44
|
-
internal
|
|
45
|
-
pure
|
|
46
|
-
returns (uint256[] memory res)
|
|
47
|
-
{
|
|
48
|
-
uint256 length = a.length;
|
|
49
|
-
require(length == b.length, "length mismatch");
|
|
50
|
-
res = new uint256[](length);
|
|
51
|
-
|
|
52
|
-
for (uint256 i = 0; i < length; ) {
|
|
53
|
-
res[i] = a[i] - b[i];
|
|
54
|
-
unchecked {
|
|
55
|
-
i++;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
42
|
}
|