@pendle/core-v2 0.14.0-testnet → 0.15.1-mainnet
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +97 -48
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +62 -21
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.json +26 -0
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.json +10 -0
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +10 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +33 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +39 -8
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +6 -6
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +2 -12
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +3 -3
- 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 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +37 -6
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +4 -0
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.json +10 -0
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +19 -0
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.json +119 -0
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.json +39 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.json +12 -2
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +182 -0
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +89 -60
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +20 -4
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +4 -4
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +27 -96
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +12 -40
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +5 -24
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +3 -3
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +7 -2
- package/contracts/core/Market/MarketMathCore.sol +1 -1
- package/contracts/core/StandardizedYield/SYBase.sol +0 -5
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +1 -4
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +8 -5
- package/contracts/core/YieldContracts/PendleYieldToken.sol +2 -2
- package/contracts/core/erc20/PendleERC20Permit.sol +1 -1
- package/contracts/core/libraries/Errors.sol +1 -3
- package/contracts/interfaces/ICelerMessageBus.sol +28 -0
- package/contracts/interfaces/ICelerMessageReceiverApp.sol +25 -0
- package/contracts/interfaces/IPMsgSendEndpoint.sol +2 -4
- package/deployments/1-core.json +16 -0
- package/deployments/1-markets/STETH_MARCH_30.json +8 -0
- package/package.json +2 -2
- package/typechain-types/ICrvPool.ts +16 -0
- package/typechain-types/ILayerZeroEndpoint.ts +256 -0
- package/typechain-types/ILayerZeroReceiver.ts +117 -0
- package/typechain-types/ILooksFeeSharing.ts +102 -0
- package/typechain-types/ILooksStaking.ts +162 -0
- package/typechain-types/IPMsgSendEndpoint.ts +24 -14
- package/typechain-types/ImplicitSwapfeeContract.ts +9 -17
- package/typechain-types/PendleConvex2TokensSY.ts +1215 -0
- package/typechain-types/PendleLooksStaking.ts +1052 -0
- package/typechain-types/PendleMsgReceiveEndpointUpg.ts +126 -68
- package/typechain-types/PendleMsgSendEndpointUpg.ts +99 -39
- package/typechain-types/PendleMsgSenderAppUpg.ts +55 -0
- package/typechain-types/PendleVotingControllerUpg.ts +55 -0
- package/typechain-types/PendleWstEthSY.ts +1 -3
- package/typechain-types/RouterStatic.ts +44 -0
- package/typechain-types/VotingEscrowPendleMainchain.ts +61 -6
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +17 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +36 -5
- package/typechain-types/factories/ICrvPool__factory.ts +19 -0
- package/typechain-types/factories/ILayerZeroEndpoint__factory.ts +134 -0
- package/typechain-types/factories/ILayerZeroReceiver__factory.ts +54 -0
- package/typechain-types/factories/ILooksFeeSharing__factory.ts +45 -0
- package/typechain-types/factories/ILooksStaking__factory.ts +81 -0
- package/typechain-types/factories/IPMsgSendEndpoint__factory.ts +12 -2
- package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +4 -12
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -1
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1 -19
- package/typechain-types/factories/Pendle3CrvHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleConvex2TokensSY__factory.ts +1093 -0
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleLooksStaking__factory.ts +933 -0
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +100 -51
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +71 -23
- package/typechain-types/factories/PendleMsgSenderAppUpg__factory.ts +26 -0
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +44 -2
- package/typechain-types/factories/PendleWstEthSY__factory.ts +2 -2
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +30 -1
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +50 -8
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +27 -18
- package/typechain-types/index.ts +6 -4
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.json +0 -53
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.json +0 -45
- package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +0 -133
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +0 -33
- package/contracts/interfaces/ILayerZeroEndpoint.sol +0 -39
- package/contracts/interfaces/ILayerZeroReceiver.sol +0 -12
- package/deployments/43113-core.json +0 -16
- package/deployments/43113-helper.json +0 -3
- package/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
- package/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
- package/deployments/43113-testenv.json +0 -22
- package/deployments/80001-core.json +0 -15
- package/deployments/80001-testenv.json +0 -22
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "MarketApproxPtInLib",
|
|
4
4
|
"sourceName": "contracts/router/base/MarketApproxLib.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212200ec9023e9e5bc817833322ec20c8b0cc3b233a48f8c77b06e34b34cc857bf94964736f6c63430008110033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212200ec9023e9e5bc817833322ec20c8b0cc3b233a48f8c77b06e34b34cc857bf94964736f6c63430008110033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "MarketApproxPtOutLib",
|
|
4
4
|
"sourceName": "contracts/router/base/MarketApproxLib.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220f2dbc495ddc16936e9bdf0b263d35ddbdf803ba1f7c610cd2e3d1bded1a8ba5764736f6c63430008110033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220f2dbc495ddc16936e9bdf0b263d35ddbdf803ba1f7c610cd2e3d1bded1a8ba5764736f6c63430008110033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
|
@@ -1,72 +1,40 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
|
-
import "../../interfaces/
|
|
4
|
+
import "../../interfaces/ICelerMessageReceiverApp.sol";
|
|
5
5
|
import "../../interfaces/IPMsgReceiverApp.sol";
|
|
6
|
-
import "../../interfaces/
|
|
6
|
+
import "../../interfaces/ICelerMessageBus.sol";
|
|
7
7
|
import "../../core/libraries/BoringOwnableUpgradeable.sol";
|
|
8
8
|
import "../../core/libraries/Errors.sol";
|
|
9
|
-
import "./libraries/LayerZeroHelper.sol";
|
|
10
|
-
import "./libraries/ExcessivelySafeCall.sol";
|
|
11
9
|
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
12
10
|
|
|
13
|
-
/**
|
|
14
|
-
* @dev Initially, currently we will use layer zero's default send and receive version (which is most updated)
|
|
15
|
-
* So we can leave the configuration unset.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
11
|
contract PendleMsgReceiveEndpointUpg is
|
|
19
|
-
|
|
12
|
+
ICelerMessageReceiverApp,
|
|
20
13
|
Initializable,
|
|
21
14
|
UUPSUpgradeable,
|
|
22
15
|
BoringOwnableUpgradeable
|
|
23
16
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
address public immutable lzEndpoint;
|
|
17
|
+
ICelerMessageBus public immutable celerMessageBus;
|
|
27
18
|
address public immutable sendEndpointAddr;
|
|
28
19
|
uint64 public immutable sendEndpointChainId;
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
event MessageFailed(
|
|
33
|
-
uint16 _srcChainId,
|
|
34
|
-
bytes _path,
|
|
35
|
-
uint64 _nonce,
|
|
36
|
-
bytes _payload,
|
|
37
|
-
bytes _reason
|
|
38
|
-
);
|
|
39
|
-
event RetryMessageSuccess(
|
|
40
|
-
uint16 _srcChainId,
|
|
41
|
-
bytes _path,
|
|
42
|
-
uint64 _nonce,
|
|
43
|
-
bytes32 _payloadHash
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
modifier onlyLzEndpoint() {
|
|
47
|
-
if (msg.sender != address(lzEndpoint)) revert Errors.OnlyLayerZeroEndpoint();
|
|
21
|
+
modifier onlyCelerMessageBus() {
|
|
22
|
+
if (msg.sender != address(celerMessageBus)) revert Errors.OnlyCelerBus();
|
|
48
23
|
_;
|
|
49
24
|
}
|
|
50
25
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
* is no harm to keep our current whitelisting mechanism.
|
|
55
|
-
*/
|
|
56
|
-
modifier mustOriginateFromSendEndpoint(uint16 srcChainId, bytes memory path) {
|
|
57
|
-
if (
|
|
58
|
-
sendEndpointAddr != LayerZeroHelper._getSrcAdrressFromPath(path) ||
|
|
59
|
-
sendEndpointChainId != LayerZeroHelper._getOriginalChainIds(srcChainId)
|
|
60
|
-
) revert Errors.MsgNotFromSendEndpoint(msg.sender);
|
|
26
|
+
modifier mustOriginateFromSendEndpoint(address srcAddress, uint64 srcChainId) {
|
|
27
|
+
if (srcAddress != sendEndpointAddr || srcChainId != sendEndpointChainId)
|
|
28
|
+
revert Errors.MsgNotFromSendEndpoint(msg.sender);
|
|
61
29
|
_;
|
|
62
30
|
}
|
|
63
31
|
|
|
64
32
|
constructor(
|
|
65
|
-
|
|
33
|
+
ICelerMessageBus _celerMessageBus,
|
|
66
34
|
address _sendEndpointAddr,
|
|
67
35
|
uint64 _sendEndpointChainId
|
|
68
36
|
) initializer {
|
|
69
|
-
|
|
37
|
+
celerMessageBus = _celerMessageBus;
|
|
70
38
|
sendEndpointAddr = _sendEndpointAddr;
|
|
71
39
|
sendEndpointChainId = _sendEndpointChainId;
|
|
72
40
|
}
|
|
@@ -75,55 +43,22 @@ contract PendleMsgReceiveEndpointUpg is
|
|
|
75
43
|
__BoringOwnable_init();
|
|
76
44
|
}
|
|
77
45
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
uint64
|
|
82
|
-
bytes calldata
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function retryMessage(
|
|
97
|
-
uint16 _srcChainId,
|
|
98
|
-
bytes calldata _path,
|
|
99
|
-
uint64 _nonce,
|
|
100
|
-
bytes calldata _payload
|
|
101
|
-
) public payable virtual {
|
|
102
|
-
bytes32 payloadHash = failedMessages[_srcChainId][_path][_nonce];
|
|
103
|
-
|
|
104
|
-
if (payloadHash == bytes32(0) || keccak256(_payload) != payloadHash)
|
|
105
|
-
revert Errors.InvalidRetryData();
|
|
106
|
-
|
|
107
|
-
failedMessages[_srcChainId][_path][_nonce] = bytes32(0);
|
|
108
|
-
nonBlockingReceive(_payload);
|
|
109
|
-
emit RetryMessageSuccess(_srcChainId, _path, _nonce, payloadHash);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @dev LayerZero by default will stop all the incoming messages once some message failed to execute
|
|
114
|
-
* In the very extreme case that it fails to deliver some message to Pendle, we still want the crosschain
|
|
115
|
-
* messaging feature to keep functioning.
|
|
116
|
-
*
|
|
117
|
-
* @dev As the nature of all type of messages we have:
|
|
118
|
-
* - Update vePendle totalSupply
|
|
119
|
-
* - Update vePendle user balance
|
|
120
|
-
* - Send voting result to GaugeController
|
|
121
|
-
*
|
|
122
|
-
* There is not a need to ensure the index order of messages
|
|
123
|
-
*/
|
|
124
|
-
function nonBlockingReceive(bytes memory payload) public {
|
|
125
|
-
(address receiver, bytes memory message) = abi.decode(payload, (address, bytes));
|
|
126
|
-
IPMsgReceiverApp(receiver).executeMessage(message);
|
|
46
|
+
// @notice for Celer
|
|
47
|
+
function executeMessage(
|
|
48
|
+
address srcAddress,
|
|
49
|
+
uint64 srcChainId,
|
|
50
|
+
bytes calldata message,
|
|
51
|
+
address /*_executor*/
|
|
52
|
+
)
|
|
53
|
+
external
|
|
54
|
+
payable
|
|
55
|
+
onlyCelerMessageBus
|
|
56
|
+
mustOriginateFromSendEndpoint(srcAddress, srcChainId)
|
|
57
|
+
returns (ExecutionStatus)
|
|
58
|
+
{
|
|
59
|
+
(address receiver, bytes memory actualMessage) = abi.decode(message, (address, bytes));
|
|
60
|
+
IPMsgReceiverApp(receiver).executeMessage(actualMessage);
|
|
61
|
+
return ExecutionStatus.Success;
|
|
127
62
|
}
|
|
128
63
|
|
|
129
64
|
function govExecuteMessage(address receiver, bytes calldata message)
|
|
@@ -134,10 +69,6 @@ contract PendleMsgReceiveEndpointUpg is
|
|
|
134
69
|
IPMsgReceiverApp(receiver).executeMessage(message);
|
|
135
70
|
}
|
|
136
71
|
|
|
137
|
-
function setReceiveVersion(uint16 _newVersion) external {
|
|
138
|
-
ILayerZeroEndpoint(lzEndpoint).setReceiveVersion(_newVersion);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
72
|
//solhint-disable-next-line
|
|
142
73
|
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
|
|
143
74
|
}
|
|
@@ -2,18 +2,12 @@
|
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../../interfaces/IPMsgSendEndpoint.sol";
|
|
5
|
-
import "../../interfaces/
|
|
5
|
+
import "../../interfaces/ICelerMessageBus.sol";
|
|
6
6
|
import "../../core/libraries/BoringOwnableUpgradeable.sol";
|
|
7
7
|
import "../../core/libraries/Errors.sol";
|
|
8
|
-
import "./libraries/LayerZeroHelper.sol";
|
|
9
8
|
import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
|
|
10
9
|
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
11
10
|
|
|
12
|
-
/**
|
|
13
|
-
* @dev Initially, currently we will use layer zero's default send and receive version (which is most updated)
|
|
14
|
-
* So we can leave the configuration unset.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
11
|
contract PendleMsgSendEndpointUpg is
|
|
18
12
|
IPMsgSendEndpoint,
|
|
19
13
|
Initializable,
|
|
@@ -22,9 +16,7 @@ contract PendleMsgSendEndpointUpg is
|
|
|
22
16
|
{
|
|
23
17
|
using EnumerableMap for EnumerableMap.UintToAddressMap;
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
ILayerZeroEndpoint public immutable lzEndpoint;
|
|
27
|
-
|
|
19
|
+
ICelerMessageBus public immutable celerMessageBus;
|
|
28
20
|
EnumerableMap.UintToAddressMap internal receiveEndpoints;
|
|
29
21
|
mapping(address => bool) public isWhitelisted;
|
|
30
22
|
|
|
@@ -33,9 +25,8 @@ contract PendleMsgSendEndpointUpg is
|
|
|
33
25
|
_;
|
|
34
26
|
}
|
|
35
27
|
|
|
36
|
-
constructor(
|
|
37
|
-
|
|
38
|
-
lzEndpoint = _lzEndpoint;
|
|
28
|
+
constructor(ICelerMessageBus _celerMessageBus) initializer {
|
|
29
|
+
celerMessageBus = _celerMessageBus;
|
|
39
30
|
}
|
|
40
31
|
|
|
41
32
|
function initialize() external initializer {
|
|
@@ -44,36 +35,21 @@ contract PendleMsgSendEndpointUpg is
|
|
|
44
35
|
|
|
45
36
|
function calcFee(
|
|
46
37
|
address dstAddress,
|
|
47
|
-
uint256 dstChainId
|
|
48
|
-
bytes memory
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
(fee, ) = lzEndpoint.estimateFees(
|
|
52
|
-
LayerZeroHelper._getLayerZeroChainIds(dstChainId),
|
|
53
|
-
receiveEndpoints.get(dstChainId),
|
|
54
|
-
abi.encode(dstAddress, payload),
|
|
55
|
-
false,
|
|
56
|
-
adapterParams
|
|
57
|
-
);
|
|
38
|
+
uint256, /*dstChainId*/
|
|
39
|
+
bytes memory message
|
|
40
|
+
) external view returns (uint256) {
|
|
41
|
+
return celerMessageBus.calcFee(abi.encode(dstAddress, message));
|
|
58
42
|
}
|
|
59
43
|
|
|
60
44
|
function sendMessage(
|
|
61
45
|
address dstAddress,
|
|
62
46
|
uint256 dstChainId,
|
|
63
|
-
bytes calldata
|
|
64
|
-
bytes calldata adapterParams
|
|
47
|
+
bytes calldata message
|
|
65
48
|
) external payable onlyWhitelisted {
|
|
66
|
-
|
|
49
|
+
celerMessageBus.sendMessage{ value: msg.value }(
|
|
67
50
|
receiveEndpoints.get(dstChainId),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
lzEndpoint.send{ value: msg.value }(
|
|
71
|
-
LayerZeroHelper._getLayerZeroChainIds(dstChainId),
|
|
72
|
-
path,
|
|
73
|
-
abi.encode(dstAddress, payload),
|
|
74
|
-
refundAddress,
|
|
75
|
-
address(0),
|
|
76
|
-
adapterParams
|
|
51
|
+
dstChainId,
|
|
52
|
+
abi.encode(dstAddress, message)
|
|
77
53
|
);
|
|
78
54
|
}
|
|
79
55
|
|
|
@@ -89,10 +65,6 @@ contract PendleMsgSendEndpointUpg is
|
|
|
89
65
|
isWhitelisted[addr] = status;
|
|
90
66
|
}
|
|
91
67
|
|
|
92
|
-
function setLzSendVersion(uint16 _newVersion) external onlyOwner {
|
|
93
|
-
ILayerZeroEndpoint(lzEndpoint).setSendVersion(_newVersion);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
68
|
function getAllReceiveEndpoints()
|
|
97
69
|
external
|
|
98
70
|
view
|
|
@@ -8,14 +8,12 @@ import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
|
|
|
8
8
|
|
|
9
9
|
// solhint-disable no-empty-blocks
|
|
10
10
|
/// This contract is upgradable because
|
|
11
|
-
/// - its constructor only sets immutable
|
|
11
|
+
/// - its constructor only sets immutable variables
|
|
12
12
|
/// - it has storage gaps for safe addition of future variables
|
|
13
13
|
/// - it inherits only upgradable contract
|
|
14
14
|
abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeable {
|
|
15
15
|
using EnumerableMap for EnumerableMap.UintToAddressMap;
|
|
16
16
|
|
|
17
|
-
uint256 public approxDstExecutionGas;
|
|
18
|
-
|
|
19
17
|
IPMsgSendEndpoint public immutable pendleMsgSendEndpoint;
|
|
20
18
|
|
|
21
19
|
// destinationContracts mapping contains one address for each chainId only
|
|
@@ -37,12 +35,11 @@ abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeable {
|
|
|
37
35
|
function _sendMessage(uint256 chainId, bytes memory message) internal {
|
|
38
36
|
assert(destinationContracts.contains(chainId));
|
|
39
37
|
address toAddr = destinationContracts.get(chainId);
|
|
40
|
-
|
|
41
|
-
uint256 fee = pendleMsgSendEndpoint.calcFee(toAddr, chainId, message, adapterParams);
|
|
38
|
+
uint256 fee = pendleMsgSendEndpoint.calcFee(toAddr, chainId, message);
|
|
42
39
|
// LM contracts won't hold ETH on its own so this is fine
|
|
43
40
|
if (address(this).balance < fee)
|
|
44
41
|
revert Errors.InsufficientFeeToSendMsg(address(this).balance, fee);
|
|
45
|
-
pendleMsgSendEndpoint.sendMessage{ value: fee }(toAddr, chainId, message
|
|
42
|
+
pendleMsgSendEndpoint.sendMessage{ value: fee }(toAddr, chainId, message);
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
function addDestinationContract(address _address, uint256 _chainId)
|
|
@@ -51,10 +48,7 @@ abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeable {
|
|
|
51
48
|
onlyOwner
|
|
52
49
|
{
|
|
53
50
|
destinationContracts.set(_chainId, _address);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
function setApproxDstExecutionGas(uint256 gas) external onlyOwner {
|
|
57
|
-
approxDstExecutionGas = gas;
|
|
51
|
+
_afterAddDestinationContract(_address, _chainId);
|
|
58
52
|
}
|
|
59
53
|
|
|
60
54
|
function getAllDestinationContracts()
|
|
@@ -71,18 +65,5 @@ abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeable {
|
|
|
71
65
|
}
|
|
72
66
|
}
|
|
73
67
|
|
|
74
|
-
function
|
|
75
|
-
uint256 gas = approxDstExecutionGas;
|
|
76
|
-
if (gas == 0) revert Errors.ApproxDstExecutionGasNotSet();
|
|
77
|
-
// (version, gas consumption)
|
|
78
|
-
return abi.encodePacked(uint16(1), gas);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function _getSendMessageFee(
|
|
82
|
-
address dstContract,
|
|
83
|
-
uint256 chainId,
|
|
84
|
-
bytes memory message
|
|
85
|
-
) internal view returns (uint256) {
|
|
86
|
-
return pendleMsgSendEndpoint.calcFee(dstContract, chainId, message, _getAdapterParams());
|
|
87
|
-
}
|
|
68
|
+
function _afterAddDestinationContract(address addr, uint256 chainId) internal virtual {}
|
|
88
69
|
}
|
|
@@ -21,7 +21,7 @@ Voting accounting:
|
|
|
21
21
|
will receive both of the reward pack
|
|
22
22
|
- Each pack of money will has it own id as timestamp, a gauge controller does not
|
|
23
23
|
receive a pack of money with the same id twice, this allow governance to rebroadcast
|
|
24
|
-
in case the last message was corrupted by
|
|
24
|
+
in case the last message was corrupted by Celer
|
|
25
25
|
|
|
26
26
|
Pros:
|
|
27
27
|
- If governance does not forget broadcasting the reward on the early of the week,
|
|
@@ -196,7 +196,7 @@ contract PendleVotingControllerUpg is
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
|
-
* @notice use the gov-privilege to force broadcast a message in case there are issues with
|
|
199
|
+
* @notice use the gov-privilege to force broadcast a message in case there are issues with Celer
|
|
200
200
|
* @dev it's intentional for this function to have minimal checks since we assume gov has done the
|
|
201
201
|
due diligence
|
|
202
202
|
* @dev gov should always call finalizeEpoch beforehand
|
|
@@ -233,7 +233,7 @@ contract PendleVotingControllerUpg is
|
|
|
233
233
|
uint256[] memory totalPendleAmounts = new uint256[](length);
|
|
234
234
|
|
|
235
235
|
return
|
|
236
|
-
|
|
236
|
+
pendleMsgSendEndpoint.calcFee(
|
|
237
237
|
destinationContracts.get(chainId),
|
|
238
238
|
chainId,
|
|
239
239
|
abi.encode(uint128(0), pools, totalPendleAmounts)
|
|
@@ -181,7 +181,7 @@ contract VotingEscrowPendleMainchain is
|
|
|
181
181
|
{
|
|
182
182
|
fees = new uint256[](chainIds.length);
|
|
183
183
|
for (uint256 i = 0; i < chainIds.length; i++) {
|
|
184
|
-
fees[i] =
|
|
184
|
+
fees[i] = pendleMsgSendEndpoint.calcFee(
|
|
185
185
|
destinationContracts.get(chainIds[i]),
|
|
186
186
|
chainIds[i],
|
|
187
187
|
SAMPLE_SUPPLY_UPDATE_MESSAGE
|
|
@@ -196,7 +196,7 @@ contract VotingEscrowPendleMainchain is
|
|
|
196
196
|
{
|
|
197
197
|
fees = new uint256[](chainIds.length);
|
|
198
198
|
for (uint256 i = 0; i < chainIds.length; i++) {
|
|
199
|
-
fees[i] =
|
|
199
|
+
fees[i] = pendleMsgSendEndpoint.calcFee(
|
|
200
200
|
destinationContracts.get(chainIds[i]),
|
|
201
201
|
chainIds[i],
|
|
202
202
|
SAMPLE_POSITION_UPDATE_MESSAGE
|
|
@@ -295,6 +295,11 @@ contract VotingEscrowPendleMainchain is
|
|
|
295
295
|
emit BroadcastTotalSupply(supply, chainIds);
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
+
function _afterAddDestinationContract(address, uint256 chainId) internal virtual override {
|
|
299
|
+
(VeBalance memory supply, uint128 wTime) = _applySlopeChange();
|
|
300
|
+
_broadcast(chainId, wTime, supply, EMPTY_BYTES);
|
|
301
|
+
}
|
|
302
|
+
|
|
298
303
|
function _broadcast(
|
|
299
304
|
uint256 chainId,
|
|
300
305
|
uint128 wTime,
|
|
@@ -171,7 +171,7 @@ library MarketMathCore {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
if (lpToAccount
|
|
174
|
+
if (lpToAccount <= 0) revert Errors.MarketZeroAmountsOutput();
|
|
175
175
|
|
|
176
176
|
/// ------------------------------------------------------------
|
|
177
177
|
/// WRITE
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
|
-
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
4
|
-
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
|
|
5
|
-
|
|
6
3
|
import "../../interfaces/IStandardizedYield.sol";
|
|
7
4
|
|
|
8
5
|
import "../erc20/PendleERC20Permit.sol";
|
|
9
6
|
|
|
10
|
-
import "../RewardManager/RewardManager.sol";
|
|
11
7
|
import "../libraries/math/Math.sol";
|
|
12
8
|
import "../libraries/TokenHelper.sol";
|
|
13
9
|
import "../libraries/Errors.sol";
|
|
14
|
-
import "./SYUtils.sol";
|
|
15
10
|
|
|
16
11
|
abstract contract SYBase is IStandardizedYield, PendleERC20Permit, TokenHelper {
|
|
17
12
|
using Math for uint256;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
|
-
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
4
3
|
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
import "../libraries/math/Math.sol";
|
|
4
|
+
import "../RewardManager/RewardManager.sol";
|
|
8
5
|
import "./SYBase.sol";
|
|
9
6
|
|
|
10
7
|
/// NOTE: yieldToken MUST NEVER BE a rewardToken, else the rewardManager will behave erroneously
|
|
@@ -49,7 +49,10 @@ contract PendleWstEthSY is SYBase {
|
|
|
49
49
|
amountStETH = amountDeposited;
|
|
50
50
|
} else {
|
|
51
51
|
if (tokenIn == wETH) IWETH(wETH).withdraw(amountDeposited);
|
|
52
|
-
|
|
52
|
+
|
|
53
|
+
uint256 preBalanceStEth = _selfBalance(stETH);
|
|
54
|
+
IStETH(stETH).submit{ value: amountDeposited }(address(0));
|
|
55
|
+
amountStETH = _selfBalance(stETH) - preBalanceStEth;
|
|
53
56
|
}
|
|
54
57
|
amountSharesOut = IWstETH(wstETH).wrap(amountStETH);
|
|
55
58
|
}
|
|
@@ -82,8 +85,8 @@ contract PendleWstEthSY is SYBase {
|
|
|
82
85
|
* @notice Calculates and updates the exchange rate of shares to underlying asset token
|
|
83
86
|
* @dev It is the exchange rate of wstETH to stETH
|
|
84
87
|
*/
|
|
85
|
-
function exchangeRate() public view virtual override returns (uint256
|
|
86
|
-
return
|
|
88
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
89
|
+
return IStETH(stETH).getPooledEthByShares(1 ether);
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
/*///////////////////////////////////////////////////////////////
|
|
@@ -104,7 +107,7 @@ contract PendleWstEthSY is SYBase {
|
|
|
104
107
|
} else {
|
|
105
108
|
amountStETH = IStETH(stETH).getSharesByPooledEth(amountTokenToDeposit);
|
|
106
109
|
}
|
|
107
|
-
amountSharesOut = (
|
|
110
|
+
amountSharesOut = IStETH(stETH).getSharesByPooledEth(amountStETH);
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
|
|
@@ -115,7 +118,7 @@ contract PendleWstEthSY is SYBase {
|
|
|
115
118
|
returns (uint256 amountTokenOut)
|
|
116
119
|
{
|
|
117
120
|
if (tokenOut == wstETH) amountTokenOut = amountSharesToRedeem;
|
|
118
|
-
else amountTokenOut = (amountSharesToRedeem
|
|
121
|
+
else amountTokenOut = IStETH(stETH).getPooledEthByShares(amountSharesToRedeem);
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
@@ -105,9 +105,9 @@ contract PendleYieldToken is
|
|
|
105
105
|
) external nonReentrant notExpired updateData returns (uint256[] memory amountPYOuts) {
|
|
106
106
|
uint256 length = receiverPTs.length;
|
|
107
107
|
|
|
108
|
-
if (receiverYTs.length != length && amountSyToMints.length == length)
|
|
109
|
-
revert Errors.ArrayLengthMismatch();
|
|
110
108
|
if (length == 0) revert Errors.ArrayEmpty();
|
|
109
|
+
if (receiverYTs.length != length || amountSyToMints.length != length)
|
|
110
|
+
revert Errors.ArrayLengthMismatch();
|
|
111
111
|
|
|
112
112
|
uint256 totalSyToMint = amountSyToMints.sum();
|
|
113
113
|
if (totalSyToMint > _getFloatingSyAmount())
|
|
@@ -19,7 +19,7 @@ contract PendleERC20Permit is PendleERC20, IERC20Permit, EIP712 {
|
|
|
19
19
|
mapping(address => Counters.Counter) private _nonces;
|
|
20
20
|
|
|
21
21
|
// solhint-disable-next-line var-name-mixedcase
|
|
22
|
-
bytes32 private
|
|
22
|
+
bytes32 private constant _PERMIT_TYPEHASH =
|
|
23
23
|
keccak256(
|
|
24
24
|
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
|
|
25
25
|
);
|
|
@@ -111,8 +111,6 @@ library Errors {
|
|
|
111
111
|
error MsgNotFromSendEndpoint(address sender);
|
|
112
112
|
error MsgNotFromReceiveEndpoint(address sender);
|
|
113
113
|
error InsufficientFeeToSendMsg(uint256 currentFee, uint256 requiredFee);
|
|
114
|
-
error ApproxDstExecutionGasNotSet();
|
|
115
|
-
error InvalidRetryData();
|
|
116
114
|
|
|
117
115
|
// GENERIC MSG
|
|
118
116
|
error ArrayLengthMismatch();
|
|
@@ -120,7 +118,7 @@ library Errors {
|
|
|
120
118
|
error ArrayOutOfBounds();
|
|
121
119
|
error ZeroAddress();
|
|
122
120
|
|
|
123
|
-
error
|
|
121
|
+
error OnlyCelerBus();
|
|
124
122
|
error OnlyYT();
|
|
125
123
|
error OnlyYCFactory();
|
|
126
124
|
error OnlyWhitelisted();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.8.0;
|
|
4
|
+
|
|
5
|
+
interface ICelerMessageBus {
|
|
6
|
+
/**
|
|
7
|
+
* @notice Calculates the required fee for the message.
|
|
8
|
+
* @param _message Arbitrary message bytes to be decoded by the destination app contract.
|
|
9
|
+
@ @return The required fee.
|
|
10
|
+
*/
|
|
11
|
+
function calcFee(bytes calldata _message) external view returns (uint256);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @notice Sends a message to a contract on another chain.
|
|
15
|
+
* Sender needs to make sure the uniqueness of the message Id, which is computed as
|
|
16
|
+
* hash(type.MessageOnly, sender, receiver, srcChainId, srcTxHash, dstChainId, message).
|
|
17
|
+
* If messages with the same Id are sent, only one of them will succeed at dst chain..
|
|
18
|
+
* A fee is charged in the native gas token.
|
|
19
|
+
* @param _receiver The address of the destination app contract.
|
|
20
|
+
* @param _dstChainId The destination chain ID.
|
|
21
|
+
* @param _message Arbitrary message bytes to be decoded by the destination app contract.
|
|
22
|
+
*/
|
|
23
|
+
function sendMessage(
|
|
24
|
+
address _receiver,
|
|
25
|
+
uint256 _dstChainId,
|
|
26
|
+
bytes calldata _message
|
|
27
|
+
) external payable;
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.8.0;
|
|
4
|
+
|
|
5
|
+
interface ICelerMessageReceiverApp {
|
|
6
|
+
enum ExecutionStatus {
|
|
7
|
+
Fail, // execution failed, finalized
|
|
8
|
+
Success, // execution succeeded, finalized
|
|
9
|
+
Retry // execution rejected, can retry later
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @notice Called by MessageBus (MessageBusReceiver)
|
|
14
|
+
* @param _sender The address of the source app contract
|
|
15
|
+
* @param _srcChainId The source chain ID where the transfer is originated from
|
|
16
|
+
* @param _message Arbitrary message bytes originated from and encoded by the source app contract
|
|
17
|
+
* @param _executor Address who called the MessageBus execution function
|
|
18
|
+
*/
|
|
19
|
+
function executeMessage(
|
|
20
|
+
address _sender,
|
|
21
|
+
uint64 _srcChainId,
|
|
22
|
+
bytes calldata _message,
|
|
23
|
+
address _executor
|
|
24
|
+
) external payable returns (ExecutionStatus);
|
|
25
|
+
}
|
|
@@ -6,14 +6,12 @@ interface IPMsgSendEndpoint {
|
|
|
6
6
|
function calcFee(
|
|
7
7
|
address dstAddress,
|
|
8
8
|
uint256 dstChainId,
|
|
9
|
-
bytes
|
|
10
|
-
bytes memory adapterParams
|
|
9
|
+
bytes calldata message
|
|
11
10
|
) external view returns (uint256);
|
|
12
11
|
|
|
13
12
|
function sendMessage(
|
|
14
13
|
address dstAddress,
|
|
15
14
|
uint256 dstChainId,
|
|
16
|
-
bytes calldata
|
|
17
|
-
bytes calldata adapterParams
|
|
15
|
+
bytes calldata message
|
|
18
16
|
) external payable;
|
|
19
17
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deployer": "0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7",
|
|
3
|
+
"network": 1,
|
|
4
|
+
"splitter": "0x1e56299EbC8A1010cEc26005d12e3e5c5cC2db00",
|
|
5
|
+
"celerBus": "0x4066D196A423b2b3B8B054f4F40efB47a74E200C",
|
|
6
|
+
"treasury": "0x8D407705b0a3d78167E979f71e009F5820f51C5E",
|
|
7
|
+
"PENDLE": "0x59968008a703dC13E6beaECed644bdCe4ee45d13",
|
|
8
|
+
"yieldContractFactory": "0xaD511b12F73c145Cf158EB92E4fa256937d952A4",
|
|
9
|
+
"marketFactory": "0x4d717868F4Bd14ac8B29Bb6361901e30Ae05e340",
|
|
10
|
+
"router": "0xB4205a645c7e920BD8504181B1D7f2c5C955C3e7",
|
|
11
|
+
"routerStatic": "0x96F77F24b3d17166FcaF3a9E3B8330fF38B966F9",
|
|
12
|
+
"vePendle": "0x6875e4a945e498fe1b90bbb13cfbaf0b68658c9c",
|
|
13
|
+
"senderEndpoint": "0xd5C47D2383Fddc19596489280C0A33AC42b2bB18",
|
|
14
|
+
"votingController": "0xC33B62D73cf92970e71Ce2A6162C63D4bd7AeB26",
|
|
15
|
+
"gaugeController": "0x998CF52b2585e05494BF9F2bF502351a9C7FdA8f"
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"symbol": "SY-testETH",
|
|
3
|
+
"SY": "0xaA7495dcbe99A8dbd0cfA8b27b95f77565a077c8",
|
|
4
|
+
"expiry": 1680134400,
|
|
5
|
+
"PT": "0xc7fCFEfB2055ba61118C93722feECDD4A72E160D",
|
|
6
|
+
"YT": "0xc4a38a6236B2BcF4f4B25690B4B5f770aD8B1195",
|
|
7
|
+
"market": "0x8967Eff7FD95491573576534ed24bD9F5E89fEB2"
|
|
8
|
+
}
|