@pendle/core-v2 0.8.1-beta → 0.8.1-gamma
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/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/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +1 -1
- 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/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 +2 -2
- package/build/artifacts/contracts/core/actions/ActionYT.sol/ActionYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionYT.sol/ActionYT.json +2 -2
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPTBase.sol/ActionSCYAndPTBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPYBase.sol/ActionSCYAndPYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndYTBase.sol/ActionSCYAndYTBase.dbg.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/IJoePair.sol/IJoePair.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IJoeRouter01.sol/IJoeRouter01.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IJoeRouter02.sol/IJoeRouter02.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionYT.sol/IPActionYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- 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/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/libraries/traderjoe/JoeLibrary.sol/JoeLibrary.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/traderjoe/PendleJoeSwapHelperUpg.sol/PendleJoeSwapHelperUpg.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 +184 -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 +25 -7
- 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/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/base/ActionSCYAndPTBase.sol +10 -9
- package/contracts/core/actions/base/ActionSCYAndYTBase.sol +4 -4
- package/contracts/interfaces/IEulerEToken.sol +60 -0
- package/contracts/interfaces/IEulerMarkets.sol +46 -0
- 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/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/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/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/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 +1 -1
- package/typechain-types/factories/ActionYT__factory.ts +1 -1
- 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/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/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/PendleVotingControllerUpg__factory.ts +45 -26
- package/typechain-types/factories/PendleWstEthSCY__factory.ts +29 -2
- 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 +98 -17
- package/typechain-types/index.ts +22 -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/libraries/SCY/SCYIndex.sol/SCYIndexLib.dbg.json +0 -4
- package/contracts/core/PendleERC20Permit.sol +0 -84
- package/contracts/libraries/SCY/SCYIndex.sol +0 -72
- 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
|
@@ -13,7 +13,7 @@ import "../../interfaces/IPYieldContractFactory.sol";
|
|
|
13
13
|
import "../../libraries/SCY/SCYUtils.sol";
|
|
14
14
|
import "../../libraries/helpers/MiniHelpers.sol";
|
|
15
15
|
import "../../libraries/RewardManagerAbstract.sol";
|
|
16
|
-
import "../
|
|
16
|
+
import "../PendleERC20.sol";
|
|
17
17
|
import "./InterestManagerYT.sol";
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -21,18 +21,13 @@ Invariances to maintain:
|
|
|
21
21
|
- address(0) & address(this) should never have any rewards & activeBalance accounting done. This is
|
|
22
22
|
guaranteed by address(0) & address(this) check in each updateForTwo function
|
|
23
23
|
*/
|
|
24
|
-
contract PendleYieldToken is
|
|
25
|
-
IPYieldToken,
|
|
26
|
-
PendleERC20Permit,
|
|
27
|
-
RewardManagerAbstract,
|
|
28
|
-
InterestManagerYT
|
|
29
|
-
{
|
|
24
|
+
contract PendleYieldToken is IPYieldToken, PendleERC20, RewardManagerAbstract, InterestManagerYT {
|
|
30
25
|
using Math for uint256;
|
|
31
26
|
using SafeERC20 for IERC20;
|
|
32
27
|
using ArrayLib for uint256[];
|
|
33
28
|
|
|
34
29
|
struct PostExpiryData {
|
|
35
|
-
uint128
|
|
30
|
+
uint128 firstPYIndex;
|
|
36
31
|
uint128 totalScyInterestForTreasury;
|
|
37
32
|
mapping(address => uint256) firstRewardIndex;
|
|
38
33
|
mapping(address => uint256) userRewardOwed;
|
|
@@ -44,7 +39,7 @@ contract PendleYieldToken is
|
|
|
44
39
|
uint256 public immutable expiry;
|
|
45
40
|
|
|
46
41
|
uint128 public scyReserve;
|
|
47
|
-
uint128 internal
|
|
42
|
+
uint128 internal _pyIndexStored;
|
|
48
43
|
|
|
49
44
|
PostExpiryData public postExpiry;
|
|
50
45
|
|
|
@@ -61,7 +56,7 @@ contract PendleYieldToken is
|
|
|
61
56
|
string memory _symbol,
|
|
62
57
|
uint8 __decimals,
|
|
63
58
|
uint256 _expiry
|
|
64
|
-
)
|
|
59
|
+
) PendleERC20(_name, _symbol, __decimals) {
|
|
65
60
|
SCY = _SCY;
|
|
66
61
|
PT = _PT;
|
|
67
62
|
expiry = _expiry;
|
|
@@ -84,6 +79,8 @@ contract PendleYieldToken is
|
|
|
84
79
|
_mint(receiverYT, amountPYOut);
|
|
85
80
|
|
|
86
81
|
IPPrincipalToken(PT).mintByYT(receiverPT, amountPYOut);
|
|
82
|
+
|
|
83
|
+
emit Mint(msg.sender, receiverPT, receiverYT, amountScyToMint, amountPYOut);
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
/// @dev this function converts PY tokens into scy, but interests & rewards are not redeemed at the same time
|
|
@@ -183,14 +180,14 @@ contract PendleYieldToken is
|
|
|
183
180
|
}
|
|
184
181
|
|
|
185
182
|
/// @dev maximize the current rate with the previous rate to guarantee non-decreasing rate
|
|
186
|
-
function
|
|
187
|
-
currentIndex = Math.max(ISuperComposableYield(SCY).exchangeRate(),
|
|
188
|
-
|
|
183
|
+
function pyIndexCurrent() public returns (uint256 currentIndex) {
|
|
184
|
+
currentIndex = Math.max(ISuperComposableYield(SCY).exchangeRate(), _pyIndexStored);
|
|
185
|
+
_pyIndexStored = currentIndex.Uint128();
|
|
189
186
|
emit NewInterestIndex(currentIndex);
|
|
190
187
|
}
|
|
191
188
|
|
|
192
|
-
function
|
|
193
|
-
return
|
|
189
|
+
function pyIndexStored() public view returns (uint256) {
|
|
190
|
+
return _pyIndexStored;
|
|
194
191
|
}
|
|
195
192
|
|
|
196
193
|
function isExpired() public view returns (bool) {
|
|
@@ -201,15 +198,15 @@ contract PendleYieldToken is
|
|
|
201
198
|
external
|
|
202
199
|
view
|
|
203
200
|
returns (
|
|
204
|
-
uint256
|
|
201
|
+
uint256 firstPYIndex,
|
|
205
202
|
uint256 totalScyInterestForTreasury,
|
|
206
203
|
uint256[] memory firstRewardIndexes,
|
|
207
204
|
uint256[] memory userRewardOwed
|
|
208
205
|
)
|
|
209
206
|
{
|
|
210
|
-
require(postExpiry.
|
|
207
|
+
require(postExpiry.firstPYIndex != 0, "PostExpiry data not set");
|
|
211
208
|
|
|
212
|
-
|
|
209
|
+
firstPYIndex = postExpiry.firstPYIndex;
|
|
213
210
|
totalScyInterestForTreasury = postExpiry.totalScyInterestForTreasury;
|
|
214
211
|
|
|
215
212
|
address[] memory tokens = getRewardTokens();
|
|
@@ -230,7 +227,7 @@ contract PendleYieldToken is
|
|
|
230
227
|
IPPrincipalToken(PT).burnByYT(address(this), totalAmountPYToRedeem);
|
|
231
228
|
if (!isExpired()) _burn(address(this), totalAmountPYToRedeem);
|
|
232
229
|
|
|
233
|
-
uint256 index =
|
|
230
|
+
uint256 index = pyIndexCurrent();
|
|
234
231
|
uint256 totalScyInterestPostExpiry;
|
|
235
232
|
amountScyOuts = new uint256[](receivers.length);
|
|
236
233
|
|
|
@@ -242,6 +239,8 @@ contract PendleYieldToken is
|
|
|
242
239
|
);
|
|
243
240
|
_transferOut(SCY, receivers[i], amountScyOuts[i]);
|
|
244
241
|
totalScyInterestPostExpiry += scyInterestPostExpiry;
|
|
242
|
+
|
|
243
|
+
emit Burn(msg.sender, receivers[i], amountPYToRedeems[i], amountScyOuts[i]);
|
|
245
244
|
}
|
|
246
245
|
if (totalScyInterestPostExpiry != 0) {
|
|
247
246
|
postExpiry.totalScyInterestForTreasury += totalScyInterestPostExpiry.Uint128();
|
|
@@ -250,7 +249,7 @@ contract PendleYieldToken is
|
|
|
250
249
|
|
|
251
250
|
function _calcPYToMint(uint256 amountScy) internal returns (uint256 amountPY) {
|
|
252
251
|
// doesn't matter before or after expiry, since mintPY is only allowed before expiry
|
|
253
|
-
return SCYUtils.scyToAsset(
|
|
252
|
+
return SCYUtils.scyToAsset(pyIndexCurrent(), amountScy);
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
function _calcScyRedeemableFromPY(uint256 amountPY, uint256 indexCurrent)
|
|
@@ -260,7 +259,7 @@ contract PendleYieldToken is
|
|
|
260
259
|
{
|
|
261
260
|
scyToUser = SCYUtils.assetToScy(indexCurrent, amountPY);
|
|
262
261
|
if (isExpired()) {
|
|
263
|
-
uint256 totalScyRedeemable = SCYUtils.assetToScy(postExpiry.
|
|
262
|
+
uint256 totalScyRedeemable = SCYUtils.assetToScy(postExpiry.firstPYIndex, amountPY);
|
|
264
263
|
scyInterestPostExpiry = totalScyRedeemable - scyToUser;
|
|
265
264
|
}
|
|
266
265
|
}
|
|
@@ -281,11 +280,11 @@ contract PendleYieldToken is
|
|
|
281
280
|
|
|
282
281
|
function _setPostExpiryData() internal {
|
|
283
282
|
PostExpiryData storage local = postExpiry;
|
|
284
|
-
if (local.
|
|
283
|
+
if (local.firstPYIndex != 0) return; // already set
|
|
285
284
|
|
|
286
285
|
_redeemExternalReward(); // do a final redeem. All the future reward income will belong to the treasury
|
|
287
286
|
|
|
288
|
-
local.
|
|
287
|
+
local.firstPYIndex = pyIndexCurrent().Uint128();
|
|
289
288
|
address[] memory rewardTokens = ISuperComposableYield(SCY).getRewardTokens();
|
|
290
289
|
uint256[] memory rewardIndexes = ISuperComposableYield(SCY).rewardIndexesCurrent();
|
|
291
290
|
for (uint256 i = 0; i < rewardTokens.length; i++) {
|
|
@@ -299,8 +298,8 @@ contract PendleYieldToken is
|
|
|
299
298
|
//////////////////////////////////////////////////////////////*/
|
|
300
299
|
|
|
301
300
|
function _getInterestIndex() internal virtual override returns (uint256 index) {
|
|
302
|
-
if (isExpired()) index = postExpiry.
|
|
303
|
-
else index =
|
|
301
|
+
if (isExpired()) index = postExpiry.firstPYIndex;
|
|
302
|
+
else index = pyIndexCurrent();
|
|
304
303
|
}
|
|
305
304
|
|
|
306
305
|
function _YTbalance(address user) internal view override returns (uint256) {
|
|
@@ -16,8 +16,8 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper {
|
|
|
16
16
|
using SafeERC20 for ISuperComposableYield;
|
|
17
17
|
using SafeERC20 for IPYieldToken;
|
|
18
18
|
using SafeERC20 for IERC20;
|
|
19
|
-
using
|
|
20
|
-
using
|
|
19
|
+
using PYIndexLib for PYIndex;
|
|
20
|
+
using PYIndexLib for IPYieldToken;
|
|
21
21
|
|
|
22
22
|
address public immutable marketFactory;
|
|
23
23
|
|
|
@@ -90,9 +90,9 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper {
|
|
|
90
90
|
/// ------------------------------------------------------------
|
|
91
91
|
/// calc totalScyNeed
|
|
92
92
|
/// ------------------------------------------------------------
|
|
93
|
-
|
|
93
|
+
PYIndex pyIndex = YT.newIndex();
|
|
94
94
|
uint256 ptOwed = ptToAccount.abs();
|
|
95
|
-
uint256 totalScyNeed =
|
|
95
|
+
uint256 totalScyNeed = pyIndex.assetToScyUp(ptOwed);
|
|
96
96
|
|
|
97
97
|
/// ------------------------------------------------------------
|
|
98
98
|
/// calc netScyToPull
|
|
@@ -120,15 +120,15 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper {
|
|
|
120
120
|
bytes calldata data
|
|
121
121
|
) internal {
|
|
122
122
|
(address receiver, uint256 minScyOut) = _decodeSwapYtForScy(data);
|
|
123
|
-
(
|
|
124
|
-
|
|
123
|
+
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
124
|
+
PYIndex pyIndex = YT.newIndex();
|
|
125
125
|
|
|
126
126
|
uint256 scyOwed = scyToAccount.neg().Uint();
|
|
127
127
|
|
|
128
128
|
address[] memory receivers = new address[](2);
|
|
129
129
|
uint256[] memory amountPYToRedeems = new uint256[](2);
|
|
130
130
|
|
|
131
|
-
(receivers[0], amountPYToRedeems[0]) = (market,
|
|
131
|
+
(receivers[0], amountPYToRedeems[0]) = (market, pyIndex.scyToAssetUp(scyOwed));
|
|
132
132
|
(receivers[1], amountPYToRedeems[1]) = (
|
|
133
133
|
receiver,
|
|
134
134
|
ptToAccount.Uint() - amountPYToRedeems[0]
|
|
@@ -14,7 +14,7 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
|
|
|
14
14
|
using MarketMathCore for MarketState;
|
|
15
15
|
using MarketApproxLib for MarketState;
|
|
16
16
|
using SafeERC20 for IERC20;
|
|
17
|
-
using
|
|
17
|
+
using PYIndexLib for IPYieldToken;
|
|
18
18
|
|
|
19
19
|
bytes private constant EMPTY_BYTES = abi.encode();
|
|
20
20
|
|
|
@@ -38,11 +38,12 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
|
|
|
38
38
|
uint256 ptUsed
|
|
39
39
|
)
|
|
40
40
|
{
|
|
41
|
-
(ISuperComposableYield SCY, IPPrincipalToken PT, ) = IPMarket(market)
|
|
41
|
+
(ISuperComposableYield SCY, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market)
|
|
42
|
+
.readTokens();
|
|
42
43
|
|
|
43
44
|
MarketState memory state = IPMarket(market).readState(false);
|
|
44
45
|
(, netLpOut, scyUsed, ptUsed) = state.addLiquidity(
|
|
45
|
-
|
|
46
|
+
YT.newIndex(),
|
|
46
47
|
scyDesired,
|
|
47
48
|
ptDesired,
|
|
48
49
|
block.timestamp
|
|
@@ -119,10 +120,10 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
|
|
|
119
120
|
bool doPull
|
|
120
121
|
) internal returns (uint256 netPtIn) {
|
|
121
122
|
MarketState memory state = IPMarket(market).readState(false);
|
|
122
|
-
(
|
|
123
|
+
(, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market).readTokens();
|
|
123
124
|
|
|
124
125
|
(netPtIn, , ) = state.approxSwapPtForExactScy(
|
|
125
|
-
|
|
126
|
+
YT.newIndex(),
|
|
126
127
|
exactScyOut,
|
|
127
128
|
block.timestamp,
|
|
128
129
|
guessPtIn
|
|
@@ -147,9 +148,9 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
|
|
|
147
148
|
bool doPull
|
|
148
149
|
) internal returns (uint256 netScyIn) {
|
|
149
150
|
MarketState memory state = IPMarket(market).readState(false);
|
|
150
|
-
(ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
|
|
151
|
+
(ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
151
152
|
|
|
152
|
-
(netScyIn, ) = state.swapScyForExactPt(
|
|
153
|
+
(netScyIn, ) = state.swapScyForExactPt(YT.newIndex(), exactPtOut, block.timestamp);
|
|
153
154
|
|
|
154
155
|
require(netScyIn <= maxScyIn, "exceed limit SCY in");
|
|
155
156
|
|
|
@@ -175,10 +176,10 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
|
|
|
175
176
|
bool doPull
|
|
176
177
|
) internal returns (uint256 netPtOut) {
|
|
177
178
|
MarketState memory state = IPMarket(market).readState(false);
|
|
178
|
-
(ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
|
|
179
|
+
(ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
179
180
|
|
|
180
181
|
(netPtOut, , ) = state.approxSwapExactScyForPt(
|
|
181
|
-
|
|
182
|
+
YT.newIndex(),
|
|
182
183
|
exactScyIn,
|
|
183
184
|
block.timestamp,
|
|
184
185
|
guessPtOut
|
|
@@ -16,7 +16,7 @@ abstract contract ActionSCYAndYTBase is ActionSCYAndPYBase, CallbackHelper {
|
|
|
16
16
|
using MarketApproxLib for MarketState;
|
|
17
17
|
using SafeERC20 for ISuperComposableYield;
|
|
18
18
|
using SafeERC20 for IPYieldToken;
|
|
19
|
-
using
|
|
19
|
+
using PYIndexLib for IPYieldToken;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @notice swap exact SCY to YT with the help of flashswaps & YT tokenization / redemption
|
|
@@ -40,7 +40,7 @@ abstract contract ActionSCYAndYTBase is ActionSCYAndPYBase, CallbackHelper {
|
|
|
40
40
|
MarketState memory state = IPMarket(market).readState(false);
|
|
41
41
|
|
|
42
42
|
(netYtOut, , ) = state.approxSwapExactScyForYt(
|
|
43
|
-
|
|
43
|
+
YT.newIndex(),
|
|
44
44
|
exactScyIn,
|
|
45
45
|
block.timestamp,
|
|
46
46
|
guessYtOut
|
|
@@ -141,10 +141,10 @@ abstract contract ActionSCYAndYTBase is ActionSCYAndPYBase, CallbackHelper {
|
|
|
141
141
|
bool doPull
|
|
142
142
|
) internal returns (uint256 netYtIn) {
|
|
143
143
|
MarketState memory state = IPMarket(market).readState(false);
|
|
144
|
-
(
|
|
144
|
+
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
145
145
|
|
|
146
146
|
(netYtIn, , ) = state.approxSwapYtForExactScy(
|
|
147
|
-
|
|
147
|
+
YT.newIndex(),
|
|
148
148
|
exactScyOut,
|
|
149
149
|
block.timestamp,
|
|
150
150
|
guessYtIn
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
|
|
24
|
+
pragma solidity 0.8.15;
|
|
25
|
+
|
|
26
|
+
interface IEulerEToken {
|
|
27
|
+
/// @notice Address of underlying asset
|
|
28
|
+
function underlyingAsset() external view returns (address);
|
|
29
|
+
|
|
30
|
+
/// @notice Sum of all balances, in internal book-keeping units (non-increasing)
|
|
31
|
+
function totalSupply() external view returns (uint256);
|
|
32
|
+
|
|
33
|
+
/// @notice Sum of all balances, in underlying units (increases as interest is earned)
|
|
34
|
+
function totalSupplyUnderlying() external view returns (uint256);
|
|
35
|
+
|
|
36
|
+
/// @notice Transfer underlying tokens from sender to the Euler pool, and increase account's eTokens
|
|
37
|
+
/// @param subAccountId 0 for primary, 1-255 for a sub-account
|
|
38
|
+
/// @param amount In underlying units (use max uint256 for full underlying token balance)
|
|
39
|
+
function deposit(uint256 subAccountId, uint256 amount) external;
|
|
40
|
+
|
|
41
|
+
function balanceOf(address) external view returns (uint256);
|
|
42
|
+
|
|
43
|
+
/// @notice Balance of a particular account, in underlying units (increases as interest is earned)
|
|
44
|
+
function balanceOfUnderlying(address) external view returns (uint256);
|
|
45
|
+
|
|
46
|
+
/// @notice Convert an underlying amount to an eToken balance, taking into account current exchange rate
|
|
47
|
+
/// @param underlyingAmount Amount in underlying units (same decimals as underlying token)
|
|
48
|
+
/// @return eToken balance, in internal book-keeping units (18 decimals)
|
|
49
|
+
function convertUnderlyingToBalance(uint256 underlyingAmount) external view returns (uint256);
|
|
50
|
+
|
|
51
|
+
/// @notice Convert an eToken balance to an underlying amount, taking into account current exchange rate
|
|
52
|
+
/// @param balance eToken balance, in internal book-keeping units (18 decimals)
|
|
53
|
+
/// @return Amount in underlying units, (same decimals as underlying token)
|
|
54
|
+
function convertBalanceToUnderlying(uint256 balance) external view returns (uint256);
|
|
55
|
+
|
|
56
|
+
/// @notice Transfer underlying tokens from Euler pool to sender, and decrease account's eTokens
|
|
57
|
+
/// @param subAccountId 0 for primary, 1-255 for a sub-account
|
|
58
|
+
/// @param amount In underlying units (use max uint256 for full pool balance)
|
|
59
|
+
function withdraw(uint256 subAccountId, uint256 amount) external;
|
|
60
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
|
|
24
|
+
pragma solidity 0.8.15;
|
|
25
|
+
|
|
26
|
+
interface IEulerMarkets {
|
|
27
|
+
/// @notice Given an EToken address, looks up the associated underlying
|
|
28
|
+
/// @param eToken EToken address
|
|
29
|
+
/// @return underlying Token address
|
|
30
|
+
function eTokenToUnderlying(address eToken) external view returns (address underlying);
|
|
31
|
+
|
|
32
|
+
/// @notice Given an underlying, lookup the associated EToken
|
|
33
|
+
/// @param underlying Token address
|
|
34
|
+
/// @return EToken address, or address(0) if not activated
|
|
35
|
+
function underlyingToEToken(address underlying) external view returns (address);
|
|
36
|
+
|
|
37
|
+
/// @notice Given an underlying, lookup the associated DToken
|
|
38
|
+
/// @param underlying Token address
|
|
39
|
+
/// @return DToken address, or address(0) if not activated
|
|
40
|
+
function underlyingToDToken(address underlying) external view returns (address);
|
|
41
|
+
|
|
42
|
+
/// @notice Retrieves the current interest rate for an asset
|
|
43
|
+
/// @param underlying Token address
|
|
44
|
+
/// @return The interest rate in yield-per-second, scaled by 10**27
|
|
45
|
+
function interestRate(address underlying) external view returns (int96);
|
|
46
|
+
}
|
|
@@ -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
|
+
}
|