@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,126 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @title WadRayMath library
|
|
6
|
+
* @author Aave
|
|
7
|
+
* @notice Provides functions to perform calculations with Wad and Ray units
|
|
8
|
+
* @dev Provides mul and div function for wads (decimal numbers with 18 digits of precision) and rays (decimal numbers
|
|
9
|
+
* with 27 digits of precision)
|
|
10
|
+
* @dev Operations are rounded. If a value is >=.5, will be rounded up, otherwise rounded down.
|
|
11
|
+
*/
|
|
12
|
+
library WadRayMath {
|
|
13
|
+
// HALF_WAD and HALF_RAY expressed with extended notation as constant with operations are not supported in Yul assembly
|
|
14
|
+
uint256 internal constant WAD = 1e18;
|
|
15
|
+
uint256 internal constant HALF_WAD = 0.5e18;
|
|
16
|
+
|
|
17
|
+
uint256 internal constant RAY = 1e27;
|
|
18
|
+
uint256 internal constant HALF_RAY = 0.5e27;
|
|
19
|
+
|
|
20
|
+
uint256 internal constant WAD_RAY_RATIO = 1e9;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @dev Multiplies two wad, rounding half up to the nearest wad
|
|
24
|
+
* @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328
|
|
25
|
+
* @param a Wad
|
|
26
|
+
* @param b Wad
|
|
27
|
+
* @return c = a*b, in wad
|
|
28
|
+
*/
|
|
29
|
+
function wadMul(uint256 a, uint256 b) internal pure returns (uint256 c) {
|
|
30
|
+
// to avoid overflow, a <= (type(uint256).max - HALF_WAD) / b
|
|
31
|
+
assembly {
|
|
32
|
+
if iszero(or(iszero(b), iszero(gt(a, div(sub(not(0), HALF_WAD), b))))) {
|
|
33
|
+
revert(0, 0)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
c := div(add(mul(a, b), HALF_WAD), WAD)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @dev Divides two wad, rounding half up to the nearest wad
|
|
42
|
+
* @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328
|
|
43
|
+
* @param a Wad
|
|
44
|
+
* @param b Wad
|
|
45
|
+
* @return c = a/b, in wad
|
|
46
|
+
*/
|
|
47
|
+
function wadDiv(uint256 a, uint256 b) internal pure returns (uint256 c) {
|
|
48
|
+
// to avoid overflow, a <= (type(uint256).max - halfB) / WAD
|
|
49
|
+
assembly {
|
|
50
|
+
if or(iszero(b), iszero(iszero(gt(a, div(sub(not(0), div(b, 2)), WAD))))) {
|
|
51
|
+
revert(0, 0)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
c := div(add(mul(a, WAD), div(b, 2)), b)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @notice Multiplies two ray, rounding half up to the nearest ray
|
|
60
|
+
* @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328
|
|
61
|
+
* @param a Ray
|
|
62
|
+
* @param b Ray
|
|
63
|
+
* @return c = a raymul b
|
|
64
|
+
*/
|
|
65
|
+
function rayMul(uint256 a, uint256 b) internal pure returns (uint256 c) {
|
|
66
|
+
// to avoid overflow, a <= (type(uint256).max - HALF_RAY) / b
|
|
67
|
+
assembly {
|
|
68
|
+
if iszero(or(iszero(b), iszero(gt(a, div(sub(not(0), HALF_RAY), b))))) {
|
|
69
|
+
revert(0, 0)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
c := div(add(mul(a, b), HALF_RAY), RAY)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @notice Divides two ray, rounding half up to the nearest ray
|
|
78
|
+
* @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328
|
|
79
|
+
* @param a Ray
|
|
80
|
+
* @param b Ray
|
|
81
|
+
* @return c = a raydiv b
|
|
82
|
+
*/
|
|
83
|
+
function rayDiv(uint256 a, uint256 b) internal pure returns (uint256 c) {
|
|
84
|
+
// to avoid overflow, a <= (type(uint256).max - halfB) / RAY
|
|
85
|
+
assembly {
|
|
86
|
+
if or(iszero(b), iszero(iszero(gt(a, div(sub(not(0), div(b, 2)), RAY))))) {
|
|
87
|
+
revert(0, 0)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
c := div(add(mul(a, RAY), div(b, 2)), b)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @dev Casts ray down to wad
|
|
96
|
+
* @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328
|
|
97
|
+
* @param a Ray
|
|
98
|
+
* @return b = a converted to wad, rounded half up to the nearest wad
|
|
99
|
+
*/
|
|
100
|
+
function rayToWad(uint256 a) internal pure returns (uint256 b) {
|
|
101
|
+
assembly {
|
|
102
|
+
b := div(a, WAD_RAY_RATIO)
|
|
103
|
+
let remainder := mod(a, WAD_RAY_RATIO)
|
|
104
|
+
if iszero(lt(remainder, div(WAD_RAY_RATIO, 2))) {
|
|
105
|
+
b := add(b, 1)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @dev Converts wad up to ray
|
|
112
|
+
* @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328
|
|
113
|
+
* @param a Wad
|
|
114
|
+
* @return b = a converted in ray
|
|
115
|
+
*/
|
|
116
|
+
function wadToRay(uint256 a) internal pure returns (uint256 b) {
|
|
117
|
+
// to avoid overflow, b/WAD_RAY_RATIO == a
|
|
118
|
+
assembly {
|
|
119
|
+
b := mul(a, WAD_RAY_RATIO)
|
|
120
|
+
|
|
121
|
+
if iszero(eq(div(b, WAD_RAY_RATIO), a)) {
|
|
122
|
+
revert(0, 0)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -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/Ankr/IAnkrLiquidStaking.sol";
|
|
@@ -39,7 +39,7 @@ contract PendleAnkrBNBSY is SYBase {
|
|
|
39
39
|
) internal virtual override returns (uint256 amountSharesOut) {
|
|
40
40
|
if (tokenIn == NATIVE) {
|
|
41
41
|
uint256 preBalance = _selfBalance(ankrBNB);
|
|
42
|
-
IAnkrLiquidStaking(ankrLiquidStaking).stakeCerts{
|
|
42
|
+
IAnkrLiquidStaking(ankrLiquidStaking).stakeCerts{value: amountDeposited}();
|
|
43
43
|
amountSharesOut = _selfBalance(ankrBNB) - preBalance;
|
|
44
44
|
} else {
|
|
45
45
|
amountSharesOut = amountDeposited;
|
|
@@ -100,11 +100,7 @@ contract PendleAnkrBNBSY is SYBase {
|
|
|
100
100
|
amountTokenOut = amountSharesToRedeem;
|
|
101
101
|
} else {
|
|
102
102
|
uint256 amountBondToRedeem = IAnkrBNB(ankrBNB).sharesToBonds(amountSharesToRedeem);
|
|
103
|
-
(
|
|
104
|
-
uint256 minUnstakeAmount,
|
|
105
|
-
uint256 unstakeCapacity,
|
|
106
|
-
uint256 unstakeFee
|
|
107
|
-
) = _getAnkrRedeemInfo();
|
|
103
|
+
(uint256 minUnstakeAmount, uint256 unstakeCapacity, uint256 unstakeFee) = _getAnkrRedeemInfo();
|
|
108
104
|
|
|
109
105
|
if (amountBondToRedeem < minUnstakeAmount) {
|
|
110
106
|
revert MinimumRedeemAmountNotReached(amountBondToRedeem, minUnstakeAmount);
|
|
@@ -153,11 +149,7 @@ contract PendleAnkrBNBSY is SYBase {
|
|
|
153
149
|
return token == ankrBNB || token == NATIVE;
|
|
154
150
|
}
|
|
155
151
|
|
|
156
|
-
function assetInfo()
|
|
157
|
-
external
|
|
158
|
-
pure
|
|
159
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
160
|
-
{
|
|
152
|
+
function assetInfo() external pure returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
161
153
|
return (AssetType.TOKEN, NATIVE, 18);
|
|
162
154
|
}
|
|
163
155
|
}
|
|
@@ -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/IApeStaking.sol";
|
|
@@ -42,10 +42,7 @@ contract sAPE is SYBase {
|
|
|
42
42
|
emit Redeem(msg.sender, msg.sender, apeCoin, amountShares, amountTokenOut);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
function _deposit(
|
|
46
|
-
address,
|
|
47
|
-
uint256 amountDeposited
|
|
48
|
-
) internal virtual override returns (uint256 amountSharesOut) {
|
|
45
|
+
function _deposit(address, uint256 amountDeposited) internal virtual override returns (uint256 amountSharesOut) {
|
|
49
46
|
// Respecting APE's deposit invariant
|
|
50
47
|
if (amountDeposited < MIN_APE_DEPOSIT) {
|
|
51
48
|
revert Errors.SYApeDepositAmountTooSmall(amountDeposited);
|
|
@@ -81,10 +78,7 @@ contract sAPE is SYBase {
|
|
|
81
78
|
|
|
82
79
|
// There might be case when the contract is holding < 1 APE reward and user is withdrawing everything out of it
|
|
83
80
|
if (amountTokenOut > _selfBalance(apeCoin)) {
|
|
84
|
-
IApeStaking(apeStaking).withdrawApeCoin(
|
|
85
|
-
amountTokenOut - _selfBalance(apeCoin),
|
|
86
|
-
address(this)
|
|
87
|
-
);
|
|
81
|
+
IApeStaking(apeStaking).withdrawApeCoin(amountTokenOut - _selfBalance(apeCoin), address(this));
|
|
88
82
|
}
|
|
89
83
|
_transferOut(apeCoin, receiver, amountTokenOut);
|
|
90
84
|
_compound();
|
|
@@ -101,11 +95,7 @@ contract sAPE is SYBase {
|
|
|
101
95
|
|
|
102
96
|
function getTotalAssetOwned() public view returns (uint256 totalAssetOwned) {
|
|
103
97
|
(uint256 stakedAmount, ) = IApeStaking(apeStaking).addressPosition(address(this));
|
|
104
|
-
uint256 unclaimedAmount = IApeStaking(apeStaking).pendingRewards(
|
|
105
|
-
APE_COIN_POOL_ID,
|
|
106
|
-
address(this),
|
|
107
|
-
0
|
|
108
|
-
);
|
|
98
|
+
uint256 unclaimedAmount = IApeStaking(apeStaking).pendingRewards(APE_COIN_POOL_ID, address(this), 0);
|
|
109
99
|
uint256 floatingAmount = _selfBalance(apeCoin);
|
|
110
100
|
totalAssetOwned = stakedAmount + unclaimedAmount + floatingAmount;
|
|
111
101
|
}
|
|
@@ -177,11 +167,7 @@ contract sAPE is SYBase {
|
|
|
177
167
|
return token == apeCoin;
|
|
178
168
|
}
|
|
179
169
|
|
|
180
|
-
function assetInfo()
|
|
181
|
-
external
|
|
182
|
-
view
|
|
183
|
-
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
184
|
-
{
|
|
170
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
185
171
|
return (AssetType.TOKEN, apeCoin, IERC20Metadata(apeCoin).decimals());
|
|
186
172
|
}
|
|
187
173
|
}
|
package/contracts/core/StandardizedYield/implementations/BalancerStable/AuraEthxBbAWethSY.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 "./base/PendleAuraBalancerStableLPSYV2.sol";
|
|
5
5
|
import "./base/ComposableStable/ComposableStablePreview.sol";
|
|
@@ -15,8 +15,7 @@ contract AuraEthxBbAWethSY is PendleAuraBalancerStableLPSYV2, BbAWethHelper {
|
|
|
15
15
|
|
|
16
16
|
address internal constant _BB_A_WETH = 0xbB6881874825E60e1160416D6C426eae65f2459E;
|
|
17
17
|
address internal constant _WA_WETH = 0x03928473f25bb2da6Bc880b07eCBaDC636822264;
|
|
18
|
-
bytes32 internal constant _BB_A_WETH_POOL_ID =
|
|
19
|
-
0xbb6881874825e60e1160416d6c426eae65f2459e000000000000000000000592;
|
|
18
|
+
bytes32 internal constant _BB_A_WETH_POOL_ID = 0xbb6881874825e60e1160416d6c426eae65f2459e000000000000000000000592;
|
|
20
19
|
|
|
21
20
|
bool internal constant NO_TOKENS_EXEMPT = true;
|
|
22
21
|
bool internal constant ALL_TOKENS_EXEMPT = false;
|
|
@@ -26,22 +25,13 @@ contract AuraEthxBbAWethSY is PendleAuraBalancerStableLPSYV2, BbAWethHelper {
|
|
|
26
25
|
string memory _symbol
|
|
27
26
|
)
|
|
28
27
|
BbAWethHelper(LinearPreview(LINEAR_PREVIEW), _BB_A_WETH, _BB_A_WETH_POOL_ID, _WA_WETH)
|
|
29
|
-
PendleAuraBalancerStableLPSYV2(
|
|
30
|
-
_name,
|
|
31
|
-
_symbol,
|
|
32
|
-
LP,
|
|
33
|
-
AURA_PID,
|
|
34
|
-
ComposableStablePreview(COMPOSABLE_PREVIEW)
|
|
35
|
-
)
|
|
28
|
+
PendleAuraBalancerStableLPSYV2(_name, _symbol, LP, AURA_PID, ComposableStablePreview(COMPOSABLE_PREVIEW))
|
|
36
29
|
//solhint-disable-next-line
|
|
37
30
|
{
|
|
38
31
|
|
|
39
32
|
}
|
|
40
33
|
|
|
41
|
-
function _deposit(
|
|
42
|
-
address tokenIn,
|
|
43
|
-
uint256 amount
|
|
44
|
-
) internal override returns (uint256 amountSharesOut) {
|
|
34
|
+
function _deposit(address tokenIn, uint256 amount) internal override returns (uint256 amountSharesOut) {
|
|
45
35
|
if (tokenIn == NATIVE || tokenIn == WETH || tokenIn == WA_WETH) {
|
|
46
36
|
uint256 amountBbAWeth = _depositBbAWeth(tokenIn, amount);
|
|
47
37
|
amountSharesOut = super._deposit(BB_A_WETH, amountBbAWeth);
|
package/contracts/core/StandardizedYield/implementations/BalancerStable/AuraSwEthBbAWethSYV2.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 "./base/PendleAuraBalancerStableLPSYV2.sol";
|
|
5
5
|
import "./base/ComposableStable/ComposableStablePreview.sol";
|
|
@@ -15,8 +15,7 @@ contract AuraSwEthBbAWethSYV2 is PendleAuraBalancerStableLPSYV2, BbAWethHelper {
|
|
|
15
15
|
|
|
16
16
|
address internal constant _BB_A_WETH = 0xbB6881874825E60e1160416D6C426eae65f2459E;
|
|
17
17
|
address internal constant _WA_WETH = 0x03928473f25bb2da6Bc880b07eCBaDC636822264;
|
|
18
|
-
bytes32 internal constant _BB_A_WETH_POOL_ID =
|
|
19
|
-
0xbb6881874825e60e1160416d6c426eae65f2459e000000000000000000000592;
|
|
18
|
+
bytes32 internal constant _BB_A_WETH_POOL_ID = 0xbb6881874825e60e1160416d6c426eae65f2459e000000000000000000000592;
|
|
20
19
|
|
|
21
20
|
bool internal constant NO_TOKENS_EXEMPT = true;
|
|
22
21
|
bool internal constant ALL_TOKENS_EXEMPT = false;
|
|
@@ -26,22 +25,13 @@ contract AuraSwEthBbAWethSYV2 is PendleAuraBalancerStableLPSYV2, BbAWethHelper {
|
|
|
26
25
|
string memory _symbol
|
|
27
26
|
)
|
|
28
27
|
BbAWethHelper(LinearPreview(LINEAR_PREVIEW), _BB_A_WETH, _BB_A_WETH_POOL_ID, _WA_WETH)
|
|
29
|
-
PendleAuraBalancerStableLPSYV2(
|
|
30
|
-
_name,
|
|
31
|
-
_symbol,
|
|
32
|
-
LP,
|
|
33
|
-
AURA_PID,
|
|
34
|
-
ComposableStablePreview(COMPOSABLE_PREVIEW)
|
|
35
|
-
)
|
|
28
|
+
PendleAuraBalancerStableLPSYV2(_name, _symbol, LP, AURA_PID, ComposableStablePreview(COMPOSABLE_PREVIEW))
|
|
36
29
|
//solhint-disable-next-line
|
|
37
30
|
{
|
|
38
31
|
|
|
39
32
|
}
|
|
40
33
|
|
|
41
|
-
function _deposit(
|
|
42
|
-
address tokenIn,
|
|
43
|
-
uint256 amount
|
|
44
|
-
) internal override returns (uint256 amountSharesOut) {
|
|
34
|
+
function _deposit(address tokenIn, uint256 amount) internal override returns (uint256 amountSharesOut) {
|
|
45
35
|
if (tokenIn == NATIVE || tokenIn == WETH || tokenIn == WA_WETH) {
|
|
46
36
|
uint256 amountBbAWeth = _depositBbAWeth(tokenIn, amount);
|
|
47
37
|
amountSharesOut = super._deposit(BB_A_WETH, amountBbAWeth);
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
-
import "./base/
|
|
4
|
+
import "./base/PendleAuraBalancerStableLPSYV3Upg.sol";
|
|
5
5
|
import "./base/ComposableStable/ComposableStablePreview.sol";
|
|
6
6
|
|
|
7
|
-
contract
|
|
7
|
+
contract AuraWethVethSYUpg is PendleAuraBalancerStableLPSYV3Upg {
|
|
8
8
|
address internal constant VETH = 0x4Bc3263Eb5bb2Ef7Ad9aB6FB68be80E43b43801F;
|
|
9
9
|
address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
|
|
10
10
|
|
|
@@ -16,28 +16,21 @@ contract PendleAuraWethVethSY is PendleAuraBalancerStableLPSYV2 {
|
|
|
16
16
|
bool internal constant NO_TOKENS_EXEMPT = true;
|
|
17
17
|
bool internal constant ALL_TOKENS_EXEMPT = false;
|
|
18
18
|
|
|
19
|
-
constructor(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
)
|
|
23
|
-
PendleAuraBalancerStableLPSYV2(
|
|
24
|
-
_name,
|
|
25
|
-
_symbol,
|
|
26
|
-
LP,
|
|
27
|
-
AURA_PID,
|
|
28
|
-
ComposableStablePreview(COMPOSABLE_PREVIEW)
|
|
29
|
-
)
|
|
19
|
+
constructor()
|
|
20
|
+
PendleAuraBalancerStableLPSYV3Upg(LP, AURA_PID, ComposableStablePreview(COMPOSABLE_PREVIEW))
|
|
21
|
+
initializer
|
|
30
22
|
//solhint-disable-next-line
|
|
31
23
|
{
|
|
32
24
|
|
|
33
25
|
}
|
|
34
26
|
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
function initialize(string memory _name, string memory _symbol) external initializer {
|
|
28
|
+
__PendleAuraBalancerStableLPSYV3Upg_init(_name, _symbol);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function _deposit(address tokenIn, uint256 amount) internal virtual override returns (uint256 amountSharesOut) {
|
|
39
32
|
if (tokenIn == NATIVE) {
|
|
40
|
-
IWETH(WETH).deposit{
|
|
33
|
+
IWETH(WETH).deposit{value: amount}();
|
|
41
34
|
amountSharesOut = super._deposit(WETH, amount);
|
|
42
35
|
} else {
|
|
43
36
|
amountSharesOut = super._deposit(tokenIn, amount);
|
|
@@ -144,4 +137,4 @@ contract PendleAuraWethVethSY is PendleAuraBalancerStableLPSYV2 {
|
|
|
144
137
|
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
145
138
|
return isValidTokenIn(token);
|
|
146
139
|
}
|
|
147
|
-
}
|
|
140
|
+
}
|
package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.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 "./base/PendleAuraBalancerStableLPSYV2.sol";
|
|
5
5
|
import "./base/ComposableStable/ComposableStablePreview.sol";
|
|
@@ -11,8 +11,7 @@ contract PendleAuraBbAWethSwethSY is PendleAuraBalancerStableLPSYV2, BbAWethHelp
|
|
|
11
11
|
address internal constant SWETH = 0xf951E335afb289353dc249e82926178EaC7DEd78;
|
|
12
12
|
|
|
13
13
|
address internal constant _BB_A_WETH = 0x60D604890feaa0b5460B28A424407c24fe89374a;
|
|
14
|
-
bytes32 internal constant _BB_A_WETH_POOL_ID =
|
|
15
|
-
0x60d604890feaa0b5460b28a424407c24fe89374a0000000000000000000004fc;
|
|
14
|
+
bytes32 internal constant _BB_A_WETH_POOL_ID = 0x60d604890feaa0b5460b28a424407c24fe89374a0000000000000000000004fc;
|
|
16
15
|
address internal constant _WA_WETH = 0x59463BB67dDD04fe58ED291ba36C26d99A39fbc6;
|
|
17
16
|
|
|
18
17
|
bool internal constant NO_TOKENS_EXEMPT = true;
|
|
@@ -31,10 +30,7 @@ contract PendleAuraBbAWethSwethSY is PendleAuraBalancerStableLPSYV2, BbAWethHelp
|
|
|
31
30
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
function _deposit(
|
|
35
|
-
address tokenIn,
|
|
36
|
-
uint256 amount
|
|
37
|
-
) internal override returns (uint256 amountSharesOut) {
|
|
33
|
+
function _deposit(address tokenIn, uint256 amount) internal override returns (uint256 amountSharesOut) {
|
|
38
34
|
if (tokenIn == NATIVE || tokenIn == WETH || tokenIn == WA_WETH) {
|
|
39
35
|
uint256 amountBbAWeth = _depositBbAWeth(tokenIn, amount);
|
|
40
36
|
amountSharesOut = super._deposit(BB_A_WETH, amountBbAWeth);
|
|
@@ -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 "./base/PendleAuraBalancerStableLPSYV2.sol";
|
|
5
5
|
import "../../../../interfaces/IWETH.sol";
|
|
@@ -18,14 +18,9 @@ contract PendleAuraWethAnkrethSYV2 is PendleAuraBalancerStableLPSYV2 {
|
|
|
18
18
|
MetaStablePreview _previewHelper
|
|
19
19
|
) PendleAuraBalancerStableLPSYV2(_name, _symbol, LP, AURA_PID, _previewHelper) {}
|
|
20
20
|
|
|
21
|
-
function _deposit(address tokenIn, uint256 amount)
|
|
22
|
-
internal
|
|
23
|
-
virtual
|
|
24
|
-
override
|
|
25
|
-
returns (uint256 amountSharesOut)
|
|
26
|
-
{
|
|
21
|
+
function _deposit(address tokenIn, uint256 amount) internal virtual override returns (uint256 amountSharesOut) {
|
|
27
22
|
if (tokenIn == NATIVE) {
|
|
28
|
-
IWETH(WETH).deposit{
|
|
23
|
+
IWETH(WETH).deposit{value: amount}();
|
|
29
24
|
amountSharesOut = super._deposit(WETH, amount);
|
|
30
25
|
} else {
|
|
31
26
|
amountSharesOut = super._deposit(tokenIn, amount);
|
|
@@ -47,13 +42,10 @@ contract PendleAuraWethAnkrethSYV2 is PendleAuraBalancerStableLPSYV2 {
|
|
|
47
42
|
}
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
function _previewDeposit(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
override
|
|
55
|
-
returns (uint256 amountSharesOut)
|
|
56
|
-
{
|
|
45
|
+
function _previewDeposit(
|
|
46
|
+
address tokenIn,
|
|
47
|
+
uint256 amountTokenToDeposit
|
|
48
|
+
) internal view virtual override returns (uint256 amountSharesOut) {
|
|
57
49
|
if (tokenIn == NATIVE) {
|
|
58
50
|
amountSharesOut = super._previewDeposit(WETH, amountTokenToDeposit);
|
|
59
51
|
} else {
|
|
@@ -61,13 +53,10 @@ contract PendleAuraWethAnkrethSYV2 is PendleAuraBalancerStableLPSYV2 {
|
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
function _previewRedeem(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
override
|
|
69
|
-
returns (uint256 amountTokenOut)
|
|
70
|
-
{
|
|
56
|
+
function _previewRedeem(
|
|
57
|
+
address tokenOut,
|
|
58
|
+
uint256 amountSharesToRedeem
|
|
59
|
+
) internal view virtual override returns (uint256 amountTokenOut) {
|
|
71
60
|
if (tokenOut == NATIVE) {
|
|
72
61
|
amountTokenOut = super._previewRedeem(WETH, amountSharesToRedeem);
|
|
73
62
|
} else {
|
|
@@ -75,13 +64,7 @@ contract PendleAuraWethAnkrethSYV2 is PendleAuraBalancerStableLPSYV2 {
|
|
|
75
64
|
}
|
|
76
65
|
}
|
|
77
66
|
|
|
78
|
-
function _getPoolTokenAddresses()
|
|
79
|
-
internal
|
|
80
|
-
view
|
|
81
|
-
virtual
|
|
82
|
-
override
|
|
83
|
-
returns (address[] memory res)
|
|
84
|
-
{
|
|
67
|
+
function _getPoolTokenAddresses() internal view virtual override returns (address[] memory res) {
|
|
85
68
|
res = new address[](2);
|
|
86
69
|
res[0] = WETH;
|
|
87
70
|
res[1] = ANKRETH;
|
|
@@ -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 "./base/PendleAuraBalancerStableLPSYV2.sol";
|
|
5
5
|
import "../../../../interfaces/IWETH.sol";
|
|
@@ -18,14 +18,9 @@ contract PendleAuraWethRocketEthSYV2 is PendleAuraBalancerStableLPSYV2 {
|
|
|
18
18
|
MetaStablePreview _previewHelper
|
|
19
19
|
) PendleAuraBalancerStableLPSYV2(_name, _symbol, LP, AURA_PID, _previewHelper) {}
|
|
20
20
|
|
|
21
|
-
function _deposit(address tokenIn, uint256 amount)
|
|
22
|
-
internal
|
|
23
|
-
virtual
|
|
24
|
-
override
|
|
25
|
-
returns (uint256 amountSharesOut)
|
|
26
|
-
{
|
|
21
|
+
function _deposit(address tokenIn, uint256 amount) internal virtual override returns (uint256 amountSharesOut) {
|
|
27
22
|
if (tokenIn == NATIVE) {
|
|
28
|
-
IWETH(WETH).deposit{
|
|
23
|
+
IWETH(WETH).deposit{value: amount}();
|
|
29
24
|
amountSharesOut = super._deposit(WETH, amount);
|
|
30
25
|
} else {
|
|
31
26
|
amountSharesOut = super._deposit(tokenIn, amount);
|
|
@@ -47,13 +42,10 @@ contract PendleAuraWethRocketEthSYV2 is PendleAuraBalancerStableLPSYV2 {
|
|
|
47
42
|
}
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
function _previewDeposit(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
override
|
|
55
|
-
returns (uint256 amountSharesOut)
|
|
56
|
-
{
|
|
45
|
+
function _previewDeposit(
|
|
46
|
+
address tokenIn,
|
|
47
|
+
uint256 amountTokenToDeposit
|
|
48
|
+
) internal view virtual override returns (uint256 amountSharesOut) {
|
|
57
49
|
if (tokenIn == NATIVE) {
|
|
58
50
|
amountSharesOut = super._previewDeposit(WETH, amountTokenToDeposit);
|
|
59
51
|
} else {
|
|
@@ -61,13 +53,10 @@ contract PendleAuraWethRocketEthSYV2 is PendleAuraBalancerStableLPSYV2 {
|
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
function _previewRedeem(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
override
|
|
69
|
-
returns (uint256 amountTokenOut)
|
|
70
|
-
{
|
|
56
|
+
function _previewRedeem(
|
|
57
|
+
address tokenOut,
|
|
58
|
+
uint256 amountSharesToRedeem
|
|
59
|
+
) internal view virtual override returns (uint256 amountTokenOut) {
|
|
71
60
|
if (tokenOut == NATIVE) {
|
|
72
61
|
amountTokenOut = super._previewRedeem(WETH, amountSharesToRedeem);
|
|
73
62
|
} else {
|
|
@@ -75,13 +64,7 @@ contract PendleAuraWethRocketEthSYV2 is PendleAuraBalancerStableLPSYV2 {
|
|
|
75
64
|
}
|
|
76
65
|
}
|
|
77
66
|
|
|
78
|
-
function _getPoolTokenAddresses()
|
|
79
|
-
internal
|
|
80
|
-
view
|
|
81
|
-
virtual
|
|
82
|
-
override
|
|
83
|
-
returns (address[] memory res)
|
|
84
|
-
{
|
|
67
|
+
function _getPoolTokenAddresses() internal view virtual override returns (address[] memory res) {
|
|
85
68
|
res = new address[](2);
|
|
86
69
|
res[0] = ROCKET_ETH;
|
|
87
70
|
res[1] = WETH;
|
package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.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 "./base/PendleAuraBalancerStableLPSYV2.sol";
|
|
5
5
|
import "../../../../interfaces/IWETH.sol";
|
|
@@ -18,14 +18,9 @@ contract PendleAuraWethStafiEthSY is PendleAuraBalancerStableLPSYV2 {
|
|
|
18
18
|
MetaStablePreview _previewHelper
|
|
19
19
|
) PendleAuraBalancerStableLPSYV2(_name, _symbol, LP, AURA_PID, _previewHelper) {}
|
|
20
20
|
|
|
21
|
-
function _deposit(address tokenIn, uint256 amount)
|
|
22
|
-
internal
|
|
23
|
-
virtual
|
|
24
|
-
override
|
|
25
|
-
returns (uint256 amountSharesOut)
|
|
26
|
-
{
|
|
21
|
+
function _deposit(address tokenIn, uint256 amount) internal virtual override returns (uint256 amountSharesOut) {
|
|
27
22
|
if (tokenIn == NATIVE) {
|
|
28
|
-
IWETH(WETH).deposit{
|
|
23
|
+
IWETH(WETH).deposit{value: amount}();
|
|
29
24
|
amountSharesOut = super._deposit(WETH, amount);
|
|
30
25
|
} else {
|
|
31
26
|
amountSharesOut = super._deposit(tokenIn, amount);
|
|
@@ -47,13 +42,10 @@ contract PendleAuraWethStafiEthSY is PendleAuraBalancerStableLPSYV2 {
|
|
|
47
42
|
}
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
function _previewDeposit(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
override
|
|
55
|
-
returns (uint256 amountSharesOut)
|
|
56
|
-
{
|
|
45
|
+
function _previewDeposit(
|
|
46
|
+
address tokenIn,
|
|
47
|
+
uint256 amountTokenToDeposit
|
|
48
|
+
) internal view virtual override returns (uint256 amountSharesOut) {
|
|
57
49
|
if (tokenIn == NATIVE) {
|
|
58
50
|
amountSharesOut = super._previewDeposit(WETH, amountTokenToDeposit);
|
|
59
51
|
} else {
|
|
@@ -61,13 +53,10 @@ contract PendleAuraWethStafiEthSY is PendleAuraBalancerStableLPSYV2 {
|
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
function _previewRedeem(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
override
|
|
69
|
-
returns (uint256 amountTokenOut)
|
|
70
|
-
{
|
|
56
|
+
function _previewRedeem(
|
|
57
|
+
address tokenOut,
|
|
58
|
+
uint256 amountSharesToRedeem
|
|
59
|
+
) internal view virtual override returns (uint256 amountTokenOut) {
|
|
71
60
|
if (tokenOut == NATIVE) {
|
|
72
61
|
amountTokenOut = super._previewRedeem(WETH, amountSharesToRedeem);
|
|
73
62
|
} else {
|
|
@@ -75,13 +64,7 @@ contract PendleAuraWethStafiEthSY is PendleAuraBalancerStableLPSYV2 {
|
|
|
75
64
|
}
|
|
76
65
|
}
|
|
77
66
|
|
|
78
|
-
function _getPoolTokenAddresses()
|
|
79
|
-
internal
|
|
80
|
-
view
|
|
81
|
-
virtual
|
|
82
|
-
override
|
|
83
|
-
returns (address[] memory res)
|
|
84
|
-
{
|
|
67
|
+
function _getPoolTokenAddresses() internal view virtual override returns (address[] memory res) {
|
|
85
68
|
res = new address[](2);
|
|
86
69
|
res[0] = STAFI_ETH;
|
|
87
70
|
res[1] = WETH;
|