@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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.15;
|
|
3
3
|
|
|
4
4
|
import "../libraries/math/MarketApproxLib.sol";
|
|
5
|
+
import "../libraries/kyberswap/KyberSwapHelper.sol";
|
|
5
6
|
|
|
6
7
|
interface IPActionCore {
|
|
7
8
|
event AddLiquidity(
|
|
@@ -30,31 +31,31 @@ interface IPActionCore {
|
|
|
30
31
|
int256 amountScyToAccount
|
|
31
32
|
);
|
|
32
33
|
|
|
33
|
-
event
|
|
34
|
+
event SwapPtAndToken(
|
|
34
35
|
address indexed caller,
|
|
35
36
|
address indexed market,
|
|
36
|
-
address indexed
|
|
37
|
+
address indexed token,
|
|
37
38
|
address receiver,
|
|
38
39
|
int256 amountPtToAccount,
|
|
39
|
-
int256
|
|
40
|
+
int256 amountTokenToAccount
|
|
40
41
|
);
|
|
41
42
|
|
|
42
|
-
event
|
|
43
|
+
event MintScyFromToken(
|
|
43
44
|
address indexed caller,
|
|
44
45
|
address indexed receiver,
|
|
45
46
|
address indexed SCY,
|
|
46
|
-
address
|
|
47
|
-
uint256
|
|
47
|
+
address tokenIn,
|
|
48
|
+
uint256 netTokenIn,
|
|
48
49
|
uint256 netScyOut
|
|
49
50
|
);
|
|
50
51
|
|
|
51
|
-
event
|
|
52
|
+
event RedeemScyToToken(
|
|
52
53
|
address indexed caller,
|
|
53
54
|
address indexed receiver,
|
|
54
55
|
address indexed SCY,
|
|
55
56
|
uint256 netScyIn,
|
|
56
|
-
address
|
|
57
|
-
uint256
|
|
57
|
+
address tokenOut,
|
|
58
|
+
uint256 netTokenOut
|
|
58
59
|
);
|
|
59
60
|
|
|
60
61
|
event MintPyFromScy(
|
|
@@ -73,22 +74,22 @@ interface IPActionCore {
|
|
|
73
74
|
uint256 netScyOut
|
|
74
75
|
);
|
|
75
76
|
|
|
76
|
-
event
|
|
77
|
+
event MintPyFromToken(
|
|
77
78
|
address indexed caller,
|
|
78
79
|
address indexed receiver,
|
|
79
80
|
address indexed YT,
|
|
80
|
-
address
|
|
81
|
-
uint256
|
|
81
|
+
address tokenIn,
|
|
82
|
+
uint256 netTokenIn,
|
|
82
83
|
uint256 netPyOut
|
|
83
84
|
);
|
|
84
85
|
|
|
85
|
-
event
|
|
86
|
+
event RedeemPyToToken(
|
|
86
87
|
address indexed caller,
|
|
87
88
|
address indexed receiver,
|
|
88
89
|
address indexed YT,
|
|
89
90
|
uint256 netPyIn,
|
|
90
|
-
address
|
|
91
|
-
uint256
|
|
91
|
+
address tokenOut,
|
|
92
|
+
uint256 netTokenOut
|
|
92
93
|
);
|
|
93
94
|
|
|
94
95
|
function addLiquidity(
|
|
@@ -110,7 +111,7 @@ interface IPActionCore {
|
|
|
110
111
|
address market,
|
|
111
112
|
uint256 netPtIn,
|
|
112
113
|
uint256 minLpOut,
|
|
113
|
-
ApproxParams
|
|
114
|
+
ApproxParams calldata guessPtSwapToScy
|
|
114
115
|
) external returns (uint256 netLpOut);
|
|
115
116
|
|
|
116
117
|
function addLiquiditySingleScy(
|
|
@@ -118,16 +119,15 @@ interface IPActionCore {
|
|
|
118
119
|
address market,
|
|
119
120
|
uint256 netScyIn,
|
|
120
121
|
uint256 minLpOut,
|
|
121
|
-
ApproxParams
|
|
122
|
+
ApproxParams calldata guessPtReceivedFromScy
|
|
122
123
|
) external returns (uint256 netLpOut);
|
|
123
124
|
|
|
124
|
-
function
|
|
125
|
+
function addLiquiditySingleToken(
|
|
125
126
|
address receiver,
|
|
126
127
|
address market,
|
|
127
|
-
uint256 netRawTokenIn,
|
|
128
128
|
uint256 minLpOut,
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
ApproxParams calldata guessPtReceivedFromScy,
|
|
130
|
+
TokenInput calldata input
|
|
131
131
|
) external returns (uint256 netLpOut);
|
|
132
132
|
|
|
133
133
|
function removeLiquidity(
|
|
@@ -143,7 +143,7 @@ interface IPActionCore {
|
|
|
143
143
|
address market,
|
|
144
144
|
uint256 lpToRemove,
|
|
145
145
|
uint256 minPtOut,
|
|
146
|
-
ApproxParams
|
|
146
|
+
ApproxParams calldata guessPtOut
|
|
147
147
|
) external returns (uint256 netPtOut);
|
|
148
148
|
|
|
149
149
|
function removeLiquiditySingleScy(
|
|
@@ -153,13 +153,12 @@ interface IPActionCore {
|
|
|
153
153
|
uint256 minScyOut
|
|
154
154
|
) external returns (uint256 netScyOut);
|
|
155
155
|
|
|
156
|
-
function
|
|
156
|
+
function removeLiquiditySingleToken(
|
|
157
157
|
address receiver,
|
|
158
158
|
address market,
|
|
159
159
|
uint256 lpToRemove,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
) external returns (uint256 netRawTokenOut);
|
|
160
|
+
TokenOutput calldata output
|
|
161
|
+
) external returns (uint256 netTokenOut);
|
|
163
162
|
|
|
164
163
|
function swapExactPtForScy(
|
|
165
164
|
address receiver,
|
|
@@ -173,7 +172,7 @@ interface IPActionCore {
|
|
|
173
172
|
address market,
|
|
174
173
|
uint256 exactScyOut,
|
|
175
174
|
uint256 maxPtIn,
|
|
176
|
-
ApproxParams
|
|
175
|
+
ApproxParams calldata guessPtIn
|
|
177
176
|
) external returns (uint256 netPtIn);
|
|
178
177
|
|
|
179
178
|
function swapScyForExactPt(
|
|
@@ -188,40 +187,36 @@ interface IPActionCore {
|
|
|
188
187
|
address market,
|
|
189
188
|
uint256 exactScyIn,
|
|
190
189
|
uint256 minPtOut,
|
|
191
|
-
ApproxParams
|
|
190
|
+
ApproxParams calldata guessPtOut
|
|
192
191
|
) external returns (uint256 netPtOut);
|
|
193
192
|
|
|
194
|
-
function
|
|
193
|
+
function mintScyFromToken(
|
|
195
194
|
address receiver,
|
|
196
195
|
address SCY,
|
|
197
|
-
uint256 netRawTokenIn,
|
|
198
196
|
uint256 minScyOut,
|
|
199
|
-
|
|
197
|
+
TokenInput calldata input
|
|
200
198
|
) external returns (uint256 netScyOut);
|
|
201
199
|
|
|
202
|
-
function
|
|
200
|
+
function redeemScyToToken(
|
|
203
201
|
address receiver,
|
|
204
202
|
address SCY,
|
|
205
203
|
uint256 netScyIn,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
) external returns (uint256 netRawTokenOut);
|
|
204
|
+
TokenOutput calldata output
|
|
205
|
+
) external returns (uint256 netTokenOut);
|
|
209
206
|
|
|
210
|
-
function
|
|
207
|
+
function mintPyFromToken(
|
|
211
208
|
address receiver,
|
|
212
209
|
address YT,
|
|
213
|
-
uint256 netRawTokenIn,
|
|
214
210
|
uint256 minPyOut,
|
|
215
|
-
|
|
211
|
+
TokenInput calldata input
|
|
216
212
|
) external returns (uint256 netPyOut);
|
|
217
213
|
|
|
218
|
-
function
|
|
214
|
+
function redeemPyToToken(
|
|
219
215
|
address receiver,
|
|
220
216
|
address YT,
|
|
221
217
|
uint256 netPyIn,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
) external returns (uint256 netRawTokenOut);
|
|
218
|
+
TokenOutput calldata output
|
|
219
|
+
) external returns (uint256 netTokenOut);
|
|
225
220
|
|
|
226
221
|
function mintPyFromScy(
|
|
227
222
|
address receiver,
|
|
@@ -237,22 +232,20 @@ interface IPActionCore {
|
|
|
237
232
|
uint256 minScyOut
|
|
238
233
|
) external returns (uint256 netScyOut);
|
|
239
234
|
|
|
240
|
-
function
|
|
235
|
+
function swapExactTokenForPt(
|
|
241
236
|
address receiver,
|
|
242
237
|
address market,
|
|
243
|
-
uint256 exactRawTokenIn,
|
|
244
238
|
uint256 minPtOut,
|
|
245
|
-
|
|
246
|
-
|
|
239
|
+
ApproxParams calldata guessPtOut,
|
|
240
|
+
TokenInput calldata input
|
|
247
241
|
) external returns (uint256 netPtOut);
|
|
248
242
|
|
|
249
|
-
function
|
|
243
|
+
function swapExactPtForToken(
|
|
250
244
|
address receiver,
|
|
251
245
|
address market,
|
|
252
246
|
uint256 exactPtIn,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
) external returns (uint256 netRawTokenOut);
|
|
247
|
+
TokenOutput calldata output
|
|
248
|
+
) external returns (uint256 netTokenOut);
|
|
256
249
|
|
|
257
250
|
function redeemDueInterestAndRewards(
|
|
258
251
|
address user,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.15;
|
|
3
3
|
|
|
4
4
|
import "../libraries/math/MarketApproxLib.sol";
|
|
5
|
+
import "../libraries/kyberswap/KyberSwapHelper.sol";
|
|
5
6
|
|
|
6
7
|
interface IPActionYT {
|
|
7
8
|
event SwapYTAndSCY(
|
|
@@ -11,12 +12,12 @@ interface IPActionYT {
|
|
|
11
12
|
int256 scyToAccount
|
|
12
13
|
);
|
|
13
14
|
|
|
14
|
-
event
|
|
15
|
+
event SwapYTAndToken(
|
|
15
16
|
address indexed user,
|
|
16
17
|
address indexed market,
|
|
17
|
-
address indexed
|
|
18
|
+
address indexed token,
|
|
18
19
|
int256 ytToAccount,
|
|
19
|
-
int256
|
|
20
|
+
int256 tokenToAccount
|
|
20
21
|
);
|
|
21
22
|
|
|
22
23
|
function swapExactYtForScy(
|
|
@@ -49,20 +50,18 @@ interface IPActionYT {
|
|
|
49
50
|
ApproxParams memory guessYtIn
|
|
50
51
|
) external returns (uint256 netYtIn);
|
|
51
52
|
|
|
52
|
-
function
|
|
53
|
+
function swapExactTokenForYt(
|
|
53
54
|
address receiver,
|
|
54
55
|
address market,
|
|
55
|
-
uint256 exactRawTokenIn,
|
|
56
56
|
uint256 minYtOut,
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
ApproxParams memory guessYtOut,
|
|
58
|
+
TokenInput calldata input
|
|
59
59
|
) external returns (uint256 netYtOut);
|
|
60
60
|
|
|
61
|
-
function
|
|
61
|
+
function swapExactYtForToken(
|
|
62
62
|
address receiver,
|
|
63
63
|
address market,
|
|
64
|
-
uint256
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
) external returns (uint256 netRawTokenOut);
|
|
64
|
+
uint256 netYtIn,
|
|
65
|
+
TokenOutput calldata output
|
|
66
|
+
) external returns (uint256 netTokenOut);
|
|
68
67
|
}
|
|
@@ -4,6 +4,7 @@ pragma solidity 0.8.15;
|
|
|
4
4
|
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
5
5
|
import "./IPPrincipalToken.sol";
|
|
6
6
|
import "./IPYieldToken.sol";
|
|
7
|
+
import "./ISuperComposableYield.sol";
|
|
7
8
|
import "../libraries/math/MarketMathCore.sol";
|
|
8
9
|
|
|
9
10
|
interface IPMarket is IERC20Metadata {
|
|
@@ -59,7 +59,6 @@ interface IPRouterStatic {
|
|
|
59
59
|
|
|
60
60
|
function getMarketInfo(address market)
|
|
61
61
|
external
|
|
62
|
-
view
|
|
63
62
|
returns (
|
|
64
63
|
address pt,
|
|
65
64
|
address scy,
|
|
@@ -93,7 +92,6 @@ interface IPRouterStatic {
|
|
|
93
92
|
uint256 ptDesired
|
|
94
93
|
)
|
|
95
94
|
external
|
|
96
|
-
view
|
|
97
95
|
returns (
|
|
98
96
|
uint256 netLpOut,
|
|
99
97
|
uint256 scyUsed,
|
|
@@ -107,7 +105,6 @@ interface IPRouterStatic {
|
|
|
107
105
|
|
|
108
106
|
function swapExactPtForScyStatic(address market, uint256 exactPtIn)
|
|
109
107
|
external
|
|
110
|
-
view
|
|
111
108
|
returns (
|
|
112
109
|
uint256 netScyOut,
|
|
113
110
|
uint256 netScyFee,
|
|
@@ -116,7 +113,6 @@ interface IPRouterStatic {
|
|
|
116
113
|
|
|
117
114
|
function swapScyForExactPtStatic(address market, uint256 exactPtOut)
|
|
118
115
|
external
|
|
119
|
-
view
|
|
120
116
|
returns (
|
|
121
117
|
uint256 netScyIn,
|
|
122
118
|
uint256 netScyFee,
|
|
@@ -125,7 +121,6 @@ interface IPRouterStatic {
|
|
|
125
121
|
|
|
126
122
|
function swapExactScyForPtStatic(address market, uint256 exactScyIn)
|
|
127
123
|
external
|
|
128
|
-
view
|
|
129
124
|
returns (
|
|
130
125
|
uint256 netPtOut,
|
|
131
126
|
uint256 netScyFee,
|
|
@@ -134,11 +129,11 @@ interface IPRouterStatic {
|
|
|
134
129
|
|
|
135
130
|
// ============= OTHER HELPERS =============
|
|
136
131
|
|
|
137
|
-
function
|
|
132
|
+
function pyIndex(address market) external returns (PYIndex index);
|
|
138
133
|
|
|
139
134
|
function getPY(address py) external view returns (address pt, address yt);
|
|
140
135
|
|
|
141
|
-
function getPtImpliedYield(address market) external
|
|
136
|
+
function getPtImpliedYield(address market) external returns (int256);
|
|
142
137
|
|
|
143
138
|
function getUserPYInfo(address py, address user)
|
|
144
139
|
external
|
|
@@ -46,9 +46,9 @@ interface IPYieldToken is IERC20Metadata, IRewardManager, IPInterestManagerYT {
|
|
|
46
46
|
|
|
47
47
|
function rewardIndexesCurrent() external returns (uint256[] memory);
|
|
48
48
|
|
|
49
|
-
function
|
|
49
|
+
function pyIndexCurrent() external returns (uint256);
|
|
50
50
|
|
|
51
|
-
function
|
|
51
|
+
function pyIndexStored() external view returns (uint256);
|
|
52
52
|
|
|
53
53
|
function getRewardTokens() external view returns (address[] memory);
|
|
54
54
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.15;
|
|
3
|
+
|
|
4
|
+
interface ISAvax {
|
|
5
|
+
function decimals() external pure returns (uint8);
|
|
6
|
+
|
|
7
|
+
function balanceOf(address account) external view returns (uint256);
|
|
8
|
+
|
|
9
|
+
function totalPooledAvax() external returns (uint256);
|
|
10
|
+
|
|
11
|
+
function totalShares() external returns (uint256);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @return The amount of AVAX that corresponds to `shareAmount` sAVAX token shares.
|
|
15
|
+
*/
|
|
16
|
+
function getPooledAvaxByShares(uint256 shareAmount) external view returns (uint256);
|
|
17
|
+
|
|
18
|
+
function cooldownPeriod() external returns (uint256);
|
|
19
|
+
|
|
20
|
+
function redeemPeriod() external returns (uint256);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @notice Process user deposit, mints liquid tokens and increase the pool buffer -> Will be called when NATIVE AVAX is transferred to SAVAX (Dont need to call this function explicitly)
|
|
24
|
+
* @return Amount of sAVAX shares generated
|
|
25
|
+
*/
|
|
26
|
+
function submit() external payable returns (uint256);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @notice Redeem all redeemable AVAX from all unlocks
|
|
30
|
+
*/
|
|
31
|
+
function redeem() external;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @notice Redeem AVAX after cooldown has finished
|
|
35
|
+
* @param unlockIndex Index number of the redeemed unlock request
|
|
36
|
+
*/
|
|
37
|
+
function redeem(uint256 unlockIndex) external;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @notice Redeem all sAVAX held in custody for overdue unlock requests
|
|
41
|
+
*/
|
|
42
|
+
function redeemOverdueShares() external;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @notice Redeem sAVAX held in custody for the given unlock request
|
|
46
|
+
* @param unlockIndex Unlock request array index
|
|
47
|
+
*/
|
|
48
|
+
function redeemOverdueShares(uint256 unlockIndex) external;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @notice Start unlocking cooldown period for `shareAmount` AVAX
|
|
52
|
+
* @param shareAmount Amount of shares to unlock
|
|
53
|
+
*/
|
|
54
|
+
function requestUnlock(uint256 shareAmount) external;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @notice Get the number of active unlock requests by user
|
|
58
|
+
* @param user User address
|
|
59
|
+
*/
|
|
60
|
+
function getUnlockRequestCount(address user) external view returns (uint256);
|
|
61
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.15;
|
|
3
|
+
|
|
4
|
+
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
|
|
5
|
+
|
|
6
|
+
interface ISJoe {
|
|
7
|
+
function joe() external view returns (address);
|
|
8
|
+
|
|
9
|
+
function depositFeePercent() external view returns (uint256);
|
|
10
|
+
|
|
11
|
+
function internalJoeBalance() external view returns (uint256);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @notice Deposit JOE for reward token allocation
|
|
15
|
+
* @param _amount The amount of JOE to deposit
|
|
16
|
+
*/
|
|
17
|
+
function deposit(uint256 _amount) external;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @notice Get user info
|
|
21
|
+
* @param _user The address of the user
|
|
22
|
+
* @param _rewardToken The address of the reward token
|
|
23
|
+
* @return The amount of JOE user has deposited
|
|
24
|
+
* @return The reward debt for the chosen token
|
|
25
|
+
*/
|
|
26
|
+
function getUserInfo(address _user, IERC20Upgradeable _rewardToken)
|
|
27
|
+
external
|
|
28
|
+
view
|
|
29
|
+
returns (uint256, uint256);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @notice Get the number of reward tokens
|
|
33
|
+
* @return The length of the array
|
|
34
|
+
*/
|
|
35
|
+
function rewardTokensLength() external view returns (uint256);
|
|
36
|
+
|
|
37
|
+
function rewardTokens(uint256 _index) external view returns (address);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @notice View function to see pending reward token on frontend
|
|
41
|
+
* @param _user The address of the user
|
|
42
|
+
* @param _token The address of the token
|
|
43
|
+
* @return `_user`'s pending reward token
|
|
44
|
+
*/
|
|
45
|
+
function pendingReward(address _user, IERC20Upgradeable _token)
|
|
46
|
+
external
|
|
47
|
+
view
|
|
48
|
+
returns (uint256);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @notice Withdraw JOE and harvest the rewards
|
|
52
|
+
* @param _amount The amount of JOE to withdraw
|
|
53
|
+
*/
|
|
54
|
+
function withdraw(uint256 _amount) external;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @notice Withdraw without caring about rewards. EMERGENCY ONLY
|
|
58
|
+
*/
|
|
59
|
+
function emergencyWithdraw() external;
|
|
60
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.15;
|
|
3
|
+
|
|
4
|
+
interface IStETH {
|
|
5
|
+
function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);
|
|
6
|
+
|
|
7
|
+
function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);
|
|
8
|
+
|
|
9
|
+
function submit(address referral) external payable returns (uint256 amount);
|
|
10
|
+
|
|
11
|
+
function burnShares(address _account, uint256 _sharesAmount)
|
|
12
|
+
external
|
|
13
|
+
returns (uint256 newTotalShares);
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
/*
|
|
3
|
+
* MIT License
|
|
4
|
+
* ===========
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
*/
|
|
23
|
+
pragma solidity 0.8.15;
|
|
24
|
+
|
|
25
|
+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
26
|
+
|
|
27
|
+
interface IWAvax is IERC20 {
|
|
28
|
+
event Deposit(address indexed dst, uint256 wad);
|
|
29
|
+
event Withdrawal(address indexed src, uint256 wad);
|
|
30
|
+
|
|
31
|
+
function deposit() external payable;
|
|
32
|
+
|
|
33
|
+
function withdraw(uint256 wad) external;
|
|
34
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.15;
|
|
3
|
+
import "../../interfaces/IPYieldToken.sol";
|
|
4
|
+
import "../../interfaces/IPPrincipalToken.sol";
|
|
5
|
+
import "../SCY/SCYUtils.sol";
|
|
6
|
+
import "../math/Math.sol";
|
|
7
|
+
|
|
8
|
+
type PYIndex is uint256;
|
|
9
|
+
|
|
10
|
+
library PYIndexLib {
|
|
11
|
+
using Math for uint256;
|
|
12
|
+
using Math for int256;
|
|
13
|
+
|
|
14
|
+
function newIndex(IPYieldToken YT) internal returns (PYIndex) {
|
|
15
|
+
return PYIndex.wrap(YT.pyIndexCurrent());
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function scyToAsset(PYIndex index, uint256 scyAmount)
|
|
19
|
+
internal
|
|
20
|
+
pure
|
|
21
|
+
returns (uint256)
|
|
22
|
+
{
|
|
23
|
+
return SCYUtils.scyToAsset(PYIndex.unwrap(index), scyAmount);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function assetToScy(PYIndex index, uint256 assetAmount)
|
|
27
|
+
internal
|
|
28
|
+
pure
|
|
29
|
+
returns (uint256)
|
|
30
|
+
{
|
|
31
|
+
return SCYUtils.assetToScy(PYIndex.unwrap(index), assetAmount);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function assetToScyUp(PYIndex index, uint256 assetAmount)
|
|
35
|
+
internal
|
|
36
|
+
pure
|
|
37
|
+
returns (uint256)
|
|
38
|
+
{
|
|
39
|
+
return SCYUtils.assetToScyUp(PYIndex.unwrap(index), assetAmount);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function scyToAssetUp(PYIndex index, uint256 scyAmount)
|
|
43
|
+
internal
|
|
44
|
+
pure
|
|
45
|
+
returns (uint256)
|
|
46
|
+
{
|
|
47
|
+
uint256 _index = PYIndex.unwrap(index);
|
|
48
|
+
return SCYUtils.scyToAssetUp(_index, scyAmount);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function scyToAsset(PYIndex index, int256 scyAmount)
|
|
52
|
+
internal
|
|
53
|
+
pure
|
|
54
|
+
returns (int256)
|
|
55
|
+
{
|
|
56
|
+
int256 sign = scyAmount < 0 ? int256(-1) : int256(1);
|
|
57
|
+
return sign * (SCYUtils.scyToAsset(PYIndex.unwrap(index), scyAmount.abs())).Int();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function assetToScy(PYIndex index, int256 assetAmount)
|
|
61
|
+
internal
|
|
62
|
+
pure
|
|
63
|
+
returns (int256)
|
|
64
|
+
{
|
|
65
|
+
int256 sign = assetAmount < 0 ? int256(-1) : int256(1);
|
|
66
|
+
return sign * (SCYUtils.assetToScy(PYIndex.unwrap(index), assetAmount.abs())).Int();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -6,6 +6,7 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
|
6
6
|
abstract contract TokenHelper {
|
|
7
7
|
using SafeERC20 for IERC20;
|
|
8
8
|
address internal constant NATIVE = address(0);
|
|
9
|
+
uint256 internal constant LOWER_BOUND_APPROVAL = type(uint96).max / 2; // some tokens use 96 bits for approval
|
|
9
10
|
|
|
10
11
|
function _transferIn(
|
|
11
12
|
address token,
|
|
@@ -13,9 +14,7 @@ abstract contract TokenHelper {
|
|
|
13
14
|
uint256 amount
|
|
14
15
|
) internal {
|
|
15
16
|
if (token == NATIVE) require(msg.value == amount, "eth mismatch");
|
|
16
|
-
else if (amount != 0)
|
|
17
|
-
IERC20(token).safeTransferFrom(from, address(this), amount);
|
|
18
|
-
}
|
|
17
|
+
else if (amount != 0) IERC20(token).safeTransferFrom(from, address(this), amount);
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
function _transferOut(
|
|
@@ -105,4 +104,10 @@ abstract contract TokenHelper {
|
|
|
105
104
|
);
|
|
106
105
|
require(success && (data.length == 0 || abi.decode(data, (bool))), "Safe Approve");
|
|
107
106
|
}
|
|
107
|
+
|
|
108
|
+
function _safeApproveInf(address token, address to) internal {
|
|
109
|
+
if (token == NATIVE) return;
|
|
110
|
+
if (IERC20(token).allowance(address(this), to) < LOWER_BOUND_APPROVAL)
|
|
111
|
+
_safeApprove(token, to, type(uint256).max);
|
|
112
|
+
}
|
|
108
113
|
}
|