@pendle/core-v2 3.0.0-beta-11 → 3.0.0-beta-12
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/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +5 -23
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol +2 -5
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +6 -20
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +6 -27
- package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +1 -2
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +1 -1
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +16 -17
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol +6 -7
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol +7 -8
- package/contracts/LiquidityMining/PendleMerkleDistributor.sol +2 -11
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol +14 -37
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol +19 -34
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +4 -14
- package/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +4 -16
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +11 -39
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol +3 -10
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol +1 -1
- package/contracts/LiquidityMining/libraries/VeBalanceLib.sol +5 -20
- package/contracts/LiquidityMining/libraries/VeHistoryLib.sol +1 -3
- package/contracts/core/Market/MarketMathCore.sol +12 -37
- package/contracts/core/Market/OracleLib.sol +6 -24
- package/contracts/core/Market/PendleExternalRewardDistributor.sol +4 -10
- package/contracts/core/Market/PendleGauge.sol +3 -9
- package/contracts/core/Market/PendleMarket.sol +14 -39
- package/contracts/core/Market/PendleMarketFactory.sol +14 -21
- package/contracts/core/Market/v2/PendleGaugeV2.sol +8 -24
- package/contracts/core/Market/v2/PendleMarketFactoryV2.sol +7 -27
- package/contracts/core/Market/v2/PendleMarketV2.sol +13 -36
- package/contracts/core/Market/v3/PendleMarketFactoryV3.sol +137 -0
- package/contracts/core/Market/v3/PendleMarketV3.sol +360 -0
- package/contracts/core/RewardManager/PendleLinearDistributor.sol +143 -0
- package/contracts/core/RewardManager/RewardManager.sol +14 -7
- package/contracts/core/RewardManager/RewardManagerAbstract.sol +5 -17
- package/contracts/core/StandardizedYield/SYBase.sol +10 -40
- package/contracts/core/StandardizedYield/SYBaseUpg.sol +197 -0
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +9 -41
- package/contracts/core/StandardizedYield/SYBaseWithRewardsUpg.sol +88 -0
- package/contracts/core/StandardizedYield/SYUtils.sol +1 -4
- package/contracts/core/StandardizedYield/StEthHelper.sol +3 -9
- package/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3SY.sol +94 -0
- package/contracts/core/StandardizedYield/implementations/AaveV3/libraries/AaveAdapterLib.sol +19 -0
- package/contracts/core/StandardizedYield/implementations/AaveV3/libraries/WadRayMath.sol +126 -0
- package/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol +4 -12
- package/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol +5 -19
- package/contracts/core/StandardizedYield/implementations/BalancerStable/AuraEthxBbAWethSY.sol +4 -14
- package/contracts/core/StandardizedYield/implementations/BalancerStable/AuraSwEthBbAWethSYV2.sol +4 -14
- package/contracts/core/StandardizedYield/implementations/BalancerStable/{PendleAuraWethVethSY.sol → AuraWethVethSYUpg.sol} +13 -20
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol +3 -7
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol +12 -29
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol +12 -29
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol +12 -29
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol +14 -39
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol +7 -28
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +13 -30
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewProxy.sol +1 -1
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewV4.sol +50 -153
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewV5.sol +50 -157
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol +4 -16
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearMath.sol +6 -25
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearPreview.sol +36 -34
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +4 -13
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +20 -58
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol +28 -79
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV3Upg.sol +310 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +1 -3
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +2 -6
- package/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol +5 -13
- package/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol +9 -29
- package/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol +2 -8
- package/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol +1 -5
- package/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileLpHelper.sol +8 -19
- package/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatilePreview.sol +7 -25
- package/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol +8 -27
- package/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkReceiver.sol +2 -2
- package/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkRelayer.sol +4 -9
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol +3 -15
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol +5 -23
- package/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol +10 -40
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol +2 -8
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol +2 -7
- package/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol +5 -20
- package/contracts/core/StandardizedYield/implementations/Flux/FluxTokenLib.sol +6 -4
- package/contracts/core/StandardizedYield/implementations/Flux/PendleFluxLendingSY.sol +3 -11
- package/contracts/core/StandardizedYield/implementations/GLP/GLPPreviewHelper.sol +3 -9
- package/contracts/core/StandardizedYield/implementations/GLP/GMTokenPricingHelper.sol +115 -0
- package/contracts/core/StandardizedYield/implementations/GLP/PendleGMV2TokenSY.sol +134 -0
- package/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol +5 -19
- package/contracts/core/StandardizedYield/implementations/HMX/HLPPricingHelper.sol +3 -4
- package/contracts/core/StandardizedYield/implementations/HMX/PendleHlpSY.sol +18 -25
- package/contracts/core/StandardizedYield/implementations/Kyber/KyberMathHelper.sol +425 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/KyberNftManagerBaseUpg.sol +438 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/PendleKyberElasticSYUpg.sol +155 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/FullMath.sol +123 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/LiqDeltaMath.sol +17 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/LiquidityMath.sol +74 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/MathConstants.sol +19 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/QtyDeltaMath.sol +103 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/QuadMath.sol +31 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/ReinvestmentMath.sol +26 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/SafeCast.sol +73 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/SwapMath.sol +272 -0
- package/contracts/core/StandardizedYield/implementations/Kyber/libraries/TickMath.sol +223 -0
- package/contracts/core/StandardizedYield/implementations/MUX/MlpPricingHelper.sol +26 -0
- package/contracts/core/StandardizedYield/implementations/MUX/PendleMlpSY.sol +195 -0
- package/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleMantleStakedEthSY.sol +12 -41
- package/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleOracleForSyProxy.sol +1 -1
- package/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol +13 -42
- package/contracts/core/StandardizedYield/implementations/PendleBridgedLSDSY.sol +4 -11
- package/contracts/core/StandardizedYield/implementations/PendleERC4626SY.sol +4 -16
- package/contracts/core/StandardizedYield/implementations/PendleEUSDSY.sol +3 -11
- package/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol +3 -11
- package/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol +5 -18
- package/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol +3 -7
- package/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol +5 -18
- package/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol +3 -10
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +4 -12
- package/contracts/core/StandardizedYield/implementations/Silo/PendleSiloWithIncentiveSY.sol +157 -0
- package/contracts/core/StandardizedYield/implementations/Stader/PendleETHXSY.sol +4 -12
- package/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol +4 -12
- package/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol +9 -29
- package/contracts/core/StandardizedYield/implementations/Thena/ThenaLpHelper.sol +3 -10
- package/contracts/core/StandardizedYield/implementations/Thena/ThenaMath.sol +9 -30
- package/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol +10 -40
- package/contracts/core/YieldContracts/InterestManagerYT.sol +6 -8
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +1 -1
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +2 -3
- package/contracts/core/YieldContracts/PendleYieldToken.sol +17 -44
- package/contracts/core/YieldContractsV2/InterestManagerYTV2.sol +5 -14
- package/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol +1 -1
- package/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol +2 -3
- package/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol +13 -48
- package/contracts/core/erc20/PendleERC20.sol +2 -8
- package/contracts/core/erc20/PendleERC20Permit.sol +2 -6
- package/contracts/core/erc20/PendleERC20PermitUpg.sol +82 -0
- package/contracts/core/erc20/PendleERC20Upg.sol +334 -0
- package/contracts/core/libraries/ArrayLib.sol +7 -8
- package/contracts/core/libraries/BaseSplitCodeFactory.sol +1 -6
- package/contracts/core/libraries/Errors.sol +19 -1
- package/contracts/core/libraries/ExpiryUtilsLib.sol +3 -26
- package/contracts/core/libraries/StringLib.sol +5 -21
- package/contracts/core/libraries/TokenHelper.sol +3 -3
- package/contracts/core/libraries/math/LogExpMath.sol +1 -4
- package/contracts/core/libraries/math/PMath.sol +13 -15
- package/contracts/interfaces/AaveV3/IAaveV3AToken.sol +15 -0
- package/contracts/interfaces/AaveV3/IAaveV3Pool.sol +11 -0
- package/contracts/interfaces/Balancer/IComposableStable.sol +3 -4
- package/contracts/interfaces/Balancer/IERC4626LinearPool.sol +2 -10
- package/contracts/interfaces/Balancer/IMetaStablePool.sol +3 -11
- package/contracts/interfaces/Balancer/IVault.sol +3 -8
- package/contracts/interfaces/BinanceEth/IWBETH.sol +1 -1
- package/contracts/interfaces/Camelot/ICamelotNFTFactory.sol +1 -3
- package/contracts/interfaces/Camelot/ICamelotNFTHandler.sol +2 -10
- package/contracts/interfaces/Camelot/ICamelotNitroPool.sol +0 -1
- package/contracts/interfaces/Camelot/ICamelotNitroPoolFactory.sol +3 -12
- package/contracts/interfaces/Camelot/ICamelotPair.sol +5 -25
- package/contracts/interfaces/Camelot/ICamelotRouter.sol +1 -5
- package/contracts/interfaces/Camelot/IXGrail.sol +3 -11
- package/contracts/interfaces/ConvexCurve/IBooster.sol +1 -3
- package/contracts/interfaces/Curve/ICrvPool.sol +3 -12
- package/contracts/interfaces/Curve/ITriCrvPool.sol +2 -9
- package/contracts/interfaces/Flux/IFluxErc20.sol +1 -1
- package/contracts/interfaces/Flux/IFluxInterestRateModel.sol +1 -5
- package/contracts/interfaces/GMX/IGMXPriceHelper.sol +6 -0
- package/contracts/interfaces/GMX/IGMXVault.sol +2 -9
- package/contracts/interfaces/GMX/IRewardRouterV2.sol +1 -4
- package/contracts/interfaces/HMX/IHLPStaking.sol +1 -1
- package/contracts/interfaces/HMX/IHMXCalculator.sol +1 -1
- package/contracts/interfaces/HMX/IHMXCompounder.sol +1 -1
- package/contracts/interfaces/HMX/IHMXStaking.sol +1 -1
- package/contracts/interfaces/HMX/IHMXVester.sol +1 -1
- package/contracts/interfaces/IApeStaking.sol +3 -9
- package/contracts/interfaces/IBenQiInterestRateModel.sol +1 -5
- package/contracts/interfaces/IDiamondCut.sol +1 -5
- package/contracts/interfaces/IDiamondLoupe.sol +1 -3
- package/contracts/interfaces/ILayerZeroReceiver.sol +1 -6
- package/contracts/interfaces/IPActionAddRemoveLiqV3.sol +10 -2
- package/contracts/interfaces/IPActionInfoStatic.sol +4 -7
- package/contracts/interfaces/IPActionMarketAuxStatic.sol +5 -9
- package/contracts/interfaces/IPActionMarketCoreStatic.sol +118 -58
- package/contracts/interfaces/IPActionMintRedeemStatic.sol +38 -21
- package/contracts/interfaces/IPActionMiscV3.sol +51 -26
- package/contracts/interfaces/IPActionStorageStatic.sol +5 -1
- package/contracts/interfaces/IPAllActionTypeV3.sol +1 -0
- package/contracts/interfaces/IPBulkSeller.sol +49 -0
- package/contracts/interfaces/IPBulkSellerFactory.sol +12 -0
- package/contracts/interfaces/IPBulkSellerSYCallback.sol +6 -0
- package/contracts/interfaces/IPFeeDistributor.sol +1 -3
- package/contracts/interfaces/IPFeeDistributorV2.sol +8 -7
- package/contracts/interfaces/IPGaugeController.sol +2 -8
- package/contracts/interfaces/IPGaugeControllerMainchain.sol +1 -5
- package/contracts/interfaces/IPInterestManagerYT.sol +3 -3
- package/contracts/interfaces/IPInterestManagerYTV2.sol +1 -4
- package/contracts/interfaces/IPLimitRouter.sol +24 -19
- package/contracts/interfaces/IPLinearDistributor.sol +21 -0
- package/contracts/interfaces/IPMarket.sol +4 -17
- package/contracts/interfaces/IPMarketFactory.sol +2 -13
- package/contracts/interfaces/IPMarketFactoryV3.sol +24 -0
- package/contracts/interfaces/IPMarketV3.sol +8 -0
- package/contracts/interfaces/IPOffchainStorage.sol +11 -0
- package/contracts/interfaces/IPPriceFeed.sol +6 -0
- package/contracts/interfaces/IPPtOracle.sol +2 -9
- package/contracts/interfaces/IPRouterHelper.sol +11 -7
- package/contracts/interfaces/IPRouterStatic.sol +1 -3
- package/contracts/interfaces/IPVotingController.sol +7 -19
- package/contracts/interfaces/IPVotingEscrowMainchain.sol +2 -8
- package/contracts/interfaces/IPYieldToken.sol +2 -8
- package/contracts/interfaces/IPYieldTokenV2.sol +1 -6
- package/contracts/interfaces/IPendlePreviewHelper.sol +2 -8
- package/contracts/interfaces/IRewardManager.sol +1 -4
- package/contracts/interfaces/IStETH.sol +1 -4
- package/contracts/interfaces/IStandardizedYield.sol +9 -16
- package/contracts/interfaces/IStargateLP.sol +0 -3
- package/contracts/interfaces/IStargateRouter.sol +1 -5
- package/contracts/interfaces/Kyber/IKyberElasticFactory.sol +157 -0
- package/contracts/interfaces/Kyber/IKyberElasticPool.sol +101 -0
- package/contracts/interfaces/Kyber/IKyberElasticRouter.sol +98 -0
- package/contracts/interfaces/Kyber/IKyberLiquidityMining.sol +209 -0
- package/contracts/interfaces/Kyber/IKyberMathHelper.sol +28 -0
- package/contracts/interfaces/Kyber/IKyberPositionManager.sol +179 -0
- package/contracts/interfaces/Lybra/IEUSD.sol +1 -1
- package/contracts/interfaces/MUX/IMUXRewardRouter.sol +139 -0
- package/contracts/interfaces/Silo/ISilo.sol +298 -0
- package/contracts/interfaces/Silo/ISiloIncentiveController.sol +16 -0
- package/contracts/interfaces/Silo/ISiloLens.sol +6 -0
- package/contracts/interfaces/Stader/IStaderStakeManager.sol +2 -2
- package/contracts/interfaces/Thena/IThenaFactory.sol +1 -5
- package/contracts/interfaces/Thena/IThenaGaugeV2.sol +1 -2
- package/contracts/interfaces/Thena/IThenaPair.sol +3 -5
- package/contracts/limit/LimitMathCore.sol +69 -60
- package/contracts/limit/{PendleOrderMixin.sol → LimitRouterBase.sol} +96 -79
- package/contracts/limit/PendleLimitRouter.sol +9 -13
- package/contracts/offchain-helpers/AutomateReady.sol +17 -32
- package/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol +6 -3
- package/contracts/offchain-helpers/BoringLpSeller.sol +4 -17
- package/contracts/offchain-helpers/BoringPtSeller.sol +2 -7
- package/contracts/offchain-helpers/Broadcaster.sol +1 -1
- package/contracts/offchain-helpers/BytesLib.sol +26 -14
- package/contracts/offchain-helpers/EmptyUUPS.sol +0 -1
- package/contracts/offchain-helpers/LegacyNFTHelper.sol +4 -23
- package/contracts/offchain-helpers/LimitBackendHelper.sol +25 -16
- package/contracts/offchain-helpers/MarketExchangeRateLib.sol +2 -13
- package/contracts/offchain-helpers/Multicall2.sol +2 -7
- package/contracts/offchain-helpers/PendleMulticallV1.sol +7 -7
- package/contracts/offchain-helpers/PendleMulticallV2.sol +12 -13
- package/contracts/offchain-helpers/PendleOffchainStorage.sol +59 -0
- package/contracts/offchain-helpers/SimulateHelper.sol +6 -7
- package/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol +15 -1
- package/contracts/oracles/PendleLpOracleLib.sol +9 -10
- package/contracts/oracles/PendlePtOracle.sol +8 -19
- package/contracts/oracles/PendlePtOracleLib.sol +8 -13
- package/contracts/oracles/samples/PendleLpGlpOracle.sol +6 -10
- package/contracts/oracles/samples/PendlePtGlpOracle.sol +6 -10
- package/contracts/oracles/samples/PendlePtUsdChainlinkOracle.sol +8 -15
- package/contracts/router/ActionAddRemoveLiqV3.sol +147 -52
- package/contracts/router/ActionCallbackV3.sol +11 -4
- package/contracts/router/ActionMiscV3.sol +43 -33
- package/contracts/router/ActionSwapPTV3.sol +18 -6
- package/contracts/router/ActionSwapYTV3.sol +42 -14
- package/contracts/router/PendleRouterHelper.sol +72 -40
- package/contracts/router/PendleRouterV3.sol +50 -50
- package/contracts/router/base/ActionBase.sol +86 -43
- package/contracts/router/base/CallbackHelper.sol +18 -20
- package/contracts/router/base/MarketApproxLib.sol +36 -32
- package/contracts/router/swap-aggregator/PendleSwap.sol +31 -7
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutorOptimistic.sol +63 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelper.sol +314 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperL2.sol +560 -0
- package/contracts/router/swap-aggregator/kyberswap/{IMetaAggregationRouterV2.sol → interfaces/IMetaAggregationRouterV2.sol} +11 -6
- package/contracts/router/swap-aggregator/kyberswap/{KyberInputScalingHelper.sol → l1-contracts/InputScalingHelper.sol} +70 -19
- package/contracts/router/swap-aggregator/kyberswap/{ScalingDataLib.sol → l1-contracts/ScalingDataLib.sol} +111 -53
- package/contracts/router/swap-aggregator/kyberswap/l2-contracts/BytesHelper.sol +29 -0
- package/contracts/router/swap-aggregator/kyberswap/l2-contracts/CalldataReader.sol +149 -0
- package/contracts/router/swap-aggregator/kyberswap/l2-contracts/CalldataWriter.sol +118 -0
- package/contracts/router/swap-aggregator/kyberswap/l2-contracts/Common.sol +42 -0
- package/contracts/router/swap-aggregator/kyberswap/l2-contracts/DexScaler.sol +382 -0
- package/contracts/router/swap-aggregator/kyberswap/l2-contracts/ExecutorReader.sol +61 -0
- package/contracts/router/swap-aggregator/kyberswap/l2-contracts/InputScalingHelperL2.sol +329 -0
- package/contracts/router/swap-aggregator/kyberswap/l2-contracts/ScalingDataL2Lib.sol +173 -0
- package/contracts/router/swap-aggregator/oneinch/I1inchAggregationRouterV5.sol +4 -10
- package/contracts/router/swap-aggregator/oneinch/OneInchAggregationRouterHelper.sol +20 -14
- package/deployments/1-core.json +5 -2
- package/deployments/1-markets/EPENDLE-SEP2024.json +12 -0
- package/deployments/1-markets/SFRAX-MARCH2024.json +10 -0
- package/deployments/1-markets/SILO-CRVUSD-MARCH2024.json +10 -0
- package/deployments/10-core.json +6 -3
- package/deployments/42161-core.json +5 -2
- package/deployments/42161-markets/AAVE-USDC-JUNE2024.json +11 -0
- package/deployments/42161-markets/ARBSILO-USDC-FEB2024.json +10 -0
- package/deployments/42161-markets/GM-ARB-USDC-MARCH2024.json +10 -0
- package/deployments/42161-markets/KYBER-AXLWSTETH-WSTETH-MARCH2024.json +10 -0
- package/deployments/42161-markets/MLP-MARCH2024.json +10 -0
- package/deployments/42161-markets/WSTETH-ARBITRUM-MARCH2024.json +11 -0
- package/deployments/42161-markets/WSTETHSILO-ETH-MARCH2024.json +11 -0
- package/deployments/56-core.json +5 -2
- package/deployments/merkle-distribution/2023-10-26.json +7300 -0
- package/deployments/merkle-distribution/2023-11-30.json +7730 -0
- package/package.json +8 -8
- package/contracts/limit/helpers/ArgumentsDecoder.sol +0 -47
- package/contracts/limit/helpers/Permitable.sol +0 -48
- package/contracts/limit/helpers/RevertReasonParser.sol +0 -75
- package/contracts/offchain-helpers/ChainlinkRelayerGelato.sol +0 -37
- package/contracts/offchain-helpers/PtAndLpToAsset.sol +0 -62
- package/contracts/offchain-helpers/router-static/PendleRouterStatic.sol +0 -19
- package/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol +0 -112
- package/contracts/offchain-helpers/router-static/base/ActionLimitOrdersStatic.sol +0 -145
- package/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol +0 -171
- package/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol +0 -582
- package/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol +0 -116
- package/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol +0 -64
- package/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol +0 -53
- package/contracts/offchain-helpers/router-static/base/StorageLayout.sol +0 -18
- package/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol +0 -231
- package/deployments/1-markets/BALANCER-LP-AURA-VETH-WETH-SEP2024.json +0 -8
- /package/contracts/router/swap-aggregator/kyberswap/{IAggregationExecutor.sol → interfaces/IAggregationExecutor.sol} +0 -0
- /package/deployments/1-markets/{BALANCER-LP-AURA-BBAWETHSWETH-SEP-26-2024.json → deprecated/BALANCER-LP-AURA-BBAWETHSWETH-SEP-26-2024.json} +0 -0
- /package/deployments/1-markets/{BALANCER-LP-AURA-ETHX-BBAWETH-SEP-26-2024.json → deprecated/BALANCER-LP-AURA-ETHX-BBAWETH-SEP-26-2024.json} +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../SYBaseWithRewards.sol";
|
|
5
|
+
import "../../../../interfaces/MUX/IMUXRewardRouter.sol";
|
|
6
|
+
import "../../../../interfaces/IPPriceFeed.sol";
|
|
7
|
+
import "../../../libraries/ArrayLib.sol";
|
|
8
|
+
|
|
9
|
+
contract PendleMlpSY is SYBaseWithRewards {
|
|
10
|
+
using PMath for uint256;
|
|
11
|
+
|
|
12
|
+
uint256 constant VEMUX_MAXTIME = 4 * 365 * 86400; // 4 years
|
|
13
|
+
|
|
14
|
+
address public immutable mlp;
|
|
15
|
+
address public immutable sMlp;
|
|
16
|
+
address public immutable mux;
|
|
17
|
+
address public immutable weth;
|
|
18
|
+
address public immutable arb;
|
|
19
|
+
address public immutable rewardRouter;
|
|
20
|
+
|
|
21
|
+
// reward status
|
|
22
|
+
bool public hasVeMuxPosition;
|
|
23
|
+
bool public isRewardSettled;
|
|
24
|
+
|
|
25
|
+
// non-security related
|
|
26
|
+
address public immutable mlpPriceFeed;
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
address _rewardRouter,
|
|
30
|
+
address _mlpPriceFeed,
|
|
31
|
+
address _arb
|
|
32
|
+
) SYBaseWithRewards("SY MUXLP", "SY-MUXLP", IMUXRewardRouter(_rewardRouter).mlp()) {
|
|
33
|
+
rewardRouter = _rewardRouter;
|
|
34
|
+
weth = IMUXRewardRouter(_rewardRouter).weth();
|
|
35
|
+
mlp = IMUXRewardRouter(_rewardRouter).mlp();
|
|
36
|
+
sMlp = IMUXRewardRouter(_rewardRouter).mlpMuxTracker();
|
|
37
|
+
mux = IMUXRewardRouter(_rewardRouter).mux();
|
|
38
|
+
arb = _arb;
|
|
39
|
+
|
|
40
|
+
mlpPriceFeed = _mlpPriceFeed;
|
|
41
|
+
|
|
42
|
+
// Dont have to approve for mlpMuxTracker as the contract allows whitelisted handlers
|
|
43
|
+
// to transfer from anyone (MUX's reward router in this case)
|
|
44
|
+
_safeApproveInf(mlp, IMUXRewardRouter(_rewardRouter).mlpFeeTracker());
|
|
45
|
+
_safeApproveInf(mux, IMUXRewardRouter(_rewardRouter).votingEscrow());
|
|
46
|
+
_safeApproveInf(mux, IMUXRewardRouter(_rewardRouter).muxVester());
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/*///////////////////////////////////////////////////////////////
|
|
50
|
+
DEPOSIT/REDEEM USING BASE TOKENS
|
|
51
|
+
//////////////////////////////////////////////////////////////*/
|
|
52
|
+
|
|
53
|
+
function _deposit(
|
|
54
|
+
address tokenIn,
|
|
55
|
+
uint256 amountDeposited
|
|
56
|
+
) internal virtual override returns (uint256 /*amountSharesOut*/) {
|
|
57
|
+
if (tokenIn == mlp) {
|
|
58
|
+
IMUXRewardRouter(rewardRouter).stakeMlp(amountDeposited);
|
|
59
|
+
}
|
|
60
|
+
return amountDeposited;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function _redeem(
|
|
64
|
+
address receiver,
|
|
65
|
+
address tokenOut,
|
|
66
|
+
uint256 amountSharesToRedeem
|
|
67
|
+
) internal virtual override returns (uint256 /*amountTokenOut*/) {
|
|
68
|
+
if (tokenOut == mlp) {
|
|
69
|
+
IMUXRewardRouter(rewardRouter).unstakeMlp(amountSharesToRedeem);
|
|
70
|
+
}
|
|
71
|
+
_transferOut(tokenOut, receiver, amountSharesToRedeem);
|
|
72
|
+
return amountSharesToRedeem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/*///////////////////////////////////////////////////////////////
|
|
76
|
+
EXCHANGE-RATE
|
|
77
|
+
//////////////////////////////////////////////////////////////*/
|
|
78
|
+
|
|
79
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
80
|
+
return PMath.ONE;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/*///////////////////////////////////////////////////////////////
|
|
84
|
+
REWARDS-RELATED
|
|
85
|
+
//////////////////////////////////////////////////////////////*/
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @dev See {IStandardizedYield-getRewardTokens}
|
|
89
|
+
*/
|
|
90
|
+
function _getRewardTokens() internal view override returns (address[] memory) {
|
|
91
|
+
return ArrayLib.create(weth, arb);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _redeemExternalReward() internal override {
|
|
95
|
+
// IMUXRewardRouter(rewardRouter).compound() would revert in the case mux to be compounded = 0 (2 txns in the same block)
|
|
96
|
+
// So we should not use that method
|
|
97
|
+
IMUXRewardRouter(rewardRouter).claimAll();
|
|
98
|
+
|
|
99
|
+
bool _hasVeMuxPosition = hasVeMuxPosition;
|
|
100
|
+
bool _isRewardSettled = isRewardSettled;
|
|
101
|
+
|
|
102
|
+
if (_isRewardSettled) return;
|
|
103
|
+
|
|
104
|
+
uint256 muxBalance = _selfBalance(mux);
|
|
105
|
+
if (muxBalance > 0) {
|
|
106
|
+
IMUXRewardRouter(rewardRouter).stakeMux(muxBalance, block.timestamp + VEMUX_MAXTIME);
|
|
107
|
+
if (!_hasVeMuxPosition) {
|
|
108
|
+
hasVeMuxPosition = true;
|
|
109
|
+
}
|
|
110
|
+
} else if (_hasVeMuxPosition) {
|
|
111
|
+
IMUXRewardRouter(rewardRouter).increaseStakeUnlockTime(block.timestamp + VEMUX_MAXTIME);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/*///////////////////////////////////////////////////////////////
|
|
116
|
+
MISC FUNCTIONS FOR METADATA
|
|
117
|
+
//////////////////////////////////////////////////////////////*/
|
|
118
|
+
|
|
119
|
+
function _previewDeposit(
|
|
120
|
+
address,
|
|
121
|
+
uint256 amountTokenToDeposit
|
|
122
|
+
) internal view override returns (uint256 /*amountSharesOut*/) {
|
|
123
|
+
return amountTokenToDeposit;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function _previewRedeem(
|
|
127
|
+
address,
|
|
128
|
+
uint256 amountSharesToRedeem
|
|
129
|
+
) internal view override returns (uint256 /*amountTokenOut*/) {
|
|
130
|
+
return amountSharesToRedeem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getTokensIn() public view virtual override returns (address[] memory) {
|
|
134
|
+
return ArrayLib.create(mlp, sMlp);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function getTokensOut() public view virtual override returns (address[] memory) {
|
|
138
|
+
return ArrayLib.create(mlp, sMlp);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
142
|
+
return token == mlp || token == sMlp;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
146
|
+
return token == mlp || token == sMlp;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
150
|
+
return (AssetType.LIQUIDITY, mlp, IERC20Metadata(mlp).decimals());
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/*///////////////////////////////////////////////////////////////
|
|
154
|
+
GOVERNANCE WITHDRAWAL
|
|
155
|
+
//////////////////////////////////////////////////////////////*/
|
|
156
|
+
|
|
157
|
+
function setRewardStatus(bool _isRewardSettled) external onlyOwner {
|
|
158
|
+
isRewardSettled = _isRewardSettled;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @dev this function assumes revert if the lock hasnt expired
|
|
163
|
+
* @dev There are two methods for vesting MUX (one through veMUX culmulative reward and one through paired staked MLP)
|
|
164
|
+
*
|
|
165
|
+
* Will not go with the later one as this contract should not utilize users' sMLP for other purposes
|
|
166
|
+
*/
|
|
167
|
+
function withdrawAndVestMux() external onlyOwner {
|
|
168
|
+
IMUXRewardRouter(rewardRouter).unstakeMcbAndMux();
|
|
169
|
+
|
|
170
|
+
uint256 amountToVest = PMath.min(
|
|
171
|
+
_selfBalance(mux),
|
|
172
|
+
IMUXRewardRouter(rewardRouter).maxVestableTokenFromVe(address(this))
|
|
173
|
+
);
|
|
174
|
+
IMUXRewardRouter(rewardRouter).depositToVeVester(amountToVest);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function claimVestedRewards(address receiver) external onlyOwner returns (uint256 amountClaimed) {
|
|
178
|
+
IMUXRewardRouter(rewardRouter).claimVestedTokenFromVe(address(this));
|
|
179
|
+
|
|
180
|
+
address mcb = IMUXRewardRouter(rewardRouter).mcb();
|
|
181
|
+
amountClaimed = _selfBalance(mcb);
|
|
182
|
+
if (amountClaimed != 0) {
|
|
183
|
+
_transferOut(mcb, receiver, amountClaimed);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/*///////////////////////////////////////////////////////////////
|
|
188
|
+
OFF-CHAIN USAGE ONLY
|
|
189
|
+
(NO SECURITY RELATED && CAN BE LEFT UNAUDITED)
|
|
190
|
+
//////////////////////////////////////////////////////////////*/
|
|
191
|
+
|
|
192
|
+
function getPrice() external view returns (uint256) {
|
|
193
|
+
return IPPriceFeed(mlpPriceFeed).getPrice();
|
|
194
|
+
}
|
|
195
|
+
}
|
package/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleMantleStakedEthSY.sol
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../../SYBase.sol";
|
|
5
5
|
import "../../../../interfaces/IPOracleForSy.sol";
|
|
@@ -28,14 +28,7 @@ contract PendleMantleStakedEthSY is SYBase {
|
|
|
28
28
|
DEPOSIT/REDEEM USING BASE TOKENS
|
|
29
29
|
//////////////////////////////////////////////////////////////*/
|
|
30
30
|
|
|
31
|
-
function _deposit(address, uint256 amountDeposited)
|
|
32
|
-
internal
|
|
33
|
-
pure
|
|
34
|
-
override
|
|
35
|
-
returns (
|
|
36
|
-
uint256 /*amountSharesOut*/
|
|
37
|
-
)
|
|
38
|
-
{
|
|
31
|
+
function _deposit(address, uint256 amountDeposited) internal pure override returns (uint256 /*amountSharesOut*/) {
|
|
39
32
|
return amountDeposited;
|
|
40
33
|
}
|
|
41
34
|
|
|
@@ -43,13 +36,7 @@ contract PendleMantleStakedEthSY is SYBase {
|
|
|
43
36
|
address receiver,
|
|
44
37
|
address tokenOut,
|
|
45
38
|
uint256 amountSharesToRedeem
|
|
46
|
-
)
|
|
47
|
-
internal
|
|
48
|
-
override
|
|
49
|
-
returns (
|
|
50
|
-
uint256 /*amountTokenOut*/
|
|
51
|
-
)
|
|
52
|
-
{
|
|
39
|
+
) internal override returns (uint256 /*amountTokenOut*/) {
|
|
53
40
|
_transferOut(tokenOut, receiver, amountSharesToRedeem);
|
|
54
41
|
return amountSharesToRedeem;
|
|
55
42
|
}
|
|
@@ -66,25 +53,17 @@ contract PendleMantleStakedEthSY is SYBase {
|
|
|
66
53
|
MISC FUNCTIONS FOR METADATA
|
|
67
54
|
//////////////////////////////////////////////////////////////*/
|
|
68
55
|
|
|
69
|
-
function _previewDeposit(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
returns (
|
|
74
|
-
uint256 /*amountSharesOut*/
|
|
75
|
-
)
|
|
76
|
-
{
|
|
56
|
+
function _previewDeposit(
|
|
57
|
+
address,
|
|
58
|
+
uint256 amountTokenToDeposit
|
|
59
|
+
) internal pure override returns (uint256 /*amountSharesOut*/) {
|
|
77
60
|
return amountTokenToDeposit;
|
|
78
61
|
}
|
|
79
62
|
|
|
80
|
-
function _previewRedeem(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
returns (
|
|
85
|
-
uint256 /*amountTokenOut*/
|
|
86
|
-
)
|
|
87
|
-
{
|
|
63
|
+
function _previewRedeem(
|
|
64
|
+
address,
|
|
65
|
+
uint256 amountSharesToRedeem
|
|
66
|
+
) internal pure override returns (uint256 /*amountTokenOut*/) {
|
|
88
67
|
return amountSharesToRedeem;
|
|
89
68
|
}
|
|
90
69
|
|
|
@@ -106,15 +85,7 @@ contract PendleMantleStakedEthSY is SYBase {
|
|
|
106
85
|
return token == yieldToken;
|
|
107
86
|
}
|
|
108
87
|
|
|
109
|
-
function assetInfo()
|
|
110
|
-
external
|
|
111
|
-
view
|
|
112
|
-
returns (
|
|
113
|
-
AssetType assetType,
|
|
114
|
-
address assetAddress,
|
|
115
|
-
uint8 assetDecimals
|
|
116
|
-
)
|
|
117
|
-
{
|
|
88
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
118
89
|
return (AssetType.TOKEN, underlyingAssetOnEthAddr, underlyingAssetOnEthDecimals);
|
|
119
90
|
}
|
|
120
91
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../SYBase.sol";
|
|
5
|
-
import {
|
|
5
|
+
import {AggregatorV2V3Interface as IChainlinkAggregator} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
|
|
6
6
|
|
|
7
7
|
contract PendleArbitrumStakedEthSY is SYBase {
|
|
8
8
|
using PMath for int256;
|
|
@@ -28,14 +28,7 @@ contract PendleArbitrumStakedEthSY is SYBase {
|
|
|
28
28
|
DEPOSIT/REDEEM USING BASE TOKENS
|
|
29
29
|
//////////////////////////////////////////////////////////////*/
|
|
30
30
|
|
|
31
|
-
function _deposit(address, uint256 amountDeposited)
|
|
32
|
-
internal
|
|
33
|
-
pure
|
|
34
|
-
override
|
|
35
|
-
returns (
|
|
36
|
-
uint256 /*amountSharesOut*/
|
|
37
|
-
)
|
|
38
|
-
{
|
|
31
|
+
function _deposit(address, uint256 amountDeposited) internal pure override returns (uint256 /*amountSharesOut*/) {
|
|
39
32
|
return amountDeposited;
|
|
40
33
|
}
|
|
41
34
|
|
|
@@ -43,13 +36,7 @@ contract PendleArbitrumStakedEthSY is SYBase {
|
|
|
43
36
|
address receiver,
|
|
44
37
|
address tokenOut,
|
|
45
38
|
uint256 amountSharesToRedeem
|
|
46
|
-
)
|
|
47
|
-
internal
|
|
48
|
-
override
|
|
49
|
-
returns (
|
|
50
|
-
uint256 /*amountTokenOut*/
|
|
51
|
-
)
|
|
52
|
-
{
|
|
39
|
+
) internal override returns (uint256 /*amountTokenOut*/) {
|
|
53
40
|
_transferOut(tokenOut, receiver, amountSharesToRedeem);
|
|
54
41
|
return amountSharesToRedeem;
|
|
55
42
|
}
|
|
@@ -66,25 +53,17 @@ contract PendleArbitrumStakedEthSY is SYBase {
|
|
|
66
53
|
MISC FUNCTIONS FOR METADATA
|
|
67
54
|
//////////////////////////////////////////////////////////////*/
|
|
68
55
|
|
|
69
|
-
function _previewDeposit(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
returns (
|
|
74
|
-
uint256 /*amountSharesOut*/
|
|
75
|
-
)
|
|
76
|
-
{
|
|
56
|
+
function _previewDeposit(
|
|
57
|
+
address,
|
|
58
|
+
uint256 amountTokenToDeposit
|
|
59
|
+
) internal pure override returns (uint256 /*amountSharesOut*/) {
|
|
77
60
|
return amountTokenToDeposit;
|
|
78
61
|
}
|
|
79
62
|
|
|
80
|
-
function _previewRedeem(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
returns (
|
|
85
|
-
uint256 /*amountTokenOut*/
|
|
86
|
-
)
|
|
87
|
-
{
|
|
63
|
+
function _previewRedeem(
|
|
64
|
+
address,
|
|
65
|
+
uint256 amountSharesToRedeem
|
|
66
|
+
) internal pure override returns (uint256 /*amountTokenOut*/) {
|
|
88
67
|
return amountSharesToRedeem;
|
|
89
68
|
}
|
|
90
69
|
|
|
@@ -106,15 +85,7 @@ contract PendleArbitrumStakedEthSY is SYBase {
|
|
|
106
85
|
return token == yieldToken;
|
|
107
86
|
}
|
|
108
87
|
|
|
109
|
-
function assetInfo()
|
|
110
|
-
external
|
|
111
|
-
view
|
|
112
|
-
returns (
|
|
113
|
-
AssetType assetType,
|
|
114
|
-
address assetAddress,
|
|
115
|
-
uint8 assetDecimals
|
|
116
|
-
)
|
|
117
|
-
{
|
|
88
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
118
89
|
return (AssetType.TOKEN, underlyingAssetOnEthAddr, underlyingAssetOnEthDecimals);
|
|
119
90
|
}
|
|
120
91
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../SYBase.sol";
|
|
5
|
-
import {
|
|
5
|
+
import {AggregatorV2V3Interface as IChainlinkAggregator} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
|
|
6
6
|
|
|
7
7
|
contract PendleBridgedLSDSY is SYBase {
|
|
8
8
|
using PMath for int256;
|
|
@@ -28,10 +28,7 @@ contract PendleBridgedLSDSY is SYBase {
|
|
|
28
28
|
DEPOSIT/REDEEM USING BASE TOKENS
|
|
29
29
|
//////////////////////////////////////////////////////////////*/
|
|
30
30
|
|
|
31
|
-
function _deposit(
|
|
32
|
-
address,
|
|
33
|
-
uint256 amountDeposited
|
|
34
|
-
) internal pure override returns (uint256 /*amountSharesOut*/) {
|
|
31
|
+
function _deposit(address, uint256 amountDeposited) internal pure override returns (uint256 /*amountSharesOut*/) {
|
|
35
32
|
return amountDeposited;
|
|
36
33
|
}
|
|
37
34
|
|
|
@@ -89,11 +86,7 @@ contract PendleBridgedLSDSY is SYBase {
|
|
|
89
86
|
return token == yieldToken;
|
|
90
87
|
}
|
|
91
88
|
|
|
92
|
-
function assetInfo()
|
|
93
|
-
external
|
|
94
|
-
view
|
|
95
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
96
|
-
{
|
|
89
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
97
90
|
return (AssetType.TOKEN, underlyingAssetOnEthAddr, underlyingAssetOnEthDecimals);
|
|
98
91
|
}
|
|
99
92
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../SYBase.sol";
|
|
5
5
|
import "../../../interfaces/IERC4626.sol";
|
|
@@ -8,11 +8,7 @@ contract PendleERC4626SY is SYBase {
|
|
|
8
8
|
using PMath for uint256;
|
|
9
9
|
address public immutable asset;
|
|
10
10
|
|
|
11
|
-
constructor(
|
|
12
|
-
string memory _name,
|
|
13
|
-
string memory _symbol,
|
|
14
|
-
address _erc4626
|
|
15
|
-
) SYBase(_name, _symbol, _erc4626) {
|
|
11
|
+
constructor(string memory _name, string memory _symbol, address _erc4626) SYBase(_name, _symbol, _erc4626) {
|
|
16
12
|
asset = IERC4626(_erc4626).asset();
|
|
17
13
|
_safeApproveInf(asset, _erc4626);
|
|
18
14
|
}
|
|
@@ -37,11 +33,7 @@ contract PendleERC4626SY is SYBase {
|
|
|
37
33
|
amountTokenOut = amountSharesToRedeem;
|
|
38
34
|
_transferOut(yieldToken, receiver, amountTokenOut);
|
|
39
35
|
} else {
|
|
40
|
-
amountTokenOut = IERC4626(yieldToken).redeem(
|
|
41
|
-
amountSharesToRedeem,
|
|
42
|
-
receiver,
|
|
43
|
-
address(this)
|
|
44
|
-
);
|
|
36
|
+
amountTokenOut = IERC4626(yieldToken).redeem(amountSharesToRedeem, receiver, address(this));
|
|
45
37
|
}
|
|
46
38
|
}
|
|
47
39
|
|
|
@@ -87,11 +79,7 @@ contract PendleERC4626SY is SYBase {
|
|
|
87
79
|
return token == yieldToken || token == asset;
|
|
88
80
|
}
|
|
89
81
|
|
|
90
|
-
function assetInfo()
|
|
91
|
-
external
|
|
92
|
-
view
|
|
93
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
94
|
-
{
|
|
82
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
95
83
|
return (AssetType.TOKEN, asset, IERC20Metadata(asset).decimals());
|
|
96
84
|
}
|
|
97
85
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../SYBase.sol";
|
|
5
5
|
import "../../../interfaces/Lybra/IEUSD.sol";
|
|
@@ -7,11 +7,7 @@ import "../../../interfaces/Lybra/IEUSD.sol";
|
|
|
7
7
|
contract PendleEUSDSY is SYBase {
|
|
8
8
|
address public immutable eUSD;
|
|
9
9
|
|
|
10
|
-
constructor(
|
|
11
|
-
string memory _name,
|
|
12
|
-
string memory _symbol,
|
|
13
|
-
address _eUSD
|
|
14
|
-
) SYBase(_name, _symbol, _eUSD) {
|
|
10
|
+
constructor(string memory _name, string memory _symbol, address _eUSD) SYBase(_name, _symbol, _eUSD) {
|
|
15
11
|
eUSD = _eUSD;
|
|
16
12
|
}
|
|
17
13
|
|
|
@@ -78,11 +74,7 @@ contract PendleEUSDSY is SYBase {
|
|
|
78
74
|
return token == eUSD;
|
|
79
75
|
}
|
|
80
76
|
|
|
81
|
-
function assetInfo()
|
|
82
|
-
external
|
|
83
|
-
view
|
|
84
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
85
|
-
{
|
|
77
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
86
78
|
assetType = AssetType.TOKEN;
|
|
87
79
|
assetAddress = eUSD;
|
|
88
80
|
assetDecimals = 18;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../SYBase.sol";
|
|
5
5
|
import "../../../interfaces/IERC4626.sol";
|
|
@@ -8,11 +8,7 @@ contract PendleGDaiSY is SYBase {
|
|
|
8
8
|
address public immutable DAI;
|
|
9
9
|
address public immutable gDAI;
|
|
10
10
|
|
|
11
|
-
constructor(
|
|
12
|
-
string memory _name,
|
|
13
|
-
string memory _symbol,
|
|
14
|
-
address _gDAI
|
|
15
|
-
) SYBase(_name, _symbol, _gDAI) {
|
|
11
|
+
constructor(string memory _name, string memory _symbol, address _gDAI) SYBase(_name, _symbol, _gDAI) {
|
|
16
12
|
gDAI = _gDAI;
|
|
17
13
|
DAI = IERC4626(gDAI).asset();
|
|
18
14
|
_safeApproveInf(DAI, gDAI);
|
|
@@ -102,11 +98,7 @@ contract PendleGDaiSY is SYBase {
|
|
|
102
98
|
return token == gDAI;
|
|
103
99
|
}
|
|
104
100
|
|
|
105
|
-
function assetInfo()
|
|
106
|
-
external
|
|
107
|
-
view
|
|
108
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
109
|
-
{
|
|
101
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
110
102
|
return (AssetType.TOKEN, DAI, 18);
|
|
111
103
|
}
|
|
112
104
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../SYBase.sol";
|
|
5
5
|
import "../../../interfaces/ILooksFeeSharing.sol";
|
|
@@ -30,10 +30,7 @@ contract PendleLooksStakingSY is SYBase {
|
|
|
30
30
|
DEPOSIT/REDEEM USING BASE TOKENS
|
|
31
31
|
//////////////////////////////////////////////////////////////*/
|
|
32
32
|
|
|
33
|
-
function _deposit(
|
|
34
|
-
address,
|
|
35
|
-
uint256 amountDeposited
|
|
36
|
-
) internal virtual override returns (uint256 amountSharesOut) {
|
|
33
|
+
function _deposit(address, uint256 amountDeposited) internal virtual override returns (uint256 amountSharesOut) {
|
|
37
34
|
uint256 previousShare = ILooksStaking(stakingContract).userInfo(address(this));
|
|
38
35
|
ILooksStaking(stakingContract).deposit(amountDeposited);
|
|
39
36
|
amountSharesOut = ILooksStaking(stakingContract).userInfo(address(this)) - previousShare;
|
|
@@ -79,15 +76,9 @@ contract PendleLooksStakingSY is SYBase {
|
|
|
79
76
|
amountTokenOut = (amountSharesToRedeem * totalLooks) / totalShares;
|
|
80
77
|
}
|
|
81
78
|
|
|
82
|
-
function _getLooksStakingParams()
|
|
83
|
-
private
|
|
84
|
-
view
|
|
85
|
-
returns (uint256 totalShares, uint256 totalLooks)
|
|
86
|
-
{
|
|
79
|
+
function _getLooksStakingParams() private view returns (uint256 totalShares, uint256 totalLooks) {
|
|
87
80
|
totalShares = ILooksStaking(stakingContract).totalShares();
|
|
88
|
-
totalLooks = ILooksFeeSharing(feeSharingContract).calculateSharesValueInLOOKS(
|
|
89
|
-
stakingContract
|
|
90
|
-
);
|
|
81
|
+
totalLooks = ILooksFeeSharing(feeSharingContract).calculateSharesValueInLOOKS(stakingContract);
|
|
91
82
|
}
|
|
92
83
|
|
|
93
84
|
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
@@ -108,11 +99,7 @@ contract PendleLooksStakingSY is SYBase {
|
|
|
108
99
|
return token == looks;
|
|
109
100
|
}
|
|
110
101
|
|
|
111
|
-
function assetInfo()
|
|
112
|
-
external
|
|
113
|
-
view
|
|
114
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
115
|
-
{
|
|
102
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
116
103
|
return (AssetType.TOKEN, looks, IERC20Metadata(looks).decimals());
|
|
117
104
|
}
|
|
118
105
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../SYBase.sol";
|
|
5
5
|
import "../../../interfaces/Frax/IFrxEthMinter.sol";
|
|
@@ -38,7 +38,7 @@ contract PendleSfrxEthSY is SYBase {
|
|
|
38
38
|
uint256 amountDeposited
|
|
39
39
|
) internal virtual override returns (uint256 /*amountSharesOut*/) {
|
|
40
40
|
if (tokenIn == NATIVE) {
|
|
41
|
-
return IFrxEthMinter(minter).submitAndDeposit{
|
|
41
|
+
return IFrxEthMinter(minter).submitAndDeposit{value: amountDeposited}(address(this));
|
|
42
42
|
} else if (tokenIn == frxETH) {
|
|
43
43
|
return IERC4626(sfrxETH).deposit(amountDeposited, address(this));
|
|
44
44
|
} else {
|
|
@@ -122,11 +122,7 @@ contract PendleSfrxEthSY is SYBase {
|
|
|
122
122
|
return token == frxETH || token == sfrxETH;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
function assetInfo()
|
|
126
|
-
external
|
|
127
|
-
view
|
|
128
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
129
|
-
{
|
|
125
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
130
126
|
return (AssetType.TOKEN, frxETH, 18);
|
|
131
127
|
}
|
|
132
128
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../SYBaseWithRewards.sol";
|
|
5
5
|
import "../../../interfaces/IStargateRouter.sol";
|
|
@@ -49,11 +49,7 @@ contract PendleStargateLPSY is SYBaseWithRewards {
|
|
|
49
49
|
_validateStargateStakingId(stargateStaking, sid, lp);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function _validateStargateStakingId(
|
|
53
|
-
address staking,
|
|
54
|
-
uint256 id,
|
|
55
|
-
address lpToken
|
|
56
|
-
) internal view {
|
|
52
|
+
function _validateStargateStakingId(address staking, uint256 id, address lpToken) internal view {
|
|
57
53
|
(address _lpToken, , , ) = IStargateStaking(staking).poolInfo(id);
|
|
58
54
|
// Custom error not needed here since this only happens on deployment
|
|
59
55
|
require(_lpToken == lpToken, "invalid sid & lpToken");
|
|
@@ -102,11 +98,7 @@ contract PendleStargateLPSY is SYBaseWithRewards {
|
|
|
102
98
|
|
|
103
99
|
uint256 preBalanceLp = _selfBalance(lp);
|
|
104
100
|
|
|
105
|
-
uint256 amountSD = IStargateRouter(stargateRouter).instantRedeemLocal(
|
|
106
|
-
pid,
|
|
107
|
-
amountSharesToRedeem,
|
|
108
|
-
receiver
|
|
109
|
-
);
|
|
101
|
+
uint256 amountSD = IStargateRouter(stargateRouter).instantRedeemLocal(pid, amountSharesToRedeem, receiver);
|
|
110
102
|
uint256 lpUsed = preBalanceLp - _selfBalance(lp);
|
|
111
103
|
if (lpUsed < amountSharesToRedeem) {
|
|
112
104
|
revert Errors.SYStargateRedeemCapExceeded(amountSharesToRedeem, lpUsed);
|
|
@@ -125,8 +117,7 @@ contract PendleStargateLPSY is SYBaseWithRewards {
|
|
|
125
117
|
* @dev It is the exchange rate of lp to underlying
|
|
126
118
|
*/
|
|
127
119
|
function exchangeRate() public view virtual override returns (uint256) {
|
|
128
|
-
return
|
|
129
|
-
IStargateLP(lp).totalLiquidity().divDown(IStargateLP(lp).totalSupply()) * convertRate;
|
|
120
|
+
return IStargateLP(lp).totalLiquidity().divDown(IStargateLP(lp).totalSupply()) * convertRate;
|
|
130
121
|
}
|
|
131
122
|
|
|
132
123
|
/*///////////////////////////////////////////////////////////////
|
|
@@ -212,11 +203,7 @@ contract PendleStargateLPSY is SYBaseWithRewards {
|
|
|
212
203
|
return token == underlying || token == lp;
|
|
213
204
|
}
|
|
214
205
|
|
|
215
|
-
function assetInfo()
|
|
216
|
-
external
|
|
217
|
-
view
|
|
218
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
219
|
-
{
|
|
206
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
220
207
|
return (AssetType.TOKEN, underlying, IERC20Metadata(underlying).decimals());
|
|
221
208
|
}
|
|
222
209
|
}
|