@pendle/core-v2 0.8.0-beta-11 → 0.8.1-beta
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/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.json +39 -7
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.json +2 -2
- 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 +39 -7
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.json +38 -6
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.json +864 -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 +38 -6
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultScy.sol/PendleYearnVaultSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultScy.sol/PendleYearnVaultSCY.json +38 -6
- 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 +36 -4
- 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 +36 -4
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +242 -0
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/{PendleGaugeControllerSidechain.sol → PendleGaugeControllerSidechainUpg.sol}/PendleGaugeControllerSidechainUpg.json +3 -3
- 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 +2 -15
- 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 +0 -13
- 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 +2 -2
- 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 +2 -2
- 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 +30 -105
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- package/build/artifacts/contracts/core/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleERC20.sol/PendleERC20.json +2 -2
- package/build/artifacts/contracts/core/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.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 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +83 -2
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionCore.sol/ActionCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCore.sol/ActionCore.json +706 -32
- package/build/artifacts/contracts/core/actions/ActionYT.sol/ActionYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionYT.sol/ActionYT.json +12 -117
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPTBase.sol/ActionSCYAndPTBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPTBase.sol/ActionSCYAndPTBase.json +0 -148
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPYBase.sol/ActionSCYAndPYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPYBase.sol/ActionSCYAndPYBase.json +0 -148
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndYTBase.sol/ActionSCYAndYTBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndYTBase.sol/ActionSCYAndYTBase.json +0 -173
- package/build/artifacts/contracts/core/actions/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAavePool.sol/IAavePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAaveRewardsController.sol/IAaveRewardsController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IJoePair.sol/IJoePair.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IJoeRouter01.sol/IJoeRouter01.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IJoeRouter02.sol/IJoeRouter02.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.json +837 -15
- package/build/artifacts/contracts/interfaces/IPActionYT.sol/IPActionYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionYT.sol/IPActionYT.json +68 -0
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +905 -15
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGovernanceManager.sol/IPGovernanceManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +28 -28
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPermissionsV2Upg.sol/IPermissionsV2Upg.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.json +15 -0
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrow.sol/IPVotingEscrow.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +81 -0
- 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/IREDACTEDStaking.sol/IREDACTEDStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateLPStaking.sol/IStargateLPStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateLPStaking.sol/IStargateLPStaking.json +90 -0
- package/build/artifacts/contracts/interfaces/IStargatePool.sol/IStargatePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargatePool.sol/IStargatePool.json +79 -0
- package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.json +36 -4
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWXBTRFLY.sol/IWXBTRFLY.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IYearnVault.sol/IYearnVault.dbg.json +1 -1
- 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/SCY/SCYIndex.sol/SCYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/SCY/SCYIndex.sol/SCYIndexLib.json +2 -2
- package/build/artifacts/contracts/libraries/SCY/SCYUtils.sol/SCYUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/SCY/SCYUtils.sol/SCYUtils.json +2 -2
- 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/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/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ExpiryUtilsLib.sol/ExpiryUtils.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/MiniHelpers.sol/MiniHelpers.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/LogExpMath.sol/LogExpMath.json +2 -2
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxLib.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/libraries/solmate/SSTORE2.sol/SSTORE2.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/solmate/SSTORE2.sol/SSTORE2.json +2 -2
- package/build/artifacts/contracts/libraries/traderjoe/JoeLibrary.sol/JoeLibrary.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/traderjoe/JoeLibrary.sol/JoeLibrary.json +2 -2
- package/build/artifacts/contracts/libraries/traderjoe/PendleJoeSwapHelperUpg.sol/PendleJoeSwapHelperUpg.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +324 -2
- package/build/artifacts/contracts/periphery/PendleGovernanceManager.sol/PendleGovernanceManager.dbg.json +1 -1
- package/build/artifacts/contracts/periphery/PendleGovernanceManager.sol/PendleGovernanceManager.json +2 -2
- package/build/artifacts/contracts/periphery/PermissionsV2Upg.sol/PermissionsV2Upg.dbg.json +1 -1
- package/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol +13 -3
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol +13 -9
- package/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol +12 -2
- package/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol +194 -0
- package/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol +12 -8
- package/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultScy.sol +12 -8
- package/contracts/SuperComposableYield/base-implementations/SCYBase.sol +10 -12
- package/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol +1 -2
- package/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol +1 -0
- package/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +1 -1
- package/contracts/core/LiquidityMining/GaugeController/{PendleGaugeControllerMainchain.sol → PendleGaugeControllerMainchainUpg.sol} +0 -0
- package/contracts/core/LiquidityMining/GaugeController/{PendleGaugeControllerSidechain.sol → PendleGaugeControllerSidechainUpg.sol} +0 -0
- package/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +18 -24
- package/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +8 -10
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +3 -3
- package/contracts/core/Market/PendleMarketFactory.sol +1 -0
- package/contracts/core/PendleERC20.sol +1 -1
- package/contracts/core/YieldContracts/PendleYieldToken.sol +0 -7
- package/contracts/core/actions/ActionCallback.sol +3 -1
- package/contracts/core/actions/base/ActionSCYAndYTBase.sol +1 -0
- package/contracts/core/actions/base/CallbackHelper.sol +1 -1
- package/contracts/interfaces/IPGaugeController.sol +1 -1
- package/contracts/interfaces/IPRouterStatic.sol +15 -3
- package/contracts/interfaces/IStargateLPStaking.sol +47 -0
- package/contracts/interfaces/IStargatePool.sol +49 -0
- package/contracts/interfaces/IStargateRouter.sol +37 -0
- package/contracts/interfaces/ISuperComposableYield.sol +6 -9
- package/contracts/libraries/RewardManager.sol +2 -3
- package/contracts/libraries/RewardManagerAbstract.sol +1 -0
- package/contracts/libraries/VeBalanceLib.sol +13 -0
- package/contracts/libraries/helpers/ArrayLib.sol +0 -17
- package/contracts/libraries/helpers/TokenHelper.sol +4 -2
- package/contracts/libraries/math/LogExpMath.sol +46 -44
- package/contracts/libraries/math/MarketApproxLib.sol +5 -7
- package/contracts/libraries/math/MarketMathCore.sol +14 -5
- package/contracts/libraries/math/Math.sol +14 -0
- package/contracts/offchain-helpers/RouterStatic.sol +163 -34
- package/deployments/43113-core.json +7 -7
- package/deployments/43113-markets/benqi-market-4Ccb97.json +7 -0
- package/deployments/43113-markets/benqi-market-534471.json +7 -0
- package/deployments/80001-core.json +6 -6
- package/deployments/80001-markets/benqi-market-109acB.json +7 -0
- package/deployments/80001-markets/benqi-market-4e470E.json +7 -0
- package/package.json +3 -3
- package/typechain-types/ActionCore.ts +669 -38
- package/typechain-types/ActionSCYAndPTBase.ts +3 -129
- package/typechain-types/ActionSCYAndPYBase.ts +3 -129
- package/typechain-types/ActionSCYAndYTBase.ts +3 -149
- package/typechain-types/ActionYT.ts +31 -117
- package/typechain-types/IPActionCore.ts +760 -3
- package/typechain-types/IPActionYT.ts +63 -3
- package/typechain-types/IPAllAction.ts +818 -3
- package/typechain-types/IPMarket.ts +38 -38
- package/typechain-types/IPRouterStatic.ts +45 -9
- package/typechain-types/IPYieldToken.ts +74 -0
- package/typechain-types/IStargateLPStaking.ts +108 -0
- package/typechain-types/IStargatePool.ts +94 -0
- package/typechain-types/ISuperComposableYield.ts +72 -26
- package/typechain-types/PendleAaveV3SCY.ts +74 -28
- package/typechain-types/PendleERC4626SCY.ts +73 -27
- package/typechain-types/PendleMarket.ts +38 -142
- package/typechain-types/PendleQiTokenSCY.ts +74 -28
- package/typechain-types/PendleStargatePool.ts +73 -27
- package/typechain-types/PendleStargateSCY.ts +1135 -0
- package/typechain-types/PendleVotingControllerUpg.ts +0 -21
- package/typechain-types/PendleWstEthSCY.ts +73 -27
- package/typechain-types/PendleYearnVaultScy.ts +73 -27
- package/typechain-types/PendleYieldToken.ts +74 -0
- package/typechain-types/RouterStatic.ts +520 -36
- package/typechain-types/SCYBase.ts +73 -27
- package/typechain-types/SCYBaseWithRewards.ts +73 -27
- package/typechain-types/VotingControllerStorageUpg.ts +0 -21
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionCore__factory.ts +705 -31
- package/typechain-types/factories/ActionSCYAndPTBase__factory.ts +0 -148
- package/typechain-types/factories/ActionSCYAndPYBase__factory.ts +0 -148
- package/typechain-types/factories/ActionSCYAndYTBase__factory.ts +0 -173
- package/typechain-types/factories/ActionYT__factory.ts +11 -116
- package/typechain-types/factories/ERC20__factory.ts +1 -1
- package/typechain-types/factories/IPActionCore__factory.ts +837 -15
- package/typechain-types/factories/IPActionYT__factory.ts +68 -0
- package/typechain-types/factories/IPAllAction__factory.ts +905 -15
- package/typechain-types/factories/IPMarket__factory.ts +28 -28
- package/typechain-types/factories/IPRouterStatic__factory.ts +15 -0
- package/typechain-types/factories/IPYieldToken__factory.ts +81 -0
- package/typechain-types/factories/IStargateLPStaking__factory.ts +90 -0
- package/typechain-types/factories/IStargatePool__factory.ts +79 -0
- package/typechain-types/factories/ISuperComposableYield__factory.ts +36 -4
- package/typechain-types/factories/PendleAaveV3SCY__factory.ts +38 -6
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20__factory.ts +1 -1
- package/typechain-types/factories/PendleERC4626SCY__factory.ts +37 -5
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGovernanceManager__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +29 -104
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSCY__factory.ts +38 -6
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleStargatePool__factory.ts +37 -5
- package/typechain-types/factories/PendleStargateSCY__factory.ts +952 -0
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -14
- package/typechain-types/factories/PendleWstEthSCY__factory.ts +37 -5
- package/typechain-types/factories/PendleYearnVaultScy__factory.ts +37 -5
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +82 -1
- package/typechain-types/factories/RouterStatic__factory.ts +323 -1
- package/typechain-types/factories/SCYBaseWithRewards__factory.ts +36 -4
- package/typechain-types/factories/SCYBase__factory.ts +36 -4
- package/typechain-types/factories/VotingControllerStorageUpg__factory.ts +0 -13
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +9 -0
- package/typechain-types/index.ts +2 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargatePool.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargatePool.json +0 -837
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchain.sol/PendleGaugeControllerMainchainUpg.dbg.json +0 -4
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchain.sol/PendleGaugeControllerMainchainUpg.json +0 -242
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechain.sol/PendleGaugeControllerSidechainUpg.dbg.json +0 -4
- package/deployments/43113-markets/benqi-market-5C60ba.json +0 -7
- package/deployments/43113-markets/benqi-market-611eA3.json +0 -7
- package/deployments/43113-markets/benqi-market-A386eA.json +0 -7
- package/deployments/43113-markets/benqi-market-bf8841.json +0 -7
- package/deployments/80001-markets/benqi-market-5E1104.json +0 -7
- package/deployments/80001-markets/benqi-market-899134.json +0 -7
- package/deployments/80001-markets/benqi-market-94C86f.json +0 -7
- package/deployments/80001-markets/benqi-market-c68429.json +0 -7
package/build/artifacts/contracts/periphery/PendleGovernanceManager.sol/PendleGovernanceManager.json
CHANGED
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"type": "function"
|
|
81
81
|
}
|
|
82
82
|
],
|
|
83
|
-
"bytecode": "
|
|
84
|
-
"deployedBytecode": "
|
|
83
|
+
"bytecode": "0x608060405234801561001057600080fd5b5060405161036238038061036283398101604081905261002f9161009d565b6001600160a01b0381166100785760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b604482015260640160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100cd565b6000602082840312156100af57600080fd5b81516001600160a01b03811681146100c657600080fd5b9392505050565b610286806100dc6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80635aa6e675146100515780635d36b19014610080578063d38bfff41461008a578063f39c38a01461009d575b600080fd5b600054610064906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100b0565b005b610088610098366004610220565b61016d565b600154610064906001600160a01b031681565b6001546001600160a01b031633146100fb5760405162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b60448201526064015b60405180910390fd5b600154600054604080516001600160a01b0393841681529290911660208301527f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80910160405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031633146101b95760405162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b60448201526064016100f2565b6001600160a01b0381166101fe5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016100f2565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561023257600080fd5b81356001600160a01b038116811461024957600080fd5b939250505056fea26469706673582212203083b29bac58d69ca2c3b85c73ccf222186a27dcfb339c1a201b7247172f296464736f6c634300080f0033",
|
|
84
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80635aa6e675146100515780635d36b19014610080578063d38bfff41461008a578063f39c38a01461009d575b600080fd5b600054610064906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100b0565b005b610088610098366004610220565b61016d565b600154610064906001600160a01b031681565b6001546001600160a01b031633146100fb5760405162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b60448201526064015b60405180910390fd5b600154600054604080516001600160a01b0393841681529290911660208301527f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80910160405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031633146101b95760405162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b60448201526064016100f2565b6001600160a01b0381166101fe5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016100f2565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561023257600080fd5b81356001600160a01b038116811461024957600080fd5b939250505056fea26469706673582212203083b29bac58d69ca2c3b85c73ccf222186a27dcfb339c1a201b7247172f296464736f6c634300080f0033",
|
|
85
85
|
"linkReferences": {},
|
|
86
86
|
"deployedLinkReferences": {}
|
|
87
87
|
}
|
|
@@ -127,14 +127,24 @@ contract PendleAaveV3SCY is SCYBaseWithRewards {
|
|
|
127
127
|
amountTokenOut = _scaledBalanceToAToken(amountSharesToRedeem);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
function
|
|
130
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
131
131
|
res = new address[](2);
|
|
132
132
|
res[0] = underlying;
|
|
133
133
|
res[1] = aToken;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
function
|
|
137
|
-
res = (
|
|
136
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
137
|
+
res = new address[](2);
|
|
138
|
+
res[0] = underlying;
|
|
139
|
+
res[1] = aToken;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
143
|
+
return token == underlying || token == aToken;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
147
|
+
return token == underlying || token == aToken;
|
|
138
148
|
}
|
|
139
149
|
|
|
140
150
|
function assetInfo()
|
|
@@ -166,20 +166,24 @@ contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
|
|
|
166
166
|
else amountTokenOut = (amountSharesToRedeem * exchangeRate()) / 1e18;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
* @dev See {ISuperComposableYield-getBaseTokens}
|
|
171
|
-
*/
|
|
172
|
-
function getBaseTokens() public view override returns (address[] memory res) {
|
|
169
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
173
170
|
res = new address[](2);
|
|
174
171
|
res[0] = qiToken;
|
|
175
172
|
res[1] = underlying;
|
|
176
173
|
}
|
|
177
174
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
176
|
+
res = new address[](2);
|
|
177
|
+
res[0] = qiToken;
|
|
178
|
+
res[1] = underlying;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
182
|
+
return token == qiToken || token == underlying;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
186
|
+
return token == qiToken || token == underlying;
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
function assetInfo()
|
|
@@ -95,13 +95,23 @@ contract PendleERC4626SCY is SCYBase {
|
|
|
95
95
|
else amountTokenOut = (amountSharesToRedeem * exchangeRate()) / 1e18;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
function
|
|
98
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
99
99
|
res = new address[](2);
|
|
100
100
|
res[0] = underlying;
|
|
101
101
|
res[1] = yieldToken;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
function
|
|
104
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
105
|
+
res = new address[](2);
|
|
106
|
+
res[0] = underlying;
|
|
107
|
+
res[1] = yieldToken;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
111
|
+
return token == underlying || token == yieldToken;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
105
115
|
return token == underlying || token == yieldToken;
|
|
106
116
|
}
|
|
107
117
|
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.15;
|
|
3
|
+
import "../base-implementations/SCYBaseWithRewards.sol";
|
|
4
|
+
import "../../interfaces/IStargateRouter.sol";
|
|
5
|
+
import "../../interfaces/IStargatePool.sol";
|
|
6
|
+
import "../../interfaces/IStargateLPStaking.sol";
|
|
7
|
+
|
|
8
|
+
contract PendleStargateSCY is SCYBaseWithRewards {
|
|
9
|
+
address public immutable stgRouter;
|
|
10
|
+
uint16 public immutable stgRouterPoolId;
|
|
11
|
+
|
|
12
|
+
address public immutable stgStakingLP;
|
|
13
|
+
uint256 public immutable pid;
|
|
14
|
+
|
|
15
|
+
address public immutable underlying;
|
|
16
|
+
address public immutable stgPool;
|
|
17
|
+
address public immutable stgToken;
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
string memory _name,
|
|
21
|
+
string memory _symbol,
|
|
22
|
+
address _stgRouter,
|
|
23
|
+
address _stgStakingLP,
|
|
24
|
+
uint256 _pid,
|
|
25
|
+
address _stgPool
|
|
26
|
+
) SCYBaseWithRewards(_name, _symbol, _stgPool) {
|
|
27
|
+
stgRouter = _stgRouter;
|
|
28
|
+
|
|
29
|
+
// I dont think we need safecast for a trusted call like this
|
|
30
|
+
stgRouterPoolId = uint16(IStargatePool(_stgPool).poolId());
|
|
31
|
+
|
|
32
|
+
stgStakingLP = _stgStakingLP;
|
|
33
|
+
pid = _pid;
|
|
34
|
+
|
|
35
|
+
stgPool = _stgPool;
|
|
36
|
+
stgToken = IStargateLPStaking(_stgStakingLP).stargate();
|
|
37
|
+
underlying = IStargatePool(stgPool).token();
|
|
38
|
+
|
|
39
|
+
// verify _pid
|
|
40
|
+
require(
|
|
41
|
+
IStargateLPStaking(_stgStakingLP).poolInfo(_pid).lpToken == _stgPool,
|
|
42
|
+
"invalid pid"
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
_safeApprove(underlying, _stgRouter, type(uint256).max);
|
|
46
|
+
// There is not a need to approve LP for router since stargate uses direct burn
|
|
47
|
+
// _safeApprove(stgPool, _stgRouter, type(uint256).max);
|
|
48
|
+
_safeApprove(stgPool, _stgStakingLP, type(uint256).max);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/*///////////////////////////////////////////////////////////////
|
|
52
|
+
DEPOSIT/REDEEM USING BASE TOKENS
|
|
53
|
+
//////////////////////////////////////////////////////////////*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @dev See {SCYBase-_deposit}
|
|
57
|
+
*
|
|
58
|
+
* The underlying yield token is stargateLP. If the base token deposited is underlying, the function addLiquidity
|
|
59
|
+
* using stargateRouter first. Then the amount of LP out will be taken into calculation.
|
|
60
|
+
*
|
|
61
|
+
* The exchange rate of stargateLP to shares is 1:1
|
|
62
|
+
*/
|
|
63
|
+
function _deposit(address tokenIn, uint256 amountDeposited)
|
|
64
|
+
internal
|
|
65
|
+
virtual
|
|
66
|
+
override
|
|
67
|
+
returns (uint256 amountSharesOut)
|
|
68
|
+
{
|
|
69
|
+
if (tokenIn == stgPool) {
|
|
70
|
+
amountSharesOut = amountDeposited;
|
|
71
|
+
} else {
|
|
72
|
+
uint256 preBalanceStgPool = _selfBalance(stgPool);
|
|
73
|
+
IStargateRouter(stgRouter).addLiquidity(
|
|
74
|
+
stgRouterPoolId,
|
|
75
|
+
amountDeposited,
|
|
76
|
+
address(this)
|
|
77
|
+
);
|
|
78
|
+
amountSharesOut = _selfBalance(stgPool) - preBalanceStgPool;
|
|
79
|
+
}
|
|
80
|
+
IStargateLPStaking(stgStakingLP).deposit(pid, amountSharesOut);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @dev See {SCYBase-_redeem}
|
|
85
|
+
*
|
|
86
|
+
* The staked tokens are firstly withdraw from staking
|
|
87
|
+
*
|
|
88
|
+
* The shares are redeemed into underlying using router if necessary.
|
|
89
|
+
*/
|
|
90
|
+
function _redeem(address tokenOut, uint256 amountSharesToRedeem)
|
|
91
|
+
internal
|
|
92
|
+
virtual
|
|
93
|
+
override
|
|
94
|
+
returns (uint256 amountTokenOut)
|
|
95
|
+
{
|
|
96
|
+
IStargateLPStaking(stgStakingLP).withdraw(pid, amountSharesToRedeem);
|
|
97
|
+
if (tokenOut == stgPool) {
|
|
98
|
+
amountTokenOut = amountSharesToRedeem;
|
|
99
|
+
} else {
|
|
100
|
+
uint256 preBalanceStgLp = IERC20(stgPool).balanceOf(address(this));
|
|
101
|
+
amountTokenOut = IStargateRouter(stgRouter).instantRedeemLocal(
|
|
102
|
+
stgRouterPoolId,
|
|
103
|
+
amountSharesToRedeem,
|
|
104
|
+
address(this)
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
uint256 amountLpUsed = preBalanceStgLp - IERC20(stgPool).balanceOf(address(this));
|
|
108
|
+
|
|
109
|
+
// Since stargate is a bridge, sometime there might not be enough fund in the pool to redeem
|
|
110
|
+
// In this case, stargate contract doesn't revert
|
|
111
|
+
require(amountLpUsed == amountSharesToRedeem, "insufficient fund to redeem");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/*///////////////////////////////////////////////////////////////
|
|
116
|
+
EXCHANGE-RATE
|
|
117
|
+
//////////////////////////////////////////////////////////////*/
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @notice Calculates and updates the exchange rate of shares to underlying asset token
|
|
121
|
+
* @dev It is the exchange rate of stgPool to underlying
|
|
122
|
+
*/
|
|
123
|
+
function exchangeRate() public view virtual override returns (uint256 currentRate) {
|
|
124
|
+
return IStargatePool(stgPool).amountLPtoLD(SCYUtils.ONE);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/*///////////////////////////////////////////////////////////////
|
|
128
|
+
MISC FUNCTIONS FOR METADATA
|
|
129
|
+
//////////////////////////////////////////////////////////////*/
|
|
130
|
+
|
|
131
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
132
|
+
res = new address[](2);
|
|
133
|
+
res[0] = stgPool;
|
|
134
|
+
res[1] = underlying;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
138
|
+
res = new address[](2);
|
|
139
|
+
res[0] = stgPool;
|
|
140
|
+
res[1] = underlying;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
144
|
+
return token == stgPool || token == underlying;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
148
|
+
return token == stgPool || token == underlying;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function _previewDeposit(address tokenIn, uint256 amountTokenToDeposit)
|
|
152
|
+
internal
|
|
153
|
+
view
|
|
154
|
+
override
|
|
155
|
+
returns (uint256 amountSharesOut)
|
|
156
|
+
{
|
|
157
|
+
if (tokenIn == stgPool) amountSharesOut = amountTokenToDeposit;
|
|
158
|
+
else amountSharesOut = (amountTokenToDeposit * SCYUtils.ONE) / exchangeRate();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function _previewRedeem(address tokenOut, uint256 amountSharesToRedeem)
|
|
162
|
+
internal
|
|
163
|
+
view
|
|
164
|
+
override
|
|
165
|
+
returns (uint256 amountTokenOut)
|
|
166
|
+
{
|
|
167
|
+
if (tokenOut == stgPool) amountTokenOut = amountSharesToRedeem;
|
|
168
|
+
else amountTokenOut = (amountSharesToRedeem * exchangeRate()) / SCYUtils.ONE;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function assetInfo()
|
|
172
|
+
external
|
|
173
|
+
view
|
|
174
|
+
returns (
|
|
175
|
+
AssetType assetType,
|
|
176
|
+
address assetAddress,
|
|
177
|
+
uint8 assetDecimals
|
|
178
|
+
)
|
|
179
|
+
{
|
|
180
|
+
return (AssetType.TOKEN, stgPool, IERC20Metadata(stgPool).decimals());
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function _redeemExternalReward() internal override {
|
|
184
|
+
IStargateLPStaking(stgStakingLP).withdraw(pid, 0);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @dev See {ISuperComposableYield-getRewardTokens}
|
|
189
|
+
*/
|
|
190
|
+
function _getRewardTokens() internal view override returns (address[] memory res) {
|
|
191
|
+
res = new address[](1);
|
|
192
|
+
res[0] = stgToken;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -97,19 +97,23 @@ contract PendleWstEthSCY is SCYBase {
|
|
|
97
97
|
else amountTokenOut = (amountSharesToRedeem * exchangeRate()) / 1e18;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
* @dev See {ISuperComposableYield-getBaseTokens}
|
|
102
|
-
*/
|
|
103
|
-
function getBaseTokens() public view virtual override returns (address[] memory res) {
|
|
100
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
104
101
|
res = new address[](2);
|
|
105
102
|
res[0] = stETH;
|
|
106
103
|
res[1] = wstETH;
|
|
107
104
|
}
|
|
108
105
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
107
|
+
res = new address[](2);
|
|
108
|
+
res[0] = stETH;
|
|
109
|
+
res[1] = wstETH;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
113
|
+
return token == stETH || token == wstETH;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
113
117
|
return token == stETH || token == wstETH;
|
|
114
118
|
}
|
|
115
119
|
|
|
@@ -121,19 +121,23 @@ contract PendleYearnVaultSCY is SCYBase {
|
|
|
121
121
|
else amountTokenOut = (amountSharesToRedeem * exchangeRate()) / 1e18;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
* @dev See {ISuperComposableYield-getBaseTokens}
|
|
126
|
-
*/
|
|
127
|
-
function getBaseTokens() public view virtual override returns (address[] memory res) {
|
|
124
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
128
125
|
res = new address[](2);
|
|
129
126
|
res[0] = underlying;
|
|
130
127
|
res[1] = yvToken;
|
|
131
128
|
}
|
|
132
129
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
131
|
+
res = new address[](2);
|
|
132
|
+
res[0] = underlying;
|
|
133
|
+
res[1] = yvToken;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
137
|
+
return token == underlying || token == yvToken;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
137
141
|
return token == underlying || token == yvToken;
|
|
138
142
|
}
|
|
139
143
|
|
|
@@ -38,7 +38,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20, TokenHelper {
|
|
|
38
38
|
uint256 amountTokenToDeposit,
|
|
39
39
|
uint256 minSharesOut
|
|
40
40
|
) external payable nonReentrant returns (uint256 amountSharesOut) {
|
|
41
|
-
require(
|
|
41
|
+
require(isValidTokenIn(tokenIn), "SCY: Invalid tokenIn");
|
|
42
42
|
require(amountTokenToDeposit != 0, "SCY: amountTokenToDeposit cannot be 0");
|
|
43
43
|
|
|
44
44
|
if (tokenIn == NATIVE) require(msg.value == amountTokenToDeposit, "SCY: eth mismatch");
|
|
@@ -80,7 +80,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20, TokenHelper {
|
|
|
80
80
|
address tokenOut,
|
|
81
81
|
uint256 minTokenOut
|
|
82
82
|
) internal returns (uint256 amountTokenOut) {
|
|
83
|
-
require(
|
|
83
|
+
require(isValidTokenOut(tokenOut), "SCY: invalid tokenOut");
|
|
84
84
|
require(amountSharesToRedeem != 0, "SCY: amountSharesToRedeem cannot be 0");
|
|
85
85
|
|
|
86
86
|
amountTokenOut = _redeem(tokenOut, amountSharesToRedeem);
|
|
@@ -181,7 +181,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20, TokenHelper {
|
|
|
181
181
|
virtual
|
|
182
182
|
returns (uint256 amountSharesOut)
|
|
183
183
|
{
|
|
184
|
-
require(
|
|
184
|
+
require(isValidTokenIn(tokenIn), "SCY: Invalid tokenIn");
|
|
185
185
|
return _previewDeposit(tokenIn, amountTokenToDeposit);
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -191,7 +191,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20, TokenHelper {
|
|
|
191
191
|
virtual
|
|
192
192
|
returns (uint256 amountTokenOut)
|
|
193
193
|
{
|
|
194
|
-
require(
|
|
194
|
+
require(isValidTokenOut(tokenOut), "SCY: Invalid tokenOut");
|
|
195
195
|
return _previewRedeem(tokenOut, amountSharesToRedeem);
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -207,13 +207,11 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20, TokenHelper {
|
|
|
207
207
|
virtual
|
|
208
208
|
returns (uint256 amountTokenOut);
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
* @notice See {ISuperComposableYield-getBaseTokens}
|
|
212
|
-
*/
|
|
213
|
-
function getBaseTokens() external view virtual override returns (address[] memory res);
|
|
210
|
+
function getTokensIn() public view virtual returns (address[] memory res);
|
|
214
211
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
212
|
+
function getTokensOut() public view virtual returns (address[] memory res);
|
|
213
|
+
|
|
214
|
+
function isValidTokenIn(address token) public view virtual returns (bool);
|
|
215
|
+
|
|
216
|
+
function isValidTokenOut(address token) public view virtual returns (bool);
|
|
219
217
|
}
|
|
@@ -6,8 +6,7 @@ import "./SCYBase.sol";
|
|
|
6
6
|
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
7
7
|
import "../../libraries/math/Math.sol";
|
|
8
8
|
|
|
9
|
-
///
|
|
10
|
-
/// Please make sure that assumption always holds
|
|
9
|
+
/// NOTE: yieldToken MUST NEVER BE a rewardToken, else the rewardManager will behave erroneously
|
|
11
10
|
abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
|
|
12
11
|
using Math for uint256;
|
|
13
12
|
using ArrayLib for address[];
|
|
@@ -29,6 +29,7 @@ abstract contract CelerSenderUpg is PermissionsV2Upg {
|
|
|
29
29
|
assert(sidechainContracts.contains(chainId));
|
|
30
30
|
address toAddr = sidechainContracts.get(chainId);
|
|
31
31
|
uint256 fee = celerMessageBus.calcFee(message);
|
|
32
|
+
require(msg.value >= fee, "Insufficient celer fee");
|
|
32
33
|
celerMessageBus.sendMessage{ value: fee }(toAddr, chainId, message);
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -101,7 +101,7 @@ abstract contract PendleGaugeControllerBaseUpg is IPGaugeController, Permissions
|
|
|
101
101
|
epochRewardReceived[wTime] = true;
|
|
102
102
|
|
|
103
103
|
for (uint256 i = 0; i < markets.length; ++i) {
|
|
104
|
-
_addRewardsToMarket(markets[i],
|
|
104
|
+
_addRewardsToMarket(markets[i], pendleAmounts[i].Uint128());
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
emit ReceiveVotingResults(wTime, markets, pendleAmounts);
|
|
File without changes
|
|
File without changes
|
|
@@ -73,6 +73,7 @@ contract PendleVotingControllerUpg is
|
|
|
73
73
|
require(vePendle.balanceOf(user) > 0, "zero vependle balance");
|
|
74
74
|
|
|
75
75
|
UserData storage uData = userData[user];
|
|
76
|
+
LockedPosition memory userPosition = _getUserVePendlePosition(user);
|
|
76
77
|
|
|
77
78
|
for (uint256 i = 0; i < pools.length; ++i) {
|
|
78
79
|
if (_isPoolActive(pools[i])) applyPoolSlopeChanges(pools[i]);
|
|
@@ -80,12 +81,12 @@ contract PendleVotingControllerUpg is
|
|
|
80
81
|
|
|
81
82
|
for (uint256 i = 0; i < pools.length; ++i) {
|
|
82
83
|
if (uData.voteForPools[pools[i]].weight <= weights[i])
|
|
83
|
-
_modifyVoteWeight(user, pools[i], weights[i]);
|
|
84
|
+
_modifyVoteWeight(user, pools[i], userPosition, weights[i]);
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
for (uint256 i = 0; i < pools.length; ++i) {
|
|
87
88
|
if (uData.voteForPools[pools[i]].weight > weights[i])
|
|
88
|
-
_modifyVoteWeight(user, pools[i], weights[i]);
|
|
89
|
+
_modifyVoteWeight(user, pools[i], userPosition, weights[i]);
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -157,6 +158,8 @@ contract PendleVotingControllerUpg is
|
|
|
157
158
|
* @dev state changes expected:
|
|
158
159
|
- add to allActivePools & chainPools
|
|
159
160
|
- set params in poolData
|
|
161
|
+
* @dev NOTE TO GOV: previous week's results should have been broadcasted prior to calling
|
|
162
|
+
this function
|
|
160
163
|
*/
|
|
161
164
|
function addPool(uint64 chainId, address pool) external onlyGovernance {
|
|
162
165
|
require(!_isPoolActive(pool), "pool already added");
|
|
@@ -173,6 +176,8 @@ contract PendleVotingControllerUpg is
|
|
|
173
176
|
- update weekData (if any)
|
|
174
177
|
- remove from allActivePools & chainPools
|
|
175
178
|
- clear data in poolData
|
|
179
|
+
* @dev NOTE TO GOV: previous week's results should have been broadcasted prior to calling
|
|
180
|
+
this function
|
|
176
181
|
*/
|
|
177
182
|
function removePool(address pool) external onlyGovernance {
|
|
178
183
|
require(_isPoolActive(pool), "invalid pool");
|
|
@@ -205,6 +210,8 @@ contract PendleVotingControllerUpg is
|
|
|
205
210
|
* @notice set new pendlePerSec
|
|
206
211
|
* @dev no zero checks because gov may want to stop liquidity mining
|
|
207
212
|
* @dev state changes expected: pendlePerSec is updated
|
|
213
|
+
* @dev NOTE TO GOV: This should be done mid-week, well before the next broadcast to avoid
|
|
214
|
+
race condition
|
|
208
215
|
*/
|
|
209
216
|
function setPendlePerSec(uint128 newPendlePerSec) external onlyGovernance {
|
|
210
217
|
pendlePerSec = newPendlePerSec;
|
|
@@ -237,12 +244,12 @@ contract PendleVotingControllerUpg is
|
|
|
237
244
|
|
|
238
245
|
for (uint256 i = 0; i < length; ++i) {
|
|
239
246
|
uint256 poolVotes = weekData[wTime].poolVotes[pools[i]];
|
|
240
|
-
uint256 pendlePerSec = (
|
|
247
|
+
uint256 pendlePerSec = (totalPendlePerSec * poolVotes) / totalVotes;
|
|
241
248
|
totalPendleAmounts[i] = pendlePerSec * WEEK;
|
|
242
249
|
}
|
|
243
250
|
|
|
244
251
|
if (chainId == block.chainid) {
|
|
245
|
-
address gaugeController = sidechainContracts.get(
|
|
252
|
+
address gaugeController = sidechainContracts.get(chainId);
|
|
246
253
|
IPGaugeControllerMainchain(gaugeController).updateVotingResults(
|
|
247
254
|
wTime,
|
|
248
255
|
pools,
|
|
@@ -255,32 +262,19 @@ contract PendleVotingControllerUpg is
|
|
|
255
262
|
emit BroadcastResults(chainId, wTime, totalPendlePerSec);
|
|
256
263
|
}
|
|
257
264
|
|
|
258
|
-
|
|
259
|
-
* @notice return the corresponding voting power of an user given the weight. Basically his voting power
|
|
260
|
-
will be vePendle * weight / USER_VOTE_MAX_WEIGHT
|
|
261
|
-
* @notice governance will always has the vePendle equivalent to 1M PENDLE locked for MAX_LOCK_TIME
|
|
262
|
-
*/
|
|
263
|
-
function _getVotingPowerByWeight(address user, uint64 weight)
|
|
265
|
+
function _getUserVePendlePosition(address user)
|
|
264
266
|
internal
|
|
265
267
|
view
|
|
266
|
-
|
|
267
|
-
override
|
|
268
|
-
returns (VeBalance memory res)
|
|
268
|
+
returns (LockedPosition memory userPosition)
|
|
269
269
|
{
|
|
270
|
-
uint128 amount;
|
|
271
|
-
uint128 expiry;
|
|
272
|
-
|
|
273
270
|
if (user == _governance()) {
|
|
274
|
-
amount =
|
|
275
|
-
|
|
271
|
+
(userPosition.amount, userPosition.expiry) = (
|
|
272
|
+
GOVERNANCE_PENDLE_VOTE,
|
|
273
|
+
WeekMath.getWeekStartTimestamp(uint128(block.timestamp) + MAX_LOCK_TIME)
|
|
274
|
+
);
|
|
276
275
|
} else {
|
|
277
|
-
(amount, expiry) = vePendle.positionData(user);
|
|
276
|
+
(userPosition.amount, userPosition.expiry) = vePendle.positionData(user);
|
|
278
277
|
}
|
|
279
|
-
|
|
280
|
-
(res.bias, res.slope) = VeBalanceLib.convertToVeBalance(
|
|
281
|
-
uint128((uint256(amount) * weight) / USER_VOTE_MAX_WEIGHT),
|
|
282
|
-
expiry
|
|
283
|
-
);
|
|
284
278
|
}
|
|
285
279
|
|
|
286
280
|
function _authorizeUpgrade(address newImplementation) internal override onlyGovernance {}
|
|
@@ -14,6 +14,7 @@ import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
|
14
14
|
/// - it inherits only upgradable contract
|
|
15
15
|
abstract contract VotingControllerStorageUpg {
|
|
16
16
|
using VeBalanceLib for VeBalance;
|
|
17
|
+
using VeBalanceLib for LockedPosition;
|
|
17
18
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
18
19
|
using Checkpoints for Checkpoints.History;
|
|
19
20
|
|
|
@@ -42,7 +43,6 @@ abstract contract VotingControllerStorageUpg {
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
uint128 public constant MAX_LOCK_TIME = 104 weeks;
|
|
45
|
-
uint64 public constant USER_VOTE_MAX_WEIGHT = 10**18;
|
|
46
46
|
uint128 public constant WEEK = 1 weeks;
|
|
47
47
|
uint128 public constant GOVERNANCE_PENDLE_VOTE = 10**24;
|
|
48
48
|
|
|
@@ -181,6 +181,7 @@ abstract contract VotingControllerStorageUpg {
|
|
|
181
181
|
function _modifyVoteWeight(
|
|
182
182
|
address user,
|
|
183
183
|
address pool,
|
|
184
|
+
LockedPosition memory userPosition,
|
|
184
185
|
uint64 weight
|
|
185
186
|
) internal returns (VeBalance memory newVote) {
|
|
186
187
|
UserData storage uData = userData[user];
|
|
@@ -202,14 +203,17 @@ abstract contract VotingControllerStorageUpg {
|
|
|
202
203
|
if (weight != 0) {
|
|
203
204
|
require(_isPoolActive(pool), "pool not active");
|
|
204
205
|
|
|
205
|
-
newVote =
|
|
206
|
+
newVote = userPosition.convertToVeBalance(weight);
|
|
206
207
|
|
|
207
208
|
pData.totalVote = pData.totalVote.add(newVote);
|
|
208
209
|
pData.slopeChanges[newVote.getExpiry()] += newVote.slope;
|
|
209
210
|
|
|
210
211
|
uData.voteForPools[pool] = UserPoolData(weight, newVote);
|
|
211
212
|
uData.totalVotedWeight += weight;
|
|
212
|
-
require(
|
|
213
|
+
require(
|
|
214
|
+
uData.totalVotedWeight <= VeBalanceLib.USER_VOTE_MAX_WEIGHT,
|
|
215
|
+
"exceeded max weight"
|
|
216
|
+
);
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
userPoolHistory[user][pool].push(newVote);
|
|
@@ -217,7 +221,7 @@ abstract contract VotingControllerStorageUpg {
|
|
|
217
221
|
|
|
218
222
|
function _setAllPastEpochsAsFinalized() internal {
|
|
219
223
|
uint128 wTime = WeekMath.getCurrentWeekStart();
|
|
220
|
-
while (wTime
|
|
224
|
+
while (wTime > deployedWTime && weekData[wTime].isEpochFinalized == false) {
|
|
221
225
|
weekData[wTime].isEpochFinalized = true;
|
|
222
226
|
wTime -= WEEK;
|
|
223
227
|
}
|
|
@@ -232,10 +236,4 @@ abstract contract VotingControllerStorageUpg {
|
|
|
232
236
|
function _isVoteActive(VeBalance memory vote) internal view returns (bool) {
|
|
233
237
|
return vote.slope != 0 && !MiniHelpers.isCurrentlyExpired(vote.getExpiry());
|
|
234
238
|
}
|
|
235
|
-
|
|
236
|
-
function _getVotingPowerByWeight(address user, uint64 weight)
|
|
237
|
-
internal
|
|
238
|
-
view
|
|
239
|
-
virtual
|
|
240
|
-
returns (VeBalance memory res);
|
|
241
239
|
}
|