@pendle/core-v2 0.8.1-beta → 0.9.0-gamma-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.json +833 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.json +723 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.json +723 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json +20 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultScy.sol/PendleYearnVaultSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultScy.sol/PendleYearnVaultSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.json +784 -0
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.json +2 -2
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
- package/build/artifacts/contracts/core/LiquidityMining/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +47 -28
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +66 -4
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +26 -2
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.json +24 -0
- 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/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -77
- 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 +21 -96
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionCore.sol/ActionCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCore.sol/ActionCore.json +272 -136
- package/build/artifacts/contracts/core/actions/ActionYT.sol/ActionYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionYT.sol/ActionYT.json +75 -41
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPTBase.sol/ActionSCYAndPTBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPTBase.sol/ActionSCYAndPTBase.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPYBase.sol/ActionSCYAndPYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPYBase.sol/ActionSCYAndPYBase.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndYTBase.sol/ActionSCYAndYTBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndYTBase.sol/ActionSCYAndYTBase.json +1 -1
- package/build/artifacts/contracts/core/actions/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAavePool.sol/IAavePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAaveRewardsController.sol/IAaveRewardsController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IEulerEToken.sol/IEulerEToken.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IEulerEToken.sol/IEulerEToken.json +162 -0
- package/build/artifacts/contracts/interfaces/IEulerMarkets.sol/IEulerMarkets.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IEulerMarkets.sol/IEulerMarkets.json +87 -0
- package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.json +268 -132
- package/build/artifacts/contracts/interfaces/IPActionYT.sol/IPActionYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionYT.sol/IPActionYT.json +71 -37
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +339 -169
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGovernanceManager.sol/IPGovernanceManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPermissionsV2Upg.sol/IPermissionsV2Upg.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.json +23 -23
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.json +24 -0
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrow.sol/IPVotingEscrow.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +27 -27
- package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISAvax.sol/ISAvax.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ISAvax.sol/ISAvax.json +199 -0
- package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.json +168 -0
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.json +92 -0
- package/build/artifacts/contracts/interfaces/IStargateLPStaking.sol/IStargateLPStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargatePool.sol/IStargatePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.json +252 -0
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IYearnVault.sol/IYearnVault.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/SCY/SCYUtils.sol/SCYUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/{SCY/SCYIndex.sol/SCYIndexLib.json → helpers/PYIndex.sol/PYIndexLib.json} +4 -4
- package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/{traderjoe/PendleJoeSwapHelperUpg.sol/PendleJoeSwapHelperUpg.json → kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json} +3 -3
- package/build/artifacts/contracts/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxLib.json +2 -2
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/solmate/SSTORE2.sol/SSTORE2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +39 -39
- package/build/artifacts/contracts/periphery/PermissionsV2Upg.sol/PermissionsV2Upg.dbg.json +1 -1
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol +242 -0
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol +1 -1
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol +146 -0
- package/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol +170 -0
- package/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol +33 -6
- package/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol +182 -0
- package/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol +19 -10
- package/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +3 -1
- package/contracts/core/LiquidityMining/PendleGauge.sol +3 -2
- package/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +26 -8
- package/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +0 -4
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +30 -13
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol +2 -4
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol +5 -1
- package/contracts/core/Market/PendleMarket.sol +4 -5
- package/contracts/core/Market/PendleMarketFactory.sol +1 -1
- package/contracts/core/PendleRouter.sol +10 -10
- package/contracts/core/YieldContracts/InterestManagerYT.sol +0 -2
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +2 -2
- package/contracts/core/YieldContracts/PendleYieldToken.sol +24 -25
- package/contracts/core/actions/ActionCallback.sol +7 -7
- package/contracts/core/actions/ActionCore.sol +54 -81
- package/contracts/core/actions/ActionYT.sol +17 -37
- package/contracts/core/actions/base/ActionSCYAndPTBase.sol +21 -37
- package/contracts/core/actions/base/ActionSCYAndPYBase.sol +39 -51
- package/contracts/core/actions/base/ActionSCYAndYTBase.sol +14 -31
- package/contracts/interfaces/IEulerEToken.sol +60 -0
- package/contracts/interfaces/IEulerMarkets.sol +46 -0
- package/contracts/interfaces/IPActionCore.sol +43 -50
- package/contracts/interfaces/IPActionYT.sol +11 -12
- package/contracts/interfaces/IPInterestManagerYT.sol +1 -1
- package/contracts/interfaces/IPMarket.sol +1 -0
- package/contracts/interfaces/IPRouterStatic.sol +2 -7
- package/contracts/interfaces/IPVeToken.sol +2 -0
- package/contracts/interfaces/IPYieldToken.sol +2 -2
- package/contracts/interfaces/ISAvax.sol +61 -0
- package/contracts/interfaces/ISJoe.sol +60 -0
- package/contracts/interfaces/IStETH.sol +14 -0
- package/contracts/interfaces/IWAvax.sol +34 -0
- package/contracts/libraries/helpers/PYIndex.sol +69 -0
- package/contracts/libraries/helpers/TokenHelper.sol +8 -3
- package/contracts/libraries/kyberswap/KyberSwapHelper.sol +61 -0
- package/contracts/libraries/math/MarketApproxLib.sol +5 -5
- package/contracts/libraries/math/MarketMathCore.sol +10 -10
- package/contracts/offchain-helpers/RouterStatic.sol +21 -39
- package/deployments/43113-benqi.json +2 -2
- package/deployments/43113-core.json +7 -7
- package/deployments/43113-markets/benqi-market-599408.json +7 -0
- package/deployments/43113-markets/benqi-market-93bbf0.json +7 -0
- package/deployments/80001-benqi.json +2 -2
- package/deployments/80001-core.json +6 -6
- package/deployments/80001-markets/benqi-market-007811.json +7 -0
- package/deployments/80001-markets/benqi-market-3fe528.json +7 -0
- package/package.json +1 -1
- package/typechain-types/ActionCore.ts +330 -356
- package/typechain-types/ActionSCYAndPTBase.ts +11 -8
- package/typechain-types/ActionSCYAndPYBase.ts +11 -8
- package/typechain-types/ActionSCYAndYTBase.ts +11 -8
- package/typechain-types/ActionYT.ts +119 -106
- package/typechain-types/CelerSenderUpg.ts +16 -16
- package/typechain-types/IERC20Upgradeable.ts +300 -0
- package/typechain-types/IEulerEToken.ts +320 -0
- package/typechain-types/IEulerMarkets.ts +204 -0
- package/typechain-types/IPActionCore.ts +320 -349
- package/typechain-types/IPActionYT.ts +110 -100
- package/typechain-types/IPAllAction.ts +400 -447
- package/typechain-types/IPInterestManagerYT.ts +3 -3
- package/typechain-types/IPRouterStatic.ts +60 -118
- package/typechain-types/IPVeToken.ts +34 -0
- package/typechain-types/IPYieldToken.ts +47 -47
- package/typechain-types/ISAvax.ts +430 -0
- package/typechain-types/ISJoe.ts +340 -0
- package/typechain-types/IStETH.ts +201 -0
- package/typechain-types/IWAvax.ts +380 -0
- package/typechain-types/KyberSwapHelper.ts +87 -0
- package/typechain-types/PendleEulerSCY.ts +965 -0
- package/typechain-types/PendlePrincipalToken.ts +0 -104
- package/typechain-types/PendleQiSAvaxSCY.ts +1098 -0
- package/typechain-types/PendleSAvaxSCY.ts +962 -0
- package/typechain-types/PendleSJoeSCY.ts +1053 -0
- package/typechain-types/PendleVotingControllerUpg.ts +89 -55
- package/typechain-types/PendleWstEthSCY.ts +13 -0
- package/typechain-types/PendleYieldToken.ts +44 -148
- package/typechain-types/RouterStatic.ts +133 -299
- package/typechain-types/VotingEscrowPendleMainchain.ts +118 -16
- package/typechain-types/VotingEscrowPendleSidechain.ts +34 -0
- package/typechain-types/VotingEscrowTokenBase.ts +34 -0
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionCore__factory.ts +275 -139
- package/typechain-types/factories/ActionSCYAndPTBase__factory.ts +1 -1
- package/typechain-types/factories/ActionSCYAndPYBase__factory.ts +1 -1
- package/typechain-types/factories/ActionSCYAndYTBase__factory.ts +1 -1
- package/typechain-types/factories/ActionYT__factory.ts +78 -44
- package/typechain-types/factories/CelerSenderUpg__factory.ts +2 -2
- package/typechain-types/factories/IERC20Upgradeable__factory.ts +209 -0
- package/typechain-types/factories/IEulerEToken__factory.ts +174 -0
- package/typechain-types/factories/IEulerMarkets__factory.ts +99 -0
- package/typechain-types/factories/IPActionCore__factory.ts +268 -132
- package/typechain-types/factories/IPActionYT__factory.ts +71 -37
- package/typechain-types/factories/IPAllAction__factory.ts +339 -169
- package/typechain-types/factories/IPInterestManagerYT__factory.ts +1 -1
- package/typechain-types/factories/IPRouterStatic__factory.ts +23 -23
- package/typechain-types/factories/IPVeToken__factory.ts +24 -0
- package/typechain-types/factories/IPYieldToken__factory.ts +27 -27
- package/typechain-types/factories/ISAvax__factory.ts +208 -0
- package/typechain-types/factories/ISJoe__factory.ts +177 -0
- package/typechain-types/factories/IStETH__factory.ts +101 -0
- package/typechain-types/factories/IWAvax__factory.ts +261 -0
- package/typechain-types/factories/KyberSwapHelper__factory.ts +39 -0
- package/typechain-types/factories/PendleAaveV3SCY__factory.ts +1 -1
- package/typechain-types/factories/PendleERC4626SCY__factory.ts +1 -1
- package/typechain-types/factories/PendleEulerSCY__factory.ts +796 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__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/PendlePrincipalToken__factory.ts +1 -76
- package/typechain-types/factories/PendleQiSAvaxSCY__factory.ts +917 -0
- package/typechain-types/factories/PendleQiTokenSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleSAvaxSCY__factory.ts +796 -0
- package/typechain-types/factories/PendleSJoeSCY__factory.ts +845 -0
- package/typechain-types/factories/PendleStargateSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +45 -26
- package/typechain-types/factories/PendleWstEthSCY__factory.ts +29 -2
- package/typechain-types/factories/PendleYearnVaultScy__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +19 -94
- package/typechain-types/factories/RouterStatic__factory.ts +38 -38
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +65 -3
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +25 -1
- package/typechain-types/factories/VotingEscrowTokenBase__factory.ts +24 -0
- package/typechain-types/hardhat.d.ts +107 -17
- package/typechain-types/index.ts +24 -4
- package/build/artifacts/contracts/core/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +0 -4
- package/build/artifacts/contracts/core/PendleERC20Permit.sol/PendleERC20Permit.json +0 -329
- package/build/artifacts/contracts/interfaces/IJoePair.sol/IJoePair.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IJoePair.sol/IJoePair.json +0 -662
- package/build/artifacts/contracts/interfaces/IJoeRouter01.sol/IJoeRouter01.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IJoeRouter01.sol/IJoeRouter01.json +0 -760
- package/build/artifacts/contracts/interfaces/IJoeRouter02.sol/IJoeRouter02.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IJoeRouter02.sol/IJoeRouter02.json +0 -962
- package/build/artifacts/contracts/libraries/SCY/SCYIndex.sol/SCYIndexLib.dbg.json +0 -4
- package/build/artifacts/contracts/libraries/traderjoe/JoeLibrary.sol/JoeLibrary.dbg.json +0 -4
- package/build/artifacts/contracts/libraries/traderjoe/JoeLibrary.sol/JoeLibrary.json +0 -10
- package/build/artifacts/contracts/libraries/traderjoe/PendleJoeSwapHelperUpg.sol/PendleJoeSwapHelperUpg.dbg.json +0 -4
- package/contracts/core/PendleERC20Permit.sol +0 -84
- package/contracts/interfaces/IJoePair.sol +0 -98
- package/contracts/interfaces/IJoeRouter01.sol +0 -162
- package/contracts/interfaces/IJoeRouter02.sol +0 -52
- package/contracts/libraries/SCY/SCYIndex.sol +0 -72
- package/contracts/libraries/traderjoe/JoeLibrary.sol +0 -122
- package/contracts/libraries/traderjoe/PendleJoeSwapHelperUpg.sol +0 -80
- package/deployments/43113-markets/benqi-market-4Ccb97.json +0 -7
- package/deployments/43113-markets/benqi-market-534471.json +0 -7
- package/deployments/80001-markets/benqi-market-109acB.json +0 -7
- package/deployments/80001-markets/benqi-market-4e470E.json +0 -7
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "JoeLibrary",
|
|
4
|
-
"sourceName": "contracts/libraries/traderjoe/JoeLibrary.sol",
|
|
5
|
-
"abi": [],
|
|
6
|
-
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212200ed4635ed98a5f52e371c90837e748537a4e24b9881ebb8611a43228412bb80064736f6c634300080f0033",
|
|
7
|
-
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212200ed4635ed98a5f52e371c90837e748537a4e24b9881ebb8611a43228412bb80064736f6c634300080f0033",
|
|
8
|
-
"linkReferences": {},
|
|
9
|
-
"deployedLinkReferences": {}
|
|
10
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)
|
|
3
|
-
|
|
4
|
-
pragma solidity ^0.8.0;
|
|
5
|
-
|
|
6
|
-
import "./PendleERC20.sol";
|
|
7
|
-
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
8
|
-
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
9
|
-
import "@openzeppelin/contracts/utils/Context.sol";
|
|
10
|
-
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
|
|
11
|
-
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
|
|
12
|
-
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
13
|
-
import "@openzeppelin/contracts/utils/Counters.sol";
|
|
14
|
-
|
|
15
|
-
/// @dev forked from OZ's ERC20Permit
|
|
16
|
-
contract PendleERC20Permit is PendleERC20, IERC20Permit, EIP712 {
|
|
17
|
-
using Counters for Counters.Counter;
|
|
18
|
-
|
|
19
|
-
mapping(address => Counters.Counter) private _nonces;
|
|
20
|
-
|
|
21
|
-
// solhint-disable-next-line var-name-mixedcase
|
|
22
|
-
bytes32 private immutable _PERMIT_TYPEHASH =
|
|
23
|
-
keccak256(
|
|
24
|
-
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
constructor(
|
|
28
|
-
string memory name_,
|
|
29
|
-
string memory symbol_,
|
|
30
|
-
uint8 decimals_
|
|
31
|
-
) PendleERC20(name_, symbol_, decimals_) EIP712(name_, "1") {}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @dev See {IERC20Permit-permit}.
|
|
35
|
-
*/
|
|
36
|
-
function permit(
|
|
37
|
-
address owner,
|
|
38
|
-
address spender,
|
|
39
|
-
uint256 value,
|
|
40
|
-
uint256 deadline,
|
|
41
|
-
uint8 v,
|
|
42
|
-
bytes32 r,
|
|
43
|
-
bytes32 s
|
|
44
|
-
) public virtual override {
|
|
45
|
-
require(block.timestamp <= deadline, "ERC20Permit: expired deadline");
|
|
46
|
-
|
|
47
|
-
bytes32 structHash = keccak256(
|
|
48
|
-
abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
bytes32 hash = _hashTypedDataV4(structHash);
|
|
52
|
-
|
|
53
|
-
address signer = ECDSA.recover(hash, v, r, s);
|
|
54
|
-
require(signer == owner, "ERC20Permit: invalid signature");
|
|
55
|
-
|
|
56
|
-
_approve(owner, spender, value);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @dev See {IERC20Permit-nonces}.
|
|
61
|
-
*/
|
|
62
|
-
function nonces(address owner) public view virtual override returns (uint256) {
|
|
63
|
-
return _nonces[owner].current();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
|
|
68
|
-
*/
|
|
69
|
-
// solhint-disable-next-line func-name-mixedcase
|
|
70
|
-
function DOMAIN_SEPARATOR() external view override returns (bytes32) {
|
|
71
|
-
return _domainSeparatorV4();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* @dev "Consume a nonce": return the current value and increment.
|
|
76
|
-
*
|
|
77
|
-
* _Available since v4.1._
|
|
78
|
-
*/
|
|
79
|
-
function _useNonce(address owner) internal virtual returns (uint256 current) {
|
|
80
|
-
Counters.Counter storage nonce = _nonces[owner];
|
|
81
|
-
current = nonce.current();
|
|
82
|
-
nonce.increment();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
-
|
|
3
|
-
pragma solidity >=0.5.0;
|
|
4
|
-
|
|
5
|
-
interface IJoePair {
|
|
6
|
-
event Approval(address indexed owner, address indexed spender, uint256 value);
|
|
7
|
-
event Transfer(address indexed from, address indexed to, uint256 value);
|
|
8
|
-
|
|
9
|
-
function name() external pure returns (string memory);
|
|
10
|
-
|
|
11
|
-
function symbol() external pure returns (string memory);
|
|
12
|
-
|
|
13
|
-
function decimals() external pure returns (uint8);
|
|
14
|
-
|
|
15
|
-
function totalSupply() external view returns (uint256);
|
|
16
|
-
|
|
17
|
-
function balanceOf(address owner) external view returns (uint256);
|
|
18
|
-
|
|
19
|
-
function allowance(address owner, address spender) external view returns (uint256);
|
|
20
|
-
|
|
21
|
-
function approve(address spender, uint256 value) external returns (bool);
|
|
22
|
-
|
|
23
|
-
function transfer(address to, uint256 value) external returns (bool);
|
|
24
|
-
|
|
25
|
-
function transferFrom(
|
|
26
|
-
address from,
|
|
27
|
-
address to,
|
|
28
|
-
uint256 value
|
|
29
|
-
) external returns (bool);
|
|
30
|
-
|
|
31
|
-
function DOMAIN_SEPARATOR() external view returns (bytes32);
|
|
32
|
-
|
|
33
|
-
function PERMIT_TYPEHASH() external pure returns (bytes32);
|
|
34
|
-
|
|
35
|
-
function nonces(address owner) external view returns (uint256);
|
|
36
|
-
|
|
37
|
-
function permit(
|
|
38
|
-
address owner,
|
|
39
|
-
address spender,
|
|
40
|
-
uint256 value,
|
|
41
|
-
uint256 deadline,
|
|
42
|
-
uint8 v,
|
|
43
|
-
bytes32 r,
|
|
44
|
-
bytes32 s
|
|
45
|
-
) external;
|
|
46
|
-
|
|
47
|
-
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
|
|
48
|
-
event Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to);
|
|
49
|
-
event Swap(
|
|
50
|
-
address indexed sender,
|
|
51
|
-
uint256 amount0In,
|
|
52
|
-
uint256 amount1In,
|
|
53
|
-
uint256 amount0Out,
|
|
54
|
-
uint256 amount1Out,
|
|
55
|
-
address indexed to
|
|
56
|
-
);
|
|
57
|
-
event Sync(uint112 reserve0, uint112 reserve1);
|
|
58
|
-
|
|
59
|
-
function MINIMUM_LIQUIDITY() external pure returns (uint256);
|
|
60
|
-
|
|
61
|
-
function factory() external view returns (address);
|
|
62
|
-
|
|
63
|
-
function token0() external view returns (address);
|
|
64
|
-
|
|
65
|
-
function token1() external view returns (address);
|
|
66
|
-
|
|
67
|
-
function getReserves()
|
|
68
|
-
external
|
|
69
|
-
view
|
|
70
|
-
returns (
|
|
71
|
-
uint112 reserve0,
|
|
72
|
-
uint112 reserve1,
|
|
73
|
-
uint32 blockTimestampLast
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
function price0CumulativeLast() external view returns (uint256);
|
|
77
|
-
|
|
78
|
-
function price1CumulativeLast() external view returns (uint256);
|
|
79
|
-
|
|
80
|
-
function kLast() external view returns (uint256);
|
|
81
|
-
|
|
82
|
-
function mint(address to) external returns (uint256 liquidity);
|
|
83
|
-
|
|
84
|
-
function burn(address to) external returns (uint256 amount0, uint256 amount1);
|
|
85
|
-
|
|
86
|
-
function swap(
|
|
87
|
-
uint256 amount0Out,
|
|
88
|
-
uint256 amount1Out,
|
|
89
|
-
address to,
|
|
90
|
-
bytes calldata data
|
|
91
|
-
) external;
|
|
92
|
-
|
|
93
|
-
function skim(address to) external;
|
|
94
|
-
|
|
95
|
-
function sync() external;
|
|
96
|
-
|
|
97
|
-
function initialize(address, address) external;
|
|
98
|
-
}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
|
|
3
|
-
pragma solidity 0.8.15;
|
|
4
|
-
|
|
5
|
-
interface IJoeRouter01 {
|
|
6
|
-
function addLiquidity(
|
|
7
|
-
address tokenA,
|
|
8
|
-
address tokenB,
|
|
9
|
-
uint256 amountADesired,
|
|
10
|
-
uint256 amountBDesired,
|
|
11
|
-
uint256 amountAMin,
|
|
12
|
-
uint256 amountBMin,
|
|
13
|
-
address to,
|
|
14
|
-
uint256 deadline
|
|
15
|
-
)
|
|
16
|
-
external
|
|
17
|
-
returns (
|
|
18
|
-
uint256 amountA,
|
|
19
|
-
uint256 amountB,
|
|
20
|
-
uint256 liquidity
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
function addLiquidityAVAX(
|
|
24
|
-
address token,
|
|
25
|
-
uint256 amountTokenDesired,
|
|
26
|
-
uint256 amountTokenMin,
|
|
27
|
-
uint256 amountAVAXMin,
|
|
28
|
-
address to,
|
|
29
|
-
uint256 deadline
|
|
30
|
-
)
|
|
31
|
-
external
|
|
32
|
-
payable
|
|
33
|
-
returns (
|
|
34
|
-
uint256 amountToken,
|
|
35
|
-
uint256 amountAVAX,
|
|
36
|
-
uint256 liquidity
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
function removeLiquidity(
|
|
40
|
-
address tokenA,
|
|
41
|
-
address tokenB,
|
|
42
|
-
uint256 liquidity,
|
|
43
|
-
uint256 amountAMin,
|
|
44
|
-
uint256 amountBMin,
|
|
45
|
-
address to,
|
|
46
|
-
uint256 deadline
|
|
47
|
-
) external returns (uint256 amountA, uint256 amountB);
|
|
48
|
-
|
|
49
|
-
function removeLiquidityAVAX(
|
|
50
|
-
address token,
|
|
51
|
-
uint256 liquidity,
|
|
52
|
-
uint256 amountTokenMin,
|
|
53
|
-
uint256 amountAVAXMin,
|
|
54
|
-
address to,
|
|
55
|
-
uint256 deadline
|
|
56
|
-
) external returns (uint256 amountToken, uint256 amountAVAX);
|
|
57
|
-
|
|
58
|
-
function removeLiquidityWithPermit(
|
|
59
|
-
address tokenA,
|
|
60
|
-
address tokenB,
|
|
61
|
-
uint256 liquidity,
|
|
62
|
-
uint256 amountAMin,
|
|
63
|
-
uint256 amountBMin,
|
|
64
|
-
address to,
|
|
65
|
-
uint256 deadline,
|
|
66
|
-
bool approveMax,
|
|
67
|
-
uint8 v,
|
|
68
|
-
bytes32 r,
|
|
69
|
-
bytes32 s
|
|
70
|
-
) external returns (uint256 amountA, uint256 amountB);
|
|
71
|
-
|
|
72
|
-
function removeLiquidityAVAXWithPermit(
|
|
73
|
-
address token,
|
|
74
|
-
uint256 liquidity,
|
|
75
|
-
uint256 amountTokenMin,
|
|
76
|
-
uint256 amountAVAXMin,
|
|
77
|
-
address to,
|
|
78
|
-
uint256 deadline,
|
|
79
|
-
bool approveMax,
|
|
80
|
-
uint8 v,
|
|
81
|
-
bytes32 r,
|
|
82
|
-
bytes32 s
|
|
83
|
-
) external returns (uint256 amountToken, uint256 amountAVAX);
|
|
84
|
-
|
|
85
|
-
function swapExactTokensForTokens(
|
|
86
|
-
uint256 amountIn,
|
|
87
|
-
uint256 amountOutMin,
|
|
88
|
-
address[] calldata path,
|
|
89
|
-
address to,
|
|
90
|
-
uint256 deadline
|
|
91
|
-
) external returns (uint256[] memory amounts);
|
|
92
|
-
|
|
93
|
-
function swapTokensForExactTokens(
|
|
94
|
-
uint256 amountOut,
|
|
95
|
-
uint256 amountInMax,
|
|
96
|
-
address[] calldata path,
|
|
97
|
-
address to,
|
|
98
|
-
uint256 deadline
|
|
99
|
-
) external returns (uint256[] memory amounts);
|
|
100
|
-
|
|
101
|
-
function swapExactAVAXForTokens(
|
|
102
|
-
uint256 amountOutMin,
|
|
103
|
-
address[] calldata path,
|
|
104
|
-
address to,
|
|
105
|
-
uint256 deadline
|
|
106
|
-
) external payable returns (uint256[] memory amounts);
|
|
107
|
-
|
|
108
|
-
function swapTokensForExactAVAX(
|
|
109
|
-
uint256 amountOut,
|
|
110
|
-
uint256 amountInMax,
|
|
111
|
-
address[] calldata path,
|
|
112
|
-
address to,
|
|
113
|
-
uint256 deadline
|
|
114
|
-
) external returns (uint256[] memory amounts);
|
|
115
|
-
|
|
116
|
-
function swapExactTokensForAVAX(
|
|
117
|
-
uint256 amountIn,
|
|
118
|
-
uint256 amountOutMin,
|
|
119
|
-
address[] calldata path,
|
|
120
|
-
address to,
|
|
121
|
-
uint256 deadline
|
|
122
|
-
) external returns (uint256[] memory amounts);
|
|
123
|
-
|
|
124
|
-
function swapAVAXForExactTokens(
|
|
125
|
-
uint256 amountOut,
|
|
126
|
-
address[] calldata path,
|
|
127
|
-
address to,
|
|
128
|
-
uint256 deadline
|
|
129
|
-
) external payable returns (uint256[] memory amounts);
|
|
130
|
-
|
|
131
|
-
function getAmountsOut(uint256 amountIn, address[] calldata path)
|
|
132
|
-
external
|
|
133
|
-
view
|
|
134
|
-
returns (uint256[] memory amounts);
|
|
135
|
-
|
|
136
|
-
function getAmountsIn(uint256 amountOut, address[] calldata path)
|
|
137
|
-
external
|
|
138
|
-
view
|
|
139
|
-
returns (uint256[] memory amounts);
|
|
140
|
-
|
|
141
|
-
function quote(
|
|
142
|
-
uint256 amountA,
|
|
143
|
-
uint256 reserveA,
|
|
144
|
-
uint256 reserveB
|
|
145
|
-
) external pure returns (uint256 amountB);
|
|
146
|
-
|
|
147
|
-
function getAmountOut(
|
|
148
|
-
uint256 amountIn,
|
|
149
|
-
uint256 reserveIn,
|
|
150
|
-
uint256 reserveOut
|
|
151
|
-
) external pure returns (uint256 amountOut);
|
|
152
|
-
|
|
153
|
-
function getAmountIn(
|
|
154
|
-
uint256 amountOut,
|
|
155
|
-
uint256 reserveIn,
|
|
156
|
-
uint256 reserveOut
|
|
157
|
-
) external pure returns (uint256 amountIn);
|
|
158
|
-
|
|
159
|
-
function factory() external pure returns (address);
|
|
160
|
-
|
|
161
|
-
function WAVAX() external pure returns (address);
|
|
162
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
-
|
|
3
|
-
pragma solidity 0.8.15;
|
|
4
|
-
|
|
5
|
-
import "./IJoeRouter01.sol";
|
|
6
|
-
|
|
7
|
-
interface IJoeRouter02 is IJoeRouter01 {
|
|
8
|
-
function removeLiquidityAVAXSupportingFeeOnTransferTokens(
|
|
9
|
-
address token,
|
|
10
|
-
uint256 liquidity,
|
|
11
|
-
uint256 amountTokenMin,
|
|
12
|
-
uint256 amountAVAXMin,
|
|
13
|
-
address to,
|
|
14
|
-
uint256 deadline
|
|
15
|
-
) external returns (uint256 amountAVAX);
|
|
16
|
-
|
|
17
|
-
function removeLiquidityAVAXWithPermitSupportingFeeOnTransferTokens(
|
|
18
|
-
address token,
|
|
19
|
-
uint256 liquidity,
|
|
20
|
-
uint256 amountTokenMin,
|
|
21
|
-
uint256 amountAVAXMin,
|
|
22
|
-
address to,
|
|
23
|
-
uint256 deadline,
|
|
24
|
-
bool approveMax,
|
|
25
|
-
uint8 v,
|
|
26
|
-
bytes32 r,
|
|
27
|
-
bytes32 s
|
|
28
|
-
) external returns (uint256 amountAVAX);
|
|
29
|
-
|
|
30
|
-
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
|
|
31
|
-
uint256 amountIn,
|
|
32
|
-
uint256 amountOutMin,
|
|
33
|
-
address[] calldata path,
|
|
34
|
-
address to,
|
|
35
|
-
uint256 deadline
|
|
36
|
-
) external;
|
|
37
|
-
|
|
38
|
-
function swapExactAVAXForTokensSupportingFeeOnTransferTokens(
|
|
39
|
-
uint256 amountOutMin,
|
|
40
|
-
address[] calldata path,
|
|
41
|
-
address to,
|
|
42
|
-
uint256 deadline
|
|
43
|
-
) external payable;
|
|
44
|
-
|
|
45
|
-
function swapExactTokensForAVAXSupportingFeeOnTransferTokens(
|
|
46
|
-
uint256 amountIn,
|
|
47
|
-
uint256 amountOutMin,
|
|
48
|
-
address[] calldata path,
|
|
49
|
-
address to,
|
|
50
|
-
uint256 deadline
|
|
51
|
-
) external;
|
|
52
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.15;
|
|
3
|
-
import "../../interfaces/ISuperComposableYield.sol";
|
|
4
|
-
import "./SCYUtils.sol";
|
|
5
|
-
import "../math/Math.sol";
|
|
6
|
-
|
|
7
|
-
type SCYIndex is uint256;
|
|
8
|
-
|
|
9
|
-
library SCYIndexLib {
|
|
10
|
-
using Math for uint256;
|
|
11
|
-
using Math for int256;
|
|
12
|
-
|
|
13
|
-
function newIndex(ISuperComposableYield SCY) internal view returns (SCYIndex) {
|
|
14
|
-
return SCYIndex.wrap(SCY.exchangeRate());
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function newIndex(address SCY) internal view returns (SCYIndex) {
|
|
18
|
-
return SCYIndex.wrap(ISuperComposableYield(SCY).exchangeRate());
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function scyToAsset(SCYIndex index, uint256 scyAmount)
|
|
22
|
-
internal
|
|
23
|
-
pure
|
|
24
|
-
returns (uint256)
|
|
25
|
-
{
|
|
26
|
-
return SCYUtils.scyToAsset(SCYIndex.unwrap(index), scyAmount);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function assetToScy(SCYIndex index, uint256 assetAmount)
|
|
30
|
-
internal
|
|
31
|
-
pure
|
|
32
|
-
returns (uint256)
|
|
33
|
-
{
|
|
34
|
-
return SCYUtils.assetToScy(SCYIndex.unwrap(index), assetAmount);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function assetToScyUp(SCYIndex index, uint256 assetAmount)
|
|
38
|
-
internal
|
|
39
|
-
pure
|
|
40
|
-
returns (uint256)
|
|
41
|
-
{
|
|
42
|
-
return SCYUtils.assetToScyUp(SCYIndex.unwrap(index), assetAmount);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function scyToAssetUp(SCYIndex index, uint256 scyAmount)
|
|
46
|
-
internal
|
|
47
|
-
pure
|
|
48
|
-
returns (uint256)
|
|
49
|
-
{
|
|
50
|
-
uint256 _index = SCYIndex.unwrap(index);
|
|
51
|
-
return SCYUtils.scyToAssetUp(_index, scyAmount);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function scyToAsset(SCYIndex index, int256 scyAmount)
|
|
55
|
-
internal
|
|
56
|
-
pure
|
|
57
|
-
returns (int256)
|
|
58
|
-
{
|
|
59
|
-
int256 sign = scyAmount < 0 ? int256(-1) : int256(1);
|
|
60
|
-
return sign * (SCYUtils.scyToAsset(SCYIndex.unwrap(index), scyAmount.abs())).Int();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function assetToScy(SCYIndex index, int256 assetAmount)
|
|
64
|
-
internal
|
|
65
|
-
pure
|
|
66
|
-
returns (int256)
|
|
67
|
-
{
|
|
68
|
-
int256 sign = assetAmount < 0 ? int256(-1) : int256(1);
|
|
69
|
-
return sign * (SCYUtils.assetToScy(SCYIndex.unwrap(index), assetAmount.abs())).Int();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
-
|
|
3
|
-
pragma solidity 0.8.15;
|
|
4
|
-
|
|
5
|
-
import "../../interfaces/IJoePair.sol";
|
|
6
|
-
|
|
7
|
-
// almost-copied from TraderJoe
|
|
8
|
-
library JoeLibrary {
|
|
9
|
-
// returns sorted token addresses, used to handle return values from pairs sorted in this order
|
|
10
|
-
function sortTokens(address tokenA, address tokenB)
|
|
11
|
-
internal
|
|
12
|
-
pure
|
|
13
|
-
returns (address token0, address token1)
|
|
14
|
-
{
|
|
15
|
-
require(tokenA != tokenB, "JoeLibrary: IDENTICAL_ADDRESSES");
|
|
16
|
-
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
|
|
17
|
-
require(token0 != address(0), "JoeLibrary: ZERO_ADDRESS");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// calculates the CREATE2 address for a pair without making any external calls
|
|
21
|
-
function pairFor(
|
|
22
|
-
address factory,
|
|
23
|
-
address tokenA,
|
|
24
|
-
address tokenB
|
|
25
|
-
) internal pure returns (address pair) {
|
|
26
|
-
(address token0, address token1) = sortTokens(tokenA, tokenB);
|
|
27
|
-
pair = address(
|
|
28
|
-
uint160(
|
|
29
|
-
uint256(
|
|
30
|
-
keccak256(
|
|
31
|
-
abi.encodePacked(
|
|
32
|
-
hex"ff",
|
|
33
|
-
factory,
|
|
34
|
-
keccak256(abi.encodePacked(token0, token1)),
|
|
35
|
-
hex"0bbca9af0511ad1a1da383135cf3a8d2ac620e549ef9f6ae3a4c33c2fed0af91" // init code fuji
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
)
|
|
39
|
-
)
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// fetches and sorts the reserves for a pair
|
|
44
|
-
function getReserves(
|
|
45
|
-
address factory,
|
|
46
|
-
address tokenA,
|
|
47
|
-
address tokenB
|
|
48
|
-
) internal view returns (uint256 reserveA, uint256 reserveB) {
|
|
49
|
-
(address token0, ) = sortTokens(tokenA, tokenB);
|
|
50
|
-
(uint256 reserve0, uint256 reserve1, ) = IJoePair(pairFor(factory, tokenA, tokenB))
|
|
51
|
-
.getReserves();
|
|
52
|
-
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
|
|
56
|
-
function quote(
|
|
57
|
-
uint256 amountA,
|
|
58
|
-
uint256 reserveA,
|
|
59
|
-
uint256 reserveB
|
|
60
|
-
) internal pure returns (uint256 amountB) {
|
|
61
|
-
require(amountA > 0, "JoeLibrary: INSUFFICIENT_AMOUNT");
|
|
62
|
-
require(reserveA > 0 && reserveB > 0, "JoeLibrary: INSUFFICIENT_LIQUIDITY");
|
|
63
|
-
amountB = (amountA * reserveB) / reserveA;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
|
|
67
|
-
function getAmountOut(
|
|
68
|
-
uint256 amountIn,
|
|
69
|
-
uint256 reserveIn,
|
|
70
|
-
uint256 reserveOut
|
|
71
|
-
) internal pure returns (uint256 amountOut) {
|
|
72
|
-
require(amountIn > 0, "JoeLibrary: INSUFFICIENT_INPUT_AMOUNT");
|
|
73
|
-
require(reserveIn > 0 && reserveOut > 0, "JoeLibrary: INSUFFICIENT_LIQUIDITY");
|
|
74
|
-
uint256 amountInWithFee = amountIn * 997;
|
|
75
|
-
uint256 numerator = amountInWithFee * reserveOut;
|
|
76
|
-
uint256 denominator = reserveIn * 1000 + amountInWithFee;
|
|
77
|
-
amountOut = numerator / denominator;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
|
|
81
|
-
function getAmountIn(
|
|
82
|
-
uint256 amountOut,
|
|
83
|
-
uint256 reserveIn,
|
|
84
|
-
uint256 reserveOut
|
|
85
|
-
) internal pure returns (uint256 amountIn) {
|
|
86
|
-
require(amountOut > 0, "JoeLibrary: INSUFFICIENT_OUTPUT_AMOUNT");
|
|
87
|
-
require(reserveIn > 0 && reserveOut > 0, "JoeLibrary: INSUFFICIENT_LIQUIDITY");
|
|
88
|
-
uint256 numerator = reserveIn * amountOut * 1000;
|
|
89
|
-
uint256 denominator = (reserveOut - amountOut) * 997;
|
|
90
|
-
amountIn = (numerator / denominator) + 1;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// performs chained getAmountOut calculations on any number of pairs
|
|
94
|
-
function getAmountsOut(
|
|
95
|
-
address factory,
|
|
96
|
-
uint256 amountIn,
|
|
97
|
-
address[] memory path
|
|
98
|
-
) internal view returns (uint256[] memory amounts) {
|
|
99
|
-
require(path.length >= 2, "JoeLibrary: INVALID_PATH");
|
|
100
|
-
amounts = new uint256[](path.length);
|
|
101
|
-
amounts[0] = amountIn;
|
|
102
|
-
for (uint256 i = 0; i < path.length - 1; i++) {
|
|
103
|
-
(uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i], path[i + 1]);
|
|
104
|
-
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// performs chained getAmountIn calculations on any number of pairs
|
|
109
|
-
function getAmountsIn(
|
|
110
|
-
address factory,
|
|
111
|
-
uint256 amountOut,
|
|
112
|
-
address[] memory path
|
|
113
|
-
) internal view returns (uint256[] memory amounts) {
|
|
114
|
-
require(path.length >= 2, "JoeLibrary: INVALID_PATH");
|
|
115
|
-
amounts = new uint256[](path.length);
|
|
116
|
-
amounts[amounts.length - 1] = amountOut;
|
|
117
|
-
for (uint256 i = path.length - 1; i > 0; i--) {
|
|
118
|
-
(uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i - 1], path[i]);
|
|
119
|
-
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|