@pendle/core-v2 0.21.0-testnet → 1.0.1-mainnet
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +4 -0
- package/build/artifacts/contracts/{interfaces/IApeStaking.sol/IApeStaking.json → LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.json} +52 -70
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +310 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +389 -0
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +5 -134
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +0 -18
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.json +32 -43
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{Balancer/IGauge.sol/IGauge.json → IPFeeDistributorFactory.sol/IPFeeDistributorFactory.json} +33 -18
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -42
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +100 -73
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +2 -2
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.json +136 -0
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +9 -7
- package/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol +159 -0
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol +99 -0
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol +70 -0
- package/contracts/core/BulkSeller/BulkSeller.sol +1 -1
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +3 -1
- package/contracts/core/libraries/ArrayLib.sol +0 -12
- package/contracts/core/libraries/Errors.sol +2 -15
- package/contracts/interfaces/ConvexCurve/IRewards.sol +0 -5
- package/contracts/interfaces/IPFeeDistributor.sol +10 -12
- package/contracts/interfaces/IPFeeDistributorFactory.sol +14 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +1 -1
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +192 -194
- package/contracts/router/kyberswap/IMultihopRouter.sol +139 -0
- package/deployments/1-core.json +29 -0
- package/deployments/1-markets/FRAXUSDC-CURVELP-MARCH30.json +11 -0
- package/deployments/1-markets/LOOKS-STAKING-MARCH30.json +10 -0
- package/deployments/1-markets/STETH-JUNE29.json +10 -0
- package/deployments/1-markets/STETH-MARCH30.json +10 -0
- package/package.json +6 -6
- package/typechain-types/IApeStaking.ts +0 -31
- package/typechain-types/IPFeeDistributor.ts +78 -61
- package/typechain-types/IPFeeDistributorFactory.ts +139 -53
- package/typechain-types/IRewards.ts +5 -35
- package/typechain-types/MarketMathStatic.ts +0 -49
- package/typechain-types/PendleApeStakingSY.ts +204 -88
- package/typechain-types/PendleFeeDistributor.ts +117 -409
- package/typechain-types/RouterStatic.ts +49 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerFactory__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
- package/typechain-types/factories/BulkSeller__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +4 -133
- package/typechain-types/factories/IApeStaking__factory.ts +0 -34
- package/typechain-types/factories/IPFeeDistributorFactory__factory.ts +34 -25
- package/typechain-types/factories/IPFeeDistributor__factory.ts +31 -42
- package/typechain-types/factories/IRewards__factory.ts +0 -18
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -41
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleApeStakingSY__factory.ts +141 -57
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +66 -341
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +41 -18
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +40 -301
- package/typechain-types/index.ts +10 -68
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +0 -592
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +0 -1075
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.json +0 -1257
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.json +0 -1244
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.json +0 -1218
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.json +0 -1192
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.json +0 -133
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.json +0 -40
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +0 -322
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.json +0 -1171
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.json +0 -133
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.json +0 -10
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.json +0 -24
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.json +0 -133
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.json +0 -328
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.json +0 -467
- package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.json +0 -30
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.json +0 -398
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.json +0 -24
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.json +0 -278
- package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +0 -322
- package/build/artifacts/contracts/offchain-helpers/PendleMulticall.sol/PendleMulticall.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/PendleMulticall.sol/PendleMulticall.json +0 -47
- package/build/artifacts/contracts/router/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.json +0 -10
- package/build/artifacts/contracts/router/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.json +0 -65
- package/build/artifacts/contracts/router/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.json +0 -388
- package/build/artifacts/contracts/router/kyberswap/interfaces/IHashflow.sol/IHashflow.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IHashflow.sol/IHashflow.json +0 -101
- package/build/artifacts/contracts/router/kyberswap/interfaces/IMetaAggregationRouter.sol/IMetaAggregationRouter.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IMetaAggregationRouter.sol/IMetaAggregationRouter.json +0 -183
- package/build/artifacts/contracts/router/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.json +0 -215
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol +0 -224
- package/contracts/core/StandardizedYield/StEthHelper.sol +0 -71
- package/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol +0 -197
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol +0 -170
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol +0 -162
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol +0 -134
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol +0 -154
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +0 -289
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +0 -618
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol +0 -68
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +0 -322
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +0 -390
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol +0 -329
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +0 -30
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +0 -189
- package/contracts/interfaces/Balancer/IAsset.sol +0 -4
- package/contracts/interfaces/Balancer/IBalancerFees.sol +0 -6
- package/contracts/interfaces/Balancer/IBalancerStablePreview.sol +0 -22
- package/contracts/interfaces/Balancer/IBasePool.sol +0 -30
- package/contracts/interfaces/Balancer/IComposableStable.sol +0 -39
- package/contracts/interfaces/Balancer/IGauge.sol +0 -10
- package/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol +0 -6
- package/contracts/interfaces/Balancer/IMetaStablePool.sol +0 -31
- package/contracts/interfaces/Balancer/IRateProvider.sol +0 -6
- package/contracts/interfaces/Balancer/IVault.sol +0 -78
- package/contracts/interfaces/IApeStaking.sol +0 -30
- package/contracts/offchain-helpers/Multicall2.sol +0 -103
- package/contracts/offchain-helpers/PendleMulticall.sol +0 -26
- package/contracts/router/kyberswap/ScaleDataHelperEthereum1.sol +0 -147
- package/contracts/router/kyberswap/interfaces/IAggregationExecutor.sol +0 -17
- package/contracts/router/kyberswap/interfaces/IExecutorHelperEthereum1.sol +0 -191
- package/contracts/router/kyberswap/interfaces/IHashflow.sol +0 -30
- package/contracts/router/kyberswap/interfaces/IMetaAggregationRouter.sol +0 -33
- package/contracts/router/kyberswap/interfaces/IMetaAggregationRouterV2.sol +0 -42
- package/deployments/43113-core.json +0 -29
- package/deployments/43113-helper.json +0 -4
- package/deployments/43113-markets/APE-30-MARCH.json +0 -10
- package/deployments/43113-markets/USDC-FEB-2ND.json +0 -10
- package/deployments/43113-markets/USDC-FEB-4TH.json +0 -10
- package/deployments/43113-markets/WETH-FEB-2ND.json +0 -11
- package/deployments/43113-markets/WETH-FEB-4TH.json +0 -11
- package/deployments/43113-testenv.json +0 -22
- package/deployments/80001-core.json +0 -28
- package/deployments/80001-helper.json +0 -4
- package/deployments/80001-markets/USDC-DEC-8TH.json +0 -10
- package/deployments/80001-markets/USDC-FEB-4TH.json +0 -10
- package/deployments/80001-markets/WETH-FEB-4TH.json +0 -11
- package/deployments/80001-testenv.json +0 -22
- package/typechain-types/BribeDistributor.ts +0 -363
- package/typechain-types/ComposableStablePreview.ts +0 -217
- package/typechain-types/DistributorBase.ts +0 -363
- package/typechain-types/FeeDistributor.ts +0 -416
- package/typechain-types/GMXPreviewHelper.ts +0 -134
- package/typechain-types/I1inchAggregationRouterV5.ts +0 -257
- package/typechain-types/IAggregationExecutor.ts +0 -182
- package/typechain-types/IBalancerFees.ts +0 -89
- package/typechain-types/IBalancerStablePreview.ts +0 -217
- package/typechain-types/IBasePool.ts +0 -482
- package/typechain-types/IComposableStable.ts +0 -730
- package/typechain-types/IExecutorHelperEthereum1.ts +0 -643
- package/typechain-types/IGMXVault.ts +0 -494
- package/typechain-types/IGauge.ts +0 -160
- package/typechain-types/IGlpManager.ts +0 -115
- package/typechain-types/IHashflow.ts +0 -159
- package/typechain-types/IKyberSwapAggregationRouterHelper.ts +0 -109
- package/typechain-types/ILiquidityGaugeFactory.ts +0 -99
- package/typechain-types/IMetaAggregationRouter.ts +0 -213
- package/typechain-types/IMetaAggregationRouterV2.ts +0 -221
- package/typechain-types/IMetaStablePool.ts +0 -619
- package/typechain-types/IMultihopRouterEthereum.ts +0 -209
- package/typechain-types/IPYieldTokenV2.ts +0 -915
- package/typechain-types/IRateProvider.ts +0 -81
- package/typechain-types/IRewardRouterV2.ts +0 -303
- package/typechain-types/ISwapAggregator.ts +0 -124
- package/typechain-types/IVault.ts +0 -410
- package/typechain-types/IVaultPriceFeed.ts +0 -114
- package/typechain-types/InterestManagerYTV2.ts +0 -124
- package/typechain-types/MetaStableMath.ts +0 -113
- package/typechain-types/MetaStablePreview.ts +0 -501
- package/typechain-types/Multicall2.ts +0 -437
- package/typechain-types/PendleAura3EthSY.ts +0 -1600
- package/typechain-types/PendleAuraBalancerStableLPSY.ts +0 -1523
- package/typechain-types/PendleAuraCbethWstethSY.ts +0 -1587
- package/typechain-types/PendleAuraWethRethSY.ts +0 -1549
- package/typechain-types/PendleAuraWethWstethSY.ts +0 -1523
- package/typechain-types/PendleGlpSY.ts +0 -1449
- package/typechain-types/PendleMulticall.ts +0 -110
- package/typechain-types/PendlePrincipalTokenV2.ts +0 -614
- package/typechain-types/PendleYieldContractFactoryV2.ts +0 -801
- package/typechain-types/PendleYieldTokenV2.ts +0 -1304
- package/typechain-types/SAPE.ts +0 -1395
- package/typechain-types/StEthHelper.ts +0 -107
- package/typechain-types/StablePreviewBase.ts +0 -217
- package/typechain-types/SwapAggregator.ts +0 -406
- package/typechain-types/factories/BribeDistributor__factory.ts +0 -303
- package/typechain-types/factories/ComposableStablePreview__factory.ts +0 -190
- package/typechain-types/factories/DistributorBase__factory.ts +0 -249
- package/typechain-types/factories/FeeDistributor__factory.ts +0 -339
- package/typechain-types/factories/GMXPreviewHelper__factory.ts +0 -78
- package/typechain-types/factories/I1inchAggregationRouterV5__factory.ts +0 -179
- package/typechain-types/factories/IAggregationExecutor__factory.ts +0 -84
- package/typechain-types/factories/IBalancerFees__factory.ts +0 -36
- package/typechain-types/factories/IBalancerStablePreview__factory.ts +0 -152
- package/typechain-types/factories/IBasePool__factory.ts +0 -340
- package/typechain-types/factories/IComposableStable__factory.ts +0 -482
- package/typechain-types/factories/IExecutorHelperEthereum1__factory.ts +0 -407
- package/typechain-types/factories/IGMXVault__factory.ts +0 -320
- package/typechain-types/factories/IGauge__factory.ts +0 -70
- package/typechain-types/factories/IGlpManager__factory.ts +0 -55
- package/typechain-types/factories/IHashflow__factory.ts +0 -113
- package/typechain-types/factories/IKyberSwapAggregationRouterHelper__factory.ts +0 -56
- package/typechain-types/factories/ILiquidityGaugeFactory__factory.ts +0 -49
- package/typechain-types/factories/IMetaAggregationRouterV2__factory.ts +0 -234
- package/typechain-types/factories/IMetaAggregationRouter__factory.ts +0 -202
- package/typechain-types/factories/IMetaStablePool__factory.ts +0 -413
- package/typechain-types/factories/IMultihopRouterEthereum__factory.ts +0 -155
- package/typechain-types/factories/IPYieldTokenV2__factory.ts +0 -702
- package/typechain-types/factories/IRateProvider__factory.ts +0 -36
- package/typechain-types/factories/IRewardRouterV2__factory.ts +0 -180
- package/typechain-types/factories/ISwapAggregator__factory.ts +0 -66
- package/typechain-types/factories/IVaultPriceFeed__factory.ts +0 -60
- package/typechain-types/factories/IVault__factory.ts +0 -287
- package/typechain-types/factories/InterestManagerYTV2__factory.ts +0 -63
- package/typechain-types/factories/MetaStableMath__factory.ts +0 -93
- package/typechain-types/factories/MetaStablePreview__factory.ts +0 -375
- package/typechain-types/factories/Multicall2__factory.ts +0 -372
- package/typechain-types/factories/PendleAura3EthSY__factory.ts +0 -1326
- package/typechain-types/factories/PendleAuraBalancerStableLPSY__factory.ts +0 -1190
- package/typechain-types/factories/PendleAuraCbethWstethSY__factory.ts +0 -1317
- package/typechain-types/factories/PendleAuraWethRethSY__factory.ts +0 -1291
- package/typechain-types/factories/PendleAuraWethWstethSY__factory.ts +0 -1265
- package/typechain-types/factories/PendleGlpSY__factory.ts +0 -1255
- package/typechain-types/factories/PendleMulticall__factory.ts +0 -100
- package/typechain-types/factories/PendlePrincipalTokenV2__factory.ts +0 -564
- package/typechain-types/factories/PendleYieldContractFactoryV2__factory.ts +0 -674
- package/typechain-types/factories/PendleYieldTokenV2__factory.ts +0 -1122
- package/typechain-types/factories/SAPE__factory.ts +0 -1142
- package/typechain-types/factories/StEthHelper__factory.ts +0 -62
- package/typechain-types/factories/StablePreviewBase__factory.ts +0 -148
- package/typechain-types/factories/SwapAggregator__factory.ts +0 -309
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
|
|
3
3
|
pragma solidity 0.8.17;
|
|
4
|
+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
5
|
+
import "./IMultihopRouter.sol";
|
|
6
|
+
import "./IAggregatorRouterHelper.sol";
|
|
4
7
|
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
5
8
|
import "../../core/libraries/BoringOwnableUpgradeable.sol";
|
|
6
9
|
|
|
7
|
-
import "../../interfaces/IWETH.sol";
|
|
8
|
-
|
|
9
|
-
import "./interfaces/IMetaAggregationRouter.sol";
|
|
10
|
-
import "./interfaces/IMetaAggregationRouterV2.sol";
|
|
11
|
-
import "./interfaces/IHashflow.sol";
|
|
12
|
-
import "./interfaces/IExecutorHelperEthereum1.sol";
|
|
13
|
-
|
|
14
|
-
import "./IAggregatorRouterHelper.sol";
|
|
15
|
-
import "./ScaleDataHelperEthereum1.sol";
|
|
16
|
-
|
|
17
10
|
contract AggregationRouterHelper is
|
|
18
11
|
IAggregationRouterHelper,
|
|
19
12
|
Initializable,
|
|
@@ -27,6 +20,8 @@ contract AggregationRouterHelper is
|
|
|
27
20
|
uint256 private constant _BURN_FROM_TX_ORIGIN = 0x10;
|
|
28
21
|
uint256 private constant _SIMPLE_SWAP = 0x20;
|
|
29
22
|
|
|
23
|
+
uint256 private constant SLIPPAGE_RANGE = 10; // over 100
|
|
24
|
+
|
|
30
25
|
constructor() initializer {}
|
|
31
26
|
|
|
32
27
|
function initialize() external initializer {
|
|
@@ -35,9 +30,30 @@ contract AggregationRouterHelper is
|
|
|
35
30
|
|
|
36
31
|
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
enum DexType {
|
|
34
|
+
UNI,
|
|
35
|
+
STABLESWAP,
|
|
36
|
+
CURVE,
|
|
37
|
+
KYBERDMM,
|
|
38
|
+
SADDLE,
|
|
39
|
+
UNIV3PROMM,
|
|
40
|
+
BALANCERV2,
|
|
41
|
+
KYBERRFQ,
|
|
42
|
+
DODO,
|
|
43
|
+
VELODROME,
|
|
44
|
+
PLATYPUS
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
struct SwapDescription {
|
|
48
|
+
IERC20 srcToken;
|
|
49
|
+
IERC20 dstToken;
|
|
50
|
+
address[] srcReceivers;
|
|
51
|
+
uint256[] srcAmounts;
|
|
52
|
+
address dstReceiver;
|
|
53
|
+
uint256 amount;
|
|
54
|
+
uint256 minReturnAmount;
|
|
55
|
+
uint256 flags;
|
|
56
|
+
bytes permit;
|
|
41
57
|
}
|
|
42
58
|
|
|
43
59
|
struct SimpleSwapData {
|
|
@@ -49,7 +65,7 @@ contract AggregationRouterHelper is
|
|
|
49
65
|
}
|
|
50
66
|
|
|
51
67
|
struct SwapExecutorDescription {
|
|
52
|
-
Swap[][] swapSequences;
|
|
68
|
+
IMultihopRouter.Swap[][] swapSequences;
|
|
53
69
|
address tokenIn;
|
|
54
70
|
address tokenOut;
|
|
55
71
|
uint256 minTotalAmountOut;
|
|
@@ -64,129 +80,47 @@ contract AggregationRouterHelper is
|
|
|
64
80
|
returns (bytes memory)
|
|
65
81
|
{
|
|
66
82
|
bytes4 selector = bytes4(kybercall[:4]);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
selector == IMetaAggregationRouter.swap.selector ||
|
|
78
|
-
selector == IMetaAggregationRouter.swapSimpleMode.selector
|
|
79
|
-
) {
|
|
80
|
-
(
|
|
81
|
-
address callTarget,
|
|
82
|
-
IMetaAggregationRouter.SwapDescription memory desc,
|
|
83
|
-
bytes memory targetData,
|
|
84
|
-
bytes memory clientData
|
|
85
|
-
) = abi.decode(
|
|
86
|
-
kybercall[4:],
|
|
87
|
-
(address, IMetaAggregationRouter.SwapDescription, bytes, bytes)
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
(desc, targetData) = _getScaledInputDataV1(
|
|
91
|
-
desc,
|
|
92
|
-
targetData,
|
|
93
|
-
newAmount,
|
|
94
|
-
selector == IMetaAggregationRouter.swapSimpleMode.selector ||
|
|
95
|
-
_flagsChecked(desc.flags, _SIMPLE_SWAP)
|
|
96
|
-
);
|
|
97
|
-
return abi.encodeWithSelector(selector, callTarget, desc, targetData, clientData);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (selector == IMetaAggregationRouterV2.swap.selector) {
|
|
101
|
-
IMetaAggregationRouterV2.SwapExecutionParams memory params = abi.decode(
|
|
102
|
-
kybercall[4:],
|
|
103
|
-
(IMetaAggregationRouterV2.SwapExecutionParams)
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
(params.desc, params.targetData) = _getScaledInputDataV2(
|
|
107
|
-
params.desc,
|
|
108
|
-
params.targetData,
|
|
109
|
-
newAmount,
|
|
110
|
-
_flagsChecked(params.desc.flags, _SIMPLE_SWAP)
|
|
111
|
-
);
|
|
112
|
-
return abi.encodeWithSelector(selector, params);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (selector == IMetaAggregationRouterV2.swapSimpleMode.selector) {
|
|
116
|
-
(
|
|
117
|
-
address callTarget,
|
|
118
|
-
IMetaAggregationRouterV2.SwapDescriptionV2 memory desc,
|
|
119
|
-
bytes memory targetData,
|
|
120
|
-
bytes memory clientData
|
|
121
|
-
) = abi.decode(
|
|
122
|
-
kybercall[4:],
|
|
123
|
-
(address, IMetaAggregationRouterV2.SwapDescriptionV2, bytes, bytes)
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
(desc, targetData) = _getScaledInputDataV2(desc, targetData, newAmount, true);
|
|
127
|
-
return abi.encodeWithSelector(selector, callTarget, desc, targetData, clientData);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
revert("InputScalingHelper: Invalid selector");
|
|
83
|
+
(
|
|
84
|
+
address caller,
|
|
85
|
+
SwapDescription memory desc,
|
|
86
|
+
bytes memory executorData,
|
|
87
|
+
bytes memory clientData
|
|
88
|
+
) = abi.decode(kybercall[4:], (address, SwapDescription, bytes, bytes));
|
|
89
|
+
|
|
90
|
+
(desc, executorData) = _getScaledInputData(desc, executorData, newAmount);
|
|
91
|
+
return abi.encodeWithSelector(selector, caller, desc, executorData, clientData);
|
|
131
92
|
}
|
|
132
93
|
|
|
133
|
-
function
|
|
134
|
-
|
|
94
|
+
function _getScaledInputData(
|
|
95
|
+
SwapDescription memory desc,
|
|
135
96
|
bytes memory executorData,
|
|
136
|
-
uint256 newAmount
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
uint256 oldAmount = desc.amount;
|
|
140
|
-
if (oldAmount == newAmount) {
|
|
141
|
-
return (desc, executorData);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// simple mode swap
|
|
145
|
-
if (isSimpleMode) {
|
|
146
|
-
return (
|
|
147
|
-
_scaledSwapDescriptionV1(desc, oldAmount, newAmount),
|
|
148
|
-
_scaledSimpleSwapData(executorData, oldAmount, newAmount)
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
//normal mode swap
|
|
153
|
-
return (
|
|
154
|
-
_scaledSwapDescriptionV1(desc, oldAmount, newAmount),
|
|
155
|
-
_scaledExecutorCallBytesData(executorData, oldAmount, newAmount)
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function _getScaledInputDataV2(
|
|
160
|
-
IMetaAggregationRouterV2.SwapDescriptionV2 memory desc,
|
|
161
|
-
bytes memory executorData,
|
|
162
|
-
uint256 newAmount,
|
|
163
|
-
bool isSimpleMode
|
|
164
|
-
) internal pure returns (IMetaAggregationRouterV2.SwapDescriptionV2 memory, bytes memory) {
|
|
97
|
+
uint256 newAmount
|
|
98
|
+
) internal pure returns (SwapDescription memory, bytes memory) {
|
|
99
|
+
uint256 flags = desc.flags;
|
|
165
100
|
uint256 oldAmount = desc.amount;
|
|
166
101
|
if (oldAmount == newAmount) {
|
|
167
102
|
return (desc, executorData);
|
|
168
103
|
}
|
|
169
104
|
|
|
170
105
|
// simple mode swap
|
|
171
|
-
if (
|
|
106
|
+
if (flags & _SIMPLE_SWAP != 0) {
|
|
107
|
+
require(desc.srcReceivers.length == 0, "kyber: can't scale if take fee");
|
|
172
108
|
return (
|
|
173
|
-
|
|
174
|
-
|
|
109
|
+
_getNewDescription(desc, oldAmount, newAmount),
|
|
110
|
+
_getNewSimpleSwapData(executorData, oldAmount, newAmount)
|
|
175
111
|
);
|
|
176
112
|
}
|
|
177
113
|
|
|
178
114
|
//normal mode swap
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
_scaledExecutorCallBytesData(executorData, oldAmount, newAmount)
|
|
182
|
-
);
|
|
115
|
+
bytes memory newExecutorData = _getNewExecutorData(executorData, oldAmount, newAmount);
|
|
116
|
+
return (_getNewDescription(desc, oldAmount, newAmount), newExecutorData);
|
|
183
117
|
}
|
|
184
118
|
|
|
185
|
-
function
|
|
186
|
-
|
|
119
|
+
function _getNewDescription(
|
|
120
|
+
SwapDescription memory desc,
|
|
187
121
|
uint256 oldAmount,
|
|
188
122
|
uint256 newAmount
|
|
189
|
-
) internal pure returns (
|
|
123
|
+
) internal pure returns (SwapDescription memory) {
|
|
190
124
|
uint256 oldMinReturnAmount = desc.minReturnAmount;
|
|
191
125
|
desc.minReturnAmount = (desc.minReturnAmount * newAmount) / oldAmount;
|
|
192
126
|
//newMinReturnAmount should no be 0 if oldMinReturnAmount > 0
|
|
@@ -208,7 +142,7 @@ contract AggregationRouterHelper is
|
|
|
208
142
|
return desc;
|
|
209
143
|
}
|
|
210
144
|
|
|
211
|
-
function
|
|
145
|
+
function _getNewSimpleSwapData(
|
|
212
146
|
bytes memory data,
|
|
213
147
|
uint256 oldAmount,
|
|
214
148
|
uint256 newAmount
|
|
@@ -229,91 +163,155 @@ contract AggregationRouterHelper is
|
|
|
229
163
|
return abi.encode(swapData);
|
|
230
164
|
}
|
|
231
165
|
|
|
232
|
-
function
|
|
166
|
+
function _getNewExecutorData(
|
|
233
167
|
bytes memory data,
|
|
234
168
|
uint256 oldAmount,
|
|
235
169
|
uint256 newAmount
|
|
236
170
|
) internal pure returns (bytes memory) {
|
|
237
|
-
SwapExecutorDescription memory
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
171
|
+
SwapExecutorDescription memory swapExecutorDescription = abi.decode(
|
|
172
|
+
data,
|
|
173
|
+
(SwapExecutorDescription)
|
|
174
|
+
);
|
|
175
|
+
swapExecutorDescription.minTotalAmountOut =
|
|
176
|
+
(swapExecutorDescription.minTotalAmountOut * newAmount) /
|
|
177
|
+
oldAmount;
|
|
242
178
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
swap.data =
|
|
253
|
-
} else if (
|
|
254
|
-
swap.data =
|
|
255
|
-
} else if (
|
|
256
|
-
swap.data =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
);
|
|
261
|
-
} else if (
|
|
262
|
-
|
|
263
|
-
} else if (
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
);
|
|
269
|
-
} else
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
swap.data,
|
|
274
|
-
oldAmount,
|
|
275
|
-
newAmount
|
|
276
|
-
);
|
|
277
|
-
} else if (selector == IExecutorHelperEthereum1.executeSynthetixSwap.selector) {
|
|
278
|
-
swap.data = ScaleDataHelperEthereum1.newSynthetix(swap.data, oldAmount, newAmount);
|
|
279
|
-
} else if (selector == IExecutorHelperEthereum1.executePSMSwap.selector) {
|
|
280
|
-
swap.data = ScaleDataHelperEthereum1.newPSM(swap.data, oldAmount, newAmount);
|
|
281
|
-
} else if (selector == IExecutorHelperEthereum1.executeHashflowSwap.selector) {
|
|
282
|
-
revert("InputScalingHelper: Can not scale RFQ swap");
|
|
283
|
-
} else if (selector == IExecutorHelperEthereum1.executeFraxSwap.selector) {
|
|
284
|
-
swap.data = ScaleDataHelperEthereum1.newFrax(swap.data, oldAmount, newAmount);
|
|
285
|
-
} else revert("AggregationExecutor: Dex type not supported");
|
|
179
|
+
uint256 newTotalSwapAmount;
|
|
180
|
+
for (uint256 i = 0; i < swapExecutorDescription.swapSequences.length; i++) {
|
|
181
|
+
IMultihopRouter.Swap memory swap = swapExecutorDescription.swapSequences[i][0];
|
|
182
|
+
uint8 dexType = uint8(swap.dexOption >> 8);
|
|
183
|
+
uint256 value;
|
|
184
|
+
if (i == swapExecutorDescription.swapSequences.length - 1)
|
|
185
|
+
value = newAmount - newTotalSwapAmount;
|
|
186
|
+
|
|
187
|
+
if (dexType == uint8(DexType.UNI)) {
|
|
188
|
+
(swap.data, value) = _newUniSwap(swap.data, value, oldAmount, newAmount);
|
|
189
|
+
} else if (dexType == uint8(DexType.STABLESWAP) || dexType == uint8(DexType.SADDLE)) {
|
|
190
|
+
(swap.data, value) = _newStableSwap(swap.data, value, oldAmount, newAmount);
|
|
191
|
+
} else if (dexType == uint8(DexType.CURVE)) {
|
|
192
|
+
(swap.data, value) = _newCurveSwap(swap.data, value, oldAmount, newAmount);
|
|
193
|
+
} else if (dexType == uint8(DexType.KYBERDMM)) {
|
|
194
|
+
(swap.data, value) = _newKyberDMMSwap(swap.data, value, oldAmount, newAmount);
|
|
195
|
+
} else if (dexType == uint8(DexType.UNIV3PROMM)) {
|
|
196
|
+
(swap.data, value) = _newUniV3ProMMSwap(swap.data, value, oldAmount, newAmount);
|
|
197
|
+
} else if (dexType == uint8(DexType.BALANCERV2)) {
|
|
198
|
+
(swap.data, value) = _newBalancerV2Swap(swap.data, value, oldAmount, newAmount);
|
|
199
|
+
} else if (dexType == uint8(DexType.KYBERRFQ)) {
|
|
200
|
+
revert("kyber: can't scale kyberrfq");
|
|
201
|
+
} else if (dexType == uint8(DexType.DODO)) {
|
|
202
|
+
(swap.data, value) = _newDODOSwap(swap.data, value, oldAmount, newAmount);
|
|
203
|
+
} else if (dexType == uint8(DexType.VELODROME)) {
|
|
204
|
+
(swap.data, value) = _newVelodromeSwap(swap.data, value, oldAmount, newAmount);
|
|
205
|
+
} else {
|
|
206
|
+
revert("AggregationExecutor: Dex type not supported");
|
|
207
|
+
}
|
|
208
|
+
newTotalSwapAmount += value;
|
|
286
209
|
}
|
|
287
|
-
return abi.encode(
|
|
210
|
+
return abi.encode(swapExecutorDescription);
|
|
288
211
|
}
|
|
289
212
|
|
|
290
|
-
function
|
|
291
|
-
|
|
213
|
+
function _newUniSwap(
|
|
214
|
+
bytes memory data,
|
|
215
|
+
uint256 value,
|
|
292
216
|
uint256 oldAmount,
|
|
293
217
|
uint256 newAmount
|
|
294
|
-
) internal pure returns (
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
if (desc.srcReceivers.length == 0) {
|
|
301
|
-
return desc;
|
|
302
|
-
}
|
|
218
|
+
) internal pure returns (bytes memory, uint256) {
|
|
219
|
+
IMultihopRouter.UniSwap memory uniSwap = abi.decode(data, (IMultihopRouter.UniSwap));
|
|
220
|
+
if (value > 0) uniSwap.collectAmount = value;
|
|
221
|
+
else uniSwap.collectAmount = (uniSwap.collectAmount * newAmount) / oldAmount;
|
|
222
|
+
return (abi.encode(uniSwap), uniSwap.collectAmount);
|
|
223
|
+
}
|
|
303
224
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
225
|
+
function _newStableSwap(
|
|
226
|
+
bytes memory data,
|
|
227
|
+
uint256 value,
|
|
228
|
+
uint256 oldAmount,
|
|
229
|
+
uint256 newAmount
|
|
230
|
+
) internal pure returns (bytes memory, uint256) {
|
|
231
|
+
IMultihopRouter.StableSwap memory stableSwap = abi.decode(
|
|
232
|
+
data,
|
|
233
|
+
(IMultihopRouter.StableSwap)
|
|
234
|
+
);
|
|
235
|
+
if (value > 0) stableSwap.dx = value;
|
|
236
|
+
else stableSwap.dx = (stableSwap.dx * newAmount) / oldAmount;
|
|
237
|
+
return (abi.encode(stableSwap), stableSwap.dx);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function _newCurveSwap(
|
|
241
|
+
bytes memory data,
|
|
242
|
+
uint256 value,
|
|
243
|
+
uint256 oldAmount,
|
|
244
|
+
uint256 newAmount
|
|
245
|
+
) internal pure returns (bytes memory, uint256) {
|
|
246
|
+
IMultihopRouter.CurveSwap memory curveSwap = abi.decode(data, (IMultihopRouter.CurveSwap));
|
|
247
|
+
if (value > 0) curveSwap.dx = value;
|
|
248
|
+
else curveSwap.dx = (curveSwap.dx * newAmount) / oldAmount;
|
|
249
|
+
return (abi.encode(curveSwap), curveSwap.dx);
|
|
314
250
|
}
|
|
315
251
|
|
|
316
|
-
function
|
|
317
|
-
|
|
252
|
+
function _newKyberDMMSwap(
|
|
253
|
+
bytes memory data,
|
|
254
|
+
uint256 value,
|
|
255
|
+
uint256 oldAmount,
|
|
256
|
+
uint256 newAmount
|
|
257
|
+
) internal pure returns (bytes memory, uint256) {
|
|
258
|
+
IMultihopRouter.UniSwap memory kyberDMMSwap = abi.decode(data, (IMultihopRouter.UniSwap));
|
|
259
|
+
if (value > 0) kyberDMMSwap.collectAmount = value;
|
|
260
|
+
else kyberDMMSwap.collectAmount = (kyberDMMSwap.collectAmount * newAmount) / oldAmount;
|
|
261
|
+
return (abi.encode(kyberDMMSwap), kyberDMMSwap.collectAmount);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function _newUniV3ProMMSwap(
|
|
265
|
+
bytes memory data,
|
|
266
|
+
uint256 value,
|
|
267
|
+
uint256 oldAmount,
|
|
268
|
+
uint256 newAmount
|
|
269
|
+
) internal pure returns (bytes memory, uint256) {
|
|
270
|
+
IMultihopRouter.UniSwapV3ProMM memory uniSwapV3ProMM = abi.decode(
|
|
271
|
+
data,
|
|
272
|
+
(IMultihopRouter.UniSwapV3ProMM)
|
|
273
|
+
);
|
|
274
|
+
if (value > 0) uniSwapV3ProMM.swapAmount = value;
|
|
275
|
+
else uniSwapV3ProMM.swapAmount = (uniSwapV3ProMM.swapAmount * newAmount) / oldAmount;
|
|
276
|
+
return (abi.encode(uniSwapV3ProMM), uniSwapV3ProMM.swapAmount);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function _newBalancerV2Swap(
|
|
280
|
+
bytes memory data,
|
|
281
|
+
uint256 value,
|
|
282
|
+
uint256 oldAmount,
|
|
283
|
+
uint256 newAmount
|
|
284
|
+
) internal pure returns (bytes memory, uint256) {
|
|
285
|
+
IMultihopRouter.BalancerV2 memory balancerV2 = abi.decode(
|
|
286
|
+
data,
|
|
287
|
+
(IMultihopRouter.BalancerV2)
|
|
288
|
+
);
|
|
289
|
+
if (value > 0) balancerV2.amount = value;
|
|
290
|
+
else balancerV2.amount = (balancerV2.amount * newAmount) / oldAmount;
|
|
291
|
+
return (abi.encode(balancerV2, balancerV2.amount), balancerV2.amount);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function _newDODOSwap(
|
|
295
|
+
bytes memory data,
|
|
296
|
+
uint256 value,
|
|
297
|
+
uint256 oldAmount,
|
|
298
|
+
uint256 newAmount
|
|
299
|
+
) internal pure returns (bytes memory, uint256) {
|
|
300
|
+
IMultihopRouter.DODO memory dodo = abi.decode(data, (IMultihopRouter.DODO));
|
|
301
|
+
if (value > 0) dodo.amount = value;
|
|
302
|
+
else dodo.amount = (dodo.amount * newAmount) / oldAmount;
|
|
303
|
+
return (abi.encode(dodo), dodo.amount);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function _newVelodromeSwap(
|
|
307
|
+
bytes memory data,
|
|
308
|
+
uint256 value,
|
|
309
|
+
uint256 oldAmount,
|
|
310
|
+
uint256 newAmount
|
|
311
|
+
) internal pure returns (bytes memory, uint256) {
|
|
312
|
+
IMultihopRouter.UniSwap memory velodrome = abi.decode(data, (IMultihopRouter.UniSwap));
|
|
313
|
+
if (value > 0) velodrome.collectAmount = value;
|
|
314
|
+
else velodrome.collectAmount = (velodrome.collectAmount * newAmount) / oldAmount;
|
|
315
|
+
return (abi.encode(velodrome), velodrome.collectAmount);
|
|
318
316
|
}
|
|
319
317
|
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.7.6;
|
|
4
|
+
|
|
5
|
+
pragma abicoder v2;
|
|
6
|
+
|
|
7
|
+
interface IMultihopRouter {
|
|
8
|
+
enum DexType {
|
|
9
|
+
UNI,
|
|
10
|
+
STABLESWAP,
|
|
11
|
+
CURVE,
|
|
12
|
+
KYBERDMM,
|
|
13
|
+
SADDLE,
|
|
14
|
+
UNIV3PROMM,
|
|
15
|
+
BALANCERV2,
|
|
16
|
+
KYBERRFQ,
|
|
17
|
+
DODO,
|
|
18
|
+
VELODROME,
|
|
19
|
+
PLATYPUS
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
event Exchange(address pair, uint256 amountOut, address output);
|
|
23
|
+
struct Swap {
|
|
24
|
+
bytes data;
|
|
25
|
+
//dexType:
|
|
26
|
+
// 0: uni
|
|
27
|
+
// 1: stable swap
|
|
28
|
+
// 2: curve
|
|
29
|
+
// 3: kyber dmm
|
|
30
|
+
// 4: saddle
|
|
31
|
+
// 5: univ3 or kyber ProMM
|
|
32
|
+
// 6: balancerv2
|
|
33
|
+
// 7: kyber RFQ
|
|
34
|
+
// 8: dodo
|
|
35
|
+
// 9: velodrome
|
|
36
|
+
// 10: platypus
|
|
37
|
+
//dexId:
|
|
38
|
+
// 0: firebird
|
|
39
|
+
uint16 dexOption; //dexType(8bit) + dexId(8bit)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
struct UniSwap {
|
|
43
|
+
address pool;
|
|
44
|
+
address tokenIn;
|
|
45
|
+
address tokenOut;
|
|
46
|
+
address recipient;
|
|
47
|
+
uint256 collectAmount; // amount that should be transferred to the pool
|
|
48
|
+
uint256 limitReturnAmount;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
struct StableSwap {
|
|
52
|
+
address pool;
|
|
53
|
+
address tokenFrom;
|
|
54
|
+
address tokenTo;
|
|
55
|
+
uint8 tokenIndexFrom;
|
|
56
|
+
uint8 tokenIndexTo;
|
|
57
|
+
uint256 dx;
|
|
58
|
+
uint256 minDy;
|
|
59
|
+
uint256 poolLength;
|
|
60
|
+
address poolLp;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
struct CurveSwap {
|
|
64
|
+
address pool;
|
|
65
|
+
address tokenFrom;
|
|
66
|
+
address tokenTo;
|
|
67
|
+
int128 tokenIndexFrom;
|
|
68
|
+
int128 tokenIndexTo;
|
|
69
|
+
uint256 dx;
|
|
70
|
+
uint256 minDy;
|
|
71
|
+
bool usePoolUnderlying;
|
|
72
|
+
bool useTriCrypto;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
struct UniSwapV3ProMM {
|
|
76
|
+
address recipient;
|
|
77
|
+
address pool;
|
|
78
|
+
address tokenIn;
|
|
79
|
+
address tokenOut;
|
|
80
|
+
uint256 swapAmount;
|
|
81
|
+
uint256 limitReturnAmount;
|
|
82
|
+
uint160 sqrtPriceLimitX96;
|
|
83
|
+
bool isUniV3; // true = UniV3, false = ProMM
|
|
84
|
+
}
|
|
85
|
+
struct SwapCallbackData {
|
|
86
|
+
bytes path;
|
|
87
|
+
address payer;
|
|
88
|
+
}
|
|
89
|
+
struct SwapCallbackDataPath {
|
|
90
|
+
address pool;
|
|
91
|
+
address tokenIn;
|
|
92
|
+
address tokenOut;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
struct BalancerV2 {
|
|
96
|
+
address vault;
|
|
97
|
+
bytes32 poolId;
|
|
98
|
+
address assetIn;
|
|
99
|
+
address assetOut;
|
|
100
|
+
uint256 amount;
|
|
101
|
+
uint256 limit;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
struct KyberRFQ {
|
|
105
|
+
address rfq;
|
|
106
|
+
bytes order;
|
|
107
|
+
bytes signature;
|
|
108
|
+
uint256 amount;
|
|
109
|
+
address payable target;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
struct DODO {
|
|
113
|
+
address recipient;
|
|
114
|
+
address pool;
|
|
115
|
+
address tokenFrom;
|
|
116
|
+
address tokenTo;
|
|
117
|
+
uint256 amount;
|
|
118
|
+
uint256 minReceiveQuote;
|
|
119
|
+
address sellHelper;
|
|
120
|
+
bool isSellBase;
|
|
121
|
+
bool isVersion2;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function factory() external view returns (address);
|
|
125
|
+
|
|
126
|
+
function formula() external view returns (address);
|
|
127
|
+
|
|
128
|
+
function WETH() external view returns (address);
|
|
129
|
+
|
|
130
|
+
function multihopBatchSwapExactIn(
|
|
131
|
+
Swap[][] memory swapSequences,
|
|
132
|
+
address tokenIn,
|
|
133
|
+
address tokenOut,
|
|
134
|
+
uint256 minTotalAmountOut,
|
|
135
|
+
address to,
|
|
136
|
+
uint256 deadline,
|
|
137
|
+
bytes memory destTokenFeeData
|
|
138
|
+
) external payable returns (uint256 totalAmountOut);
|
|
139
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deployer": "0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7",
|
|
3
|
+
"network": {
|
|
4
|
+
"chainId": 1,
|
|
5
|
+
"treasury": "0x8270400d528c34e1596EF367eeDEc99080A1b592",
|
|
6
|
+
"governance": "0x8119EC16F0573B7dAc7C0CB94EB504FB32456ee1",
|
|
7
|
+
"pendle": "0x808507121b80c02388fad14726482e061b8da827",
|
|
8
|
+
"lzEndpoint": "0x66A71Dcef29A0fFBDBE3c6a460a3B5BC225Cd675",
|
|
9
|
+
"wrappedNative": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
10
|
+
"initialRewardFee": "30000000000000000",
|
|
11
|
+
"initialInterestFee": "30000000000000000",
|
|
12
|
+
"initialFeeRateRoot": "999500333083533",
|
|
13
|
+
"initialReserveFeePercent": "80",
|
|
14
|
+
"initialPendlePerSec": "826719576719576719",
|
|
15
|
+
"safeWaitTime": 15000
|
|
16
|
+
},
|
|
17
|
+
"baseCodeSplitter": "0x35878C2Cff38cC4032E85283183428170BA618A2",
|
|
18
|
+
"PENDLE": "0x808507121b80c02388fad14726482e061b8da827",
|
|
19
|
+
"yieldContractFactory": "0x70ee0A6DB4F5a2Dc4d9c0b57bE97B9987e75BAFD",
|
|
20
|
+
"marketFactory": "0x27b1dAcd74688aF24a64BD3C9C1B143118740784",
|
|
21
|
+
"bulkSellerFactory": "0x4B1da107B50529d53e5C906a79eaEcDCbC0E1dE3",
|
|
22
|
+
"bulkSellerOffchain": "0x9ACc60F915dFcd190D270fc92567aE71776bd320",
|
|
23
|
+
"router": "0x41FAD93F225b5C1C95f2445A5d7fcB85bA46713f",
|
|
24
|
+
"routerStatic": "0xcF45b92cd0B0859FC42a767fAac2354909f937e9",
|
|
25
|
+
"vePendle": "0x4f30A9D41B80ecC5B94306AB4364951AE3170210",
|
|
26
|
+
"senderEndpoint": "0x07b1014c88f14C9E910092526db57A20052E989F",
|
|
27
|
+
"votingController": "0x44087E105137a5095c008AaB6a6530182821F2F0",
|
|
28
|
+
"gaugeController": "0x47D74516B33eD5D70ddE7119A40839f6Fcc24e57"
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY FRAXUSDC_CurveLP Convex",
|
|
3
|
+
"SY": "0xD393D1dDd6B8811A86D925F5E14014282581bC04",
|
|
4
|
+
"YT": "0xC5Cd692e9b4622ab8Cdb57C83A0f99f874A169Cd",
|
|
5
|
+
"PT": "0x5fe30Ac5cb1aBB0e44CdffB2916c254AEb368650",
|
|
6
|
+
"market": "0x7b246B8dBC2a640BF2D8221890cEe8327fC23917",
|
|
7
|
+
"expiry": 1680134400,
|
|
8
|
+
"bulkSeller": "0xBb05ce1299467a2C4c43090c162f170892C30b7A",
|
|
9
|
+
"scalarRoot": "27800000000000000000",
|
|
10
|
+
"initAnchor": "1010699999000000000"
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY LOOKS Staking",
|
|
3
|
+
"SY": "0x35C16314D6Ee4753289E5cC15A5C5E1Dd4eaD345",
|
|
4
|
+
"YT": "0xC20dc81e8844F8fF154A67003849cEA8e951dEdc",
|
|
5
|
+
"PT": "0x293811f161fBFea8f417e222B226BB821548Ba63",
|
|
6
|
+
"market": "0x44474D98d1484C26E8d296a43a721998731Cf775",
|
|
7
|
+
"expiry": 1680134400,
|
|
8
|
+
"scalarRoot": "2200000000000000000",
|
|
9
|
+
"initAnchor": "1151500000000000000"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY stETH",
|
|
3
|
+
"SY": "0xcbC72d92b2dc8187414F6734718563898740C0BC",
|
|
4
|
+
"YT": "0x0D459a3287Afec25c0580691e9944d65fEaBb155",
|
|
5
|
+
"PT": "0xb3b61D1587C05eADEC579b616c45939F19435703",
|
|
6
|
+
"market": "0x9eC4c502D989F04FfA9312C9D6E3F872EC91A0F9",
|
|
7
|
+
"expiry": 1687996800,
|
|
8
|
+
"scalarRoot": "21900000000000000000",
|
|
9
|
+
"initAnchor": "1035400000000000000"
|
|
10
|
+
}
|