@pendle/core-v2 5.1.1-beta → 5.1.1
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/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +67 -23
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.json +19 -6
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol/SYBaseWithoutPermitUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol/{SYBaseUpg.json → SYBaseWithoutPermitUpg.json} +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol/PendleStkGHOSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol/PendleStkGHOSY.json +1160 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleSUSDEMantleSY.sol/PendleSUSDEMantleSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleSUSDEMantleSY.sol/PendleSUSDEMantleSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleUSDEL2SY.sol/PendleUSDEL2SY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleUSDEL2SY.sol/PendleUSDEL2SY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/EtherFi/PendleEBTCSY.sol/PendleEBTCSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/EtherFi/PendleEBTCSY.sol/PendleEBTCSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/EtherFi/PendleEEigenSYUpg.sol/PendleEEigenSYUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/EtherFi/PendleEEigenSYUpg.sol/PendleEEigenSYUpg.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/EtherFi/PendleWEEthkSY.sol/PendleWEEthkSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/EtherFi/PendleWEEthkSY.sol/PendleWEEthkSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/EtherFi/PendleWEEthsSY.sol/PendleWEEthsSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/EtherFi/PendleWEEthsSY.sol/PendleWEEthsSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mantle/PendleCMETHSY.sol/PendleCMETHSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mantle/PendleCMETHSY.sol/PendleCMETHSY.json +1049 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC20SYUpg.sol/PendleERC20SYUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC20SYUpg.sol/PendleERC20SYUpg.json +2 -2
- package/build/artifacts/contracts/interfaces/AaveV3/IAaveStkGHO.sol/IAaveStkGHO.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/AaveV3/IAaveStkGHO.sol/IAaveStkGHO.json +116 -0
- package/build/artifacts/contracts/interfaces/Angle/IAngleDistributor.sol/IAngleDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Angle/IAngleDistributor.sol/IAngleDistributor.json +39 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.json +27 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +2 -2
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -2
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -2
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -2
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +2 -2
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.json +2 -2
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +2 -2
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +27 -6
- package/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +3 -2
- package/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol +1 -1
- package/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol +130 -0
- package/contracts/core/StandardizedYield/implementations/EtherFi/PendleEEigenSYUpg.sol +6 -2
- package/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol +1 -2
- package/contracts/core/StandardizedYield/implementations/Mantle/PendleCMETHSY.sol +82 -0
- package/contracts/core/StandardizedYield/implementations/PendleERC20SYUpg.sol +6 -1
- package/contracts/interfaces/AaveV3/IAaveStkGHO.sol +17 -0
- package/contracts/interfaces/Angle/IAngleDistributor.sol +12 -0
- package/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol +5 -0
- package/contracts/router/swap-aggregator/IPSwapAggregator.sol +1 -1
- package/contracts/router/swap-aggregator/PendleSwap.sol +0 -43
- package/deployments/1-core.json +1 -1
- package/deployments/1-markets/STKGHO-MAINNET-APR2025.json +14 -0
- package/deployments/10-core.json +1 -1
- package/deployments/42161-core.json +1 -1
- package/deployments/42161-markets/DOLOMITE-USDC-ARBITRUM-JUN2025.json +14 -0
- package/deployments/42161-markets/DOLOMITE-WBTC-ARBITRUM-JUN2025.json +14 -0
- package/deployments/5000-core.json +1 -1
- package/deployments/5000-markets/CMETH-MANTLE-FEB2025.json +14 -0
- package/deployments/56-core.json +1 -1
- package/deployments/56-markets/VENUS-BNB-BSC-JUN2025.json +14 -0
- package/package.json +1 -1
- package/typechain-types/IAaveStkGHO.ts +269 -0
- package/typechain-types/IAngleDistributor.ts +117 -0
- package/typechain-types/PendleCMETHSY.ts +1349 -0
- package/typechain-types/PendleStkGHOSY.ts +1522 -0
- package/typechain-types/PendleVotingControllerUpg.ts +135 -43
- package/typechain-types/SYBaseWithoutPermitUpg.ts +1101 -0
- package/typechain-types/VotingControllerStorageUpg.ts +34 -15
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
- package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMiscV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSimple__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageV4__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/IAaveStkGHO__factory.ts +128 -0
- package/typechain-types/factories/IAngleDistributor__factory.ts +54 -0
- package/typechain-types/factories/PendleCMETHSY__factory.ts +1099 -0
- package/typechain-types/factories/PendleEBTCSY__factory.ts +1 -1
- package/typechain-types/factories/PendleEEigenSYUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20SYUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGlpSY__factory.ts +1 -1
- package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
- package/typechain-types/factories/PendleSUSDEMantleSY__factory.ts +1 -1
- package/typechain-types/factories/PendleStkGHOSY__factory.ts +1213 -0
- package/typechain-types/factories/PendleSwap__factory.ts +1 -1
- package/typechain-types/factories/PendleUSDEL2SY__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +66 -22
- package/typechain-types/factories/PendleWEEthkSY__factory.ts +1 -1
- package/typechain-types/factories/PendleWEEthsSY__factory.ts +1 -1
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/factories/SDKErrorsDirectory__factory.ts +26 -1
- package/typechain-types/factories/SYBaseWithoutPermitUpg__factory.ts +871 -0
- package/typechain-types/factories/VotingControllerStorageUpg__factory.ts +19 -6
- package/typechain-types/hardhat.d.ts +40 -13
- package/typechain-types/index.ts +10 -2
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol/SYBaseUpg.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.json +0 -82
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "MarketApproxPtInLib",
|
|
4
4
|
"sourceName": "contracts/router/math/MarketApproxLib.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220d2de33a62a0433751e7fab74313f6fe1c53f3958d792893c45ff75f8ff7ed6e964736f6c63430008170033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220d2de33a62a0433751e7fab74313f6fe1c53f3958d792893c45ff75f8ff7ed6e964736f6c63430008170033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "MarketApproxPtOutLib",
|
|
4
4
|
"sourceName": "contracts/router/math/MarketApproxLib.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e1b98481c9ecd178ed7ac6fdf1c1a456e263ff34c05267454ff02e7b8d96c2bf64736f6c63430008170033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e1b98481c9ecd178ed7ac6fdf1c1a456e263ff34c05267454ff02e7b8d96c2bf64736f6c63430008170033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "MarketApproxPtInLibOnchain",
|
|
4
4
|
"sourceName": "contracts/router/math/MarketApproxLibOnchain.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ba609af17d6a906f12570187994d6ff54e303f2ff7df003bfd0a50395f0efceb64736f6c63430008170033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ba609af17d6a906f12570187994d6ff54e303f2ff7df003bfd0a50395f0efceb64736f6c63430008170033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "MarketApproxPtOutLibOnchain",
|
|
4
4
|
"sourceName": "contracts/router/math/MarketApproxLibOnchain.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a1e2c5f1680419fc14e0dcd1a8697a8da1d2cd0874b903a29aef58e74e29048d64736f6c63430008170033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a1e2c5f1680419fc14e0dcd1a8697a8da1d2cd0874b903a29aef58e74e29048d64736f6c63430008170033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"type": "receive"
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
"bytecode": "
|
|
70
|
-
"deployedBytecode": "
|
|
69
|
+
"bytecode": "0x60a0604052732f577a41bec1be1152aeea12e73b7391d15f655d60805234801561002857600080fd5b506080516109b261004a600039600081816060015261026f01526109b26000f3fe60806040526004361061002d5760003560e01c80632bdb823c146100395780638930af571461004e57600080fd5b3661003457005b600080fd5b61004c61004736600461061e565b61009e565b005b34801561005a57600080fd5b506100827f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100b7836100b2604084016020850161067b565b610176565b6101706100ca60808301606084016106ae565b610115576100db60408301836106cb565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061013892505050565b6101386101256020840184610718565b61013260408501856106cb565b8661023a565b6001600160a01b0385161561014e576000610150565b835b610160604085016020860161067b565b6001600160a01b03169190610359565b50505050565b6001600160a01b038216610188575050565b61019a60026001600160601b03610739565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526001600160601b03929092169184169063dd62ed3e90604401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610217919061076d565b1015610236576102298282600061037f565b610236828260001961037f565b5050565b6060600185600381111561025057610250610786565b036103495760405163726d379760e11b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e4da6f2e906102a89088908890889060040161079c565b600060405180830381865afa1580156102c5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102ed919081019061080f565b92509050806103435760405162461bcd60e51b815260206004820181905260248201527f50656e646c65537761703a204b79626572207363616c696e67206661696c656460448201526064015b60405180910390fd5b50610351565b6103516108d1565b949350505050565b606061035184848460405180606001604052806029815260200161095460299139610489565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b17905291516000928392908716916103db91906108e7565b6000604051808303816000865af19150503d8060008114610418576040519150601f19603f3d011682016040523d82523d6000602084013e61041d565b606091505b50915091508180156104475750805115806104475750808060200190518101906104479190610903565b6104825760405162461bcd60e51b815260206004820152600c60248201526b5361666520417070726f766560a01b604482015260640161033a565b5050505050565b6060824710156104ea5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161033a565b600080866001600160a01b0316858760405161050691906108e7565b60006040518083038185875af1925050503d8060008114610543576040519150601f19603f3d011682016040523d82523d6000602084013e610548565b606091505b509150915061055987838387610564565b979650505050505050565b606083156105d35782516000036105cc576001600160a01b0385163b6105cc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161033a565b5081610351565b61035183838151156105e85781518083602001fd5b8060405162461bcd60e51b815260040161033a9190610920565b80356001600160a01b038116811461061957600080fd5b919050565b60008060006060848603121561063357600080fd5b61063c84610602565b92506020840135915060408401356001600160401b0381111561065e57600080fd5b84016080818703121561067057600080fd5b809150509250925092565b60006020828403121561068d57600080fd5b61069682610602565b9392505050565b80151581146106ab57600080fd5b50565b6000602082840312156106c057600080fd5b81356106968161069d565b6000808335601e198436030181126106e257600080fd5b8301803591506001600160401b038211156106fc57600080fd5b60200191503681900382131561071157600080fd5b9250929050565b60006020828403121561072a57600080fd5b81356004811061069657600080fd5b60006001600160601b038381168061076157634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b60006020828403121561077f57600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b604081528260408201528284606083013760006060848301015260006060601f19601f8601168301019050826020830152949350505050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156108065781810151838201526020016107ee565b50506000910152565b6000806040838503121561082257600080fd5b825161082d8161069d565b60208401519092506001600160401b038082111561084a57600080fd5b818501915085601f83011261085e57600080fd5b815181811115610870576108706107d5565b604051601f8201601f19908116603f01168101908382118183101715610898576108986107d5565b816040528281528860208487010111156108b157600080fd5b6108c28360208301602088016107eb565b80955050505050509250929050565b634e487b7160e01b600052600160045260246000fd5b600082516108f98184602087016107eb565b9190910192915050565b60006020828403121561091557600080fd5b81516106968161069d565b602081526000825180602084015261093f8160408501602087016107eb565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a26469706673582212206591470c2f8d6c170503826a8e695308f346c84d36432f84e1b82ac848722c1364736f6c63430008170033",
|
|
70
|
+
"deployedBytecode": "0x60806040526004361061002d5760003560e01c80632bdb823c146100395780638930af571461004e57600080fd5b3661003457005b600080fd5b61004c61004736600461061e565b61009e565b005b34801561005a57600080fd5b506100827f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100b7836100b2604084016020850161067b565b610176565b6101706100ca60808301606084016106ae565b610115576100db60408301836106cb565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061013892505050565b6101386101256020840184610718565b61013260408501856106cb565b8661023a565b6001600160a01b0385161561014e576000610150565b835b610160604085016020860161067b565b6001600160a01b03169190610359565b50505050565b6001600160a01b038216610188575050565b61019a60026001600160601b03610739565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526001600160601b03929092169184169063dd62ed3e90604401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610217919061076d565b1015610236576102298282600061037f565b610236828260001961037f565b5050565b6060600185600381111561025057610250610786565b036103495760405163726d379760e11b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e4da6f2e906102a89088908890889060040161079c565b600060405180830381865afa1580156102c5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102ed919081019061080f565b92509050806103435760405162461bcd60e51b815260206004820181905260248201527f50656e646c65537761703a204b79626572207363616c696e67206661696c656460448201526064015b60405180910390fd5b50610351565b6103516108d1565b949350505050565b606061035184848460405180606001604052806029815260200161095460299139610489565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b17905291516000928392908716916103db91906108e7565b6000604051808303816000865af19150503d8060008114610418576040519150601f19603f3d011682016040523d82523d6000602084013e61041d565b606091505b50915091508180156104475750805115806104475750808060200190518101906104479190610903565b6104825760405162461bcd60e51b815260206004820152600c60248201526b5361666520417070726f766560a01b604482015260640161033a565b5050505050565b6060824710156104ea5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161033a565b600080866001600160a01b0316858760405161050691906108e7565b60006040518083038185875af1925050503d8060008114610543576040519150601f19603f3d011682016040523d82523d6000602084013e610548565b606091505b509150915061055987838387610564565b979650505050505050565b606083156105d35782516000036105cc576001600160a01b0385163b6105cc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161033a565b5081610351565b61035183838151156105e85781518083602001fd5b8060405162461bcd60e51b815260040161033a9190610920565b80356001600160a01b038116811461061957600080fd5b919050565b60008060006060848603121561063357600080fd5b61063c84610602565b92506020840135915060408401356001600160401b0381111561065e57600080fd5b84016080818703121561067057600080fd5b809150509250925092565b60006020828403121561068d57600080fd5b61069682610602565b9392505050565b80151581146106ab57600080fd5b50565b6000602082840312156106c057600080fd5b81356106968161069d565b6000808335601e198436030181126106e257600080fd5b8301803591506001600160401b038211156106fc57600080fd5b60200191503681900382131561071157600080fd5b9250929050565b60006020828403121561072a57600080fd5b81356004811061069657600080fd5b60006001600160601b038381168061076157634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b60006020828403121561077f57600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b604081528260408201528284606083013760006060848301015260006060601f19601f8601168301019050826020830152949350505050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156108065781810151838201526020016107ee565b50506000910152565b6000806040838503121561082257600080fd5b825161082d8161069d565b60208401519092506001600160401b038082111561084a57600080fd5b818501915085601f83011261085e57600080fd5b815181811115610870576108706107d5565b604051601f8201601f19908116603f01168101908382118183101715610898576108986107d5565b816040528281528860208487010111156108b157600080fd5b6108c28360208301602088016107eb565b80955050505050509250929050565b634e487b7160e01b600052600160045260246000fd5b600082516108f98184602087016107eb565b9190910192915050565b60006020828403121561091557600080fd5b81516106968161069d565b602081526000825180602084015261093f8160408501602087016107eb565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a26469706673582212206591470c2f8d6c170503826a8e695308f346c84d36432f84e1b82ac848722c1364736f6c63430008170033",
|
|
71
71
|
"linkReferences": {},
|
|
72
72
|
"deployedLinkReferences": {}
|
|
73
73
|
}
|
|
@@ -150,8 +150,13 @@ contract PendleVotingControllerUpg is PendleMsgSenderAppUpg, VotingControllerSto
|
|
|
150
150
|
GOVERNANCE-ONLY FUNCTIONS
|
|
151
151
|
//////////////////////////////////////////////////////////////*/
|
|
152
152
|
|
|
153
|
-
modifier
|
|
154
|
-
require(msg.sender ==
|
|
153
|
+
modifier onlyAddPoolHelperAndOwner() {
|
|
154
|
+
require(msg.sender == addPoolHelper || msg.sender == owner, "add pool not allowed");
|
|
155
|
+
_;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
modifier onlyRemovePoolHelperAndOwner() {
|
|
159
|
+
require(msg.sender == removePoolHelper || msg.sender == owner, "remove pool not allowed");
|
|
155
160
|
_;
|
|
156
161
|
}
|
|
157
162
|
|
|
@@ -162,7 +167,7 @@ contract PendleVotingControllerUpg is PendleMsgSenderAppUpg, VotingControllerSto
|
|
|
162
167
|
* - `pool` must not have been added before (even if has been removed).
|
|
163
168
|
* - `chainId` must be valid.
|
|
164
169
|
*/
|
|
165
|
-
function addPool(uint64 chainId, address pool) external
|
|
170
|
+
function addPool(uint64 chainId, address pool) external onlyAddPoolHelperAndOwner {
|
|
166
171
|
if (_isPoolActive(pool)) revert Errors.VCPoolAlreadyActive(pool);
|
|
167
172
|
if (allRemovedPools.contains(pool)) revert Errors.VCPoolAlreadyAddAndRemoved(pool);
|
|
168
173
|
|
|
@@ -170,13 +175,25 @@ contract PendleVotingControllerUpg is PendleMsgSenderAppUpg, VotingControllerSto
|
|
|
170
175
|
emit AddPool(chainId, pool);
|
|
171
176
|
}
|
|
172
177
|
|
|
178
|
+
function addMultiPools(uint64[] memory chainIds, address[] memory pools) external onlyAddPoolHelperAndOwner {
|
|
179
|
+
if (chainIds.length != pools.length) revert Errors.ArrayLengthMismatch();
|
|
180
|
+
for (uint256 i = 0; i < chainIds.length; ++i) {
|
|
181
|
+
(uint64 chainId, address pool) = (chainIds[i], pools[i]);
|
|
182
|
+
if (_isPoolActive(pool)) revert Errors.VCPoolAlreadyActive(pool);
|
|
183
|
+
if (allRemovedPools.contains(pool)) revert Errors.VCPoolAlreadyAddAndRemoved(pool);
|
|
184
|
+
|
|
185
|
+
_addPool(chainId, pool);
|
|
186
|
+
emit AddPool(chainId, pool);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
173
190
|
/**
|
|
174
191
|
* @notice remove a pool from voting. Can only be done by governance
|
|
175
192
|
* @custom:gov NOTE TO GOV:
|
|
176
193
|
* - Previous week's results should have been broadcasted prior to calling this function.
|
|
177
194
|
* - `pool` must be currently active.
|
|
178
195
|
*/
|
|
179
|
-
function removePool(address pool) external
|
|
196
|
+
function removePool(address pool) external onlyRemovePoolHelperAndOwner {
|
|
180
197
|
if (!_isPoolActive(pool)) revert Errors.VCInactivePool(pool);
|
|
181
198
|
|
|
182
199
|
uint64 chainId = poolData[pool].chainId;
|
|
@@ -263,8 +280,12 @@ contract PendleVotingControllerUpg is PendleMsgSenderAppUpg, VotingControllerSto
|
|
|
263
280
|
}
|
|
264
281
|
}
|
|
265
282
|
|
|
266
|
-
function
|
|
267
|
-
|
|
283
|
+
function setAddPoolHelper(address _helper) public onlyOwner {
|
|
284
|
+
addPoolHelper = _helper;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function setRemovePoolHelper(address _helper) public onlyOwner {
|
|
288
|
+
removePoolHelper = _helper;
|
|
268
289
|
}
|
|
269
290
|
|
|
270
291
|
//solhint-disable-next-line
|
|
@@ -73,9 +73,10 @@ abstract contract VotingControllerStorageUpg is IPVotingController {
|
|
|
73
73
|
// [user][pool] => checkpoint
|
|
74
74
|
mapping(address => mapping(address => Checkpoints.History)) internal __dep_userPoolHistory;
|
|
75
75
|
|
|
76
|
-
address public
|
|
76
|
+
address public addPoolHelper;
|
|
77
|
+
address public removePoolHelper;
|
|
77
78
|
|
|
78
|
-
uint256[
|
|
79
|
+
uint256[98] private __gap;
|
|
79
80
|
|
|
80
81
|
constructor(address _vePendle) {
|
|
81
82
|
vePendle = IPVeToken(_vePendle);
|
|
@@ -12,7 +12,7 @@ import "../libraries/Errors.sol";
|
|
|
12
12
|
import "../libraries/BoringOwnableUpgradeable.sol";
|
|
13
13
|
import "@openzeppelin/contracts/security/Pausable.sol";
|
|
14
14
|
|
|
15
|
-
abstract contract
|
|
15
|
+
abstract contract SYBaseWithoutPermitUpg is IStandardizedYield, PendleERC20Upg, TokenHelper, BoringOwnableUpgradeable, Pausable {
|
|
16
16
|
using PMath for uint256;
|
|
17
17
|
|
|
18
18
|
address public immutable yieldToken;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../SYBaseWithRewardsUpg.sol";
|
|
5
|
+
import "../../../../interfaces/AaveV3/IAaveStkGHO.sol";
|
|
6
|
+
import "../../../../interfaces/Angle/IAngleDistributor.sol";
|
|
7
|
+
|
|
8
|
+
contract PendleStkGHOSY is SYBaseWithRewardsUpg {
|
|
9
|
+
using PMath for uint256;
|
|
10
|
+
|
|
11
|
+
event ClaimedOffchainGHO(uint256 amountClaimed);
|
|
12
|
+
|
|
13
|
+
address public constant ANGLE_DISTRIBUTOR = 0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae;
|
|
14
|
+
address public constant STKGHO = 0x1a88Df1cFe15Af22B3c4c783D4e6F7F9e0C1885d;
|
|
15
|
+
address public constant GHO = 0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f;
|
|
16
|
+
address public constant AAVE = 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9;
|
|
17
|
+
bytes32 public constant ZERO_REWARD_ERROR = 0x33d2eb294587ef7b32eb48e48695ebfec45a9c8922ec7d1c444cfad1fb208e8d;
|
|
18
|
+
|
|
19
|
+
constructor() SYBaseUpg(STKGHO) {}
|
|
20
|
+
|
|
21
|
+
function initialize() external initializer {
|
|
22
|
+
__SYBaseUpg_init("SY stk GHO", "SY-stkGHO");
|
|
23
|
+
_safeApproveInf(GHO, STKGHO);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function _deposit(address tokenIn, uint256 amountDeposited) internal virtual override returns (uint256) {
|
|
27
|
+
if (tokenIn == STKGHO) {
|
|
28
|
+
return amountDeposited;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
uint256 preBalance = _selfBalance(STKGHO);
|
|
32
|
+
IAaveStkGHO(STKGHO).stake(address(this), amountDeposited);
|
|
33
|
+
return _selfBalance(STKGHO) - preBalance;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function _redeem(
|
|
37
|
+
address receiver,
|
|
38
|
+
address /*tokenOut*/,
|
|
39
|
+
uint256 amountSharesToRedeem
|
|
40
|
+
) internal virtual override returns (uint256) {
|
|
41
|
+
_transferOut(STKGHO, receiver, amountSharesToRedeem);
|
|
42
|
+
return amountSharesToRedeem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/*///////////////////////////////////////////////////////////////
|
|
46
|
+
EXCHANGE-RATE
|
|
47
|
+
//////////////////////////////////////////////////////////////*/
|
|
48
|
+
|
|
49
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
50
|
+
return PMath.ONE.divDown(IAaveStkGHO(STKGHO).getExchangeRate());
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/*///////////////////////////////////////////////////////////////
|
|
54
|
+
REWARDS-RELATED
|
|
55
|
+
//////////////////////////////////////////////////////////////*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @dev See {IStandardizedYield-getRewardTokens}
|
|
59
|
+
*/
|
|
60
|
+
function _getRewardTokens() internal pure override returns (address[] memory) {
|
|
61
|
+
return ArrayLib.create(AAVE);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function _redeemExternalReward() internal override {
|
|
65
|
+
try IAaveStkGHO(STKGHO).claimRewards(address(this), type(uint256).max) {} catch Error(
|
|
66
|
+
string memory errorString
|
|
67
|
+
) {
|
|
68
|
+
// StkGHO claim reverts when claimable amount = 0, meaning two sy transfers in diff block/same timestamp would revert.
|
|
69
|
+
// This is expected to not happen at all on ETH mainnet but just to be sure.
|
|
70
|
+
if (keccak256(abi.encodePacked(errorString)) != ZERO_REWARD_ERROR) {
|
|
71
|
+
revert(errorString);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function claimOffchainGHORewards(
|
|
77
|
+
address[] calldata users,
|
|
78
|
+
address[] calldata tokens,
|
|
79
|
+
uint256[] calldata amounts,
|
|
80
|
+
bytes32[][] calldata proofs
|
|
81
|
+
) external onlyOwner {
|
|
82
|
+
uint256 preBalance = _selfBalance(GHO);
|
|
83
|
+
IAngleDistributor(ANGLE_DISTRIBUTOR).claim(users, tokens, amounts, proofs);
|
|
84
|
+
uint256 amountClaimed = _selfBalance(GHO) - preBalance;
|
|
85
|
+
|
|
86
|
+
if (amountClaimed > 0) {
|
|
87
|
+
_transferOut(GHO, msg.sender, amountClaimed);
|
|
88
|
+
emit ClaimedOffchainGHO(amountClaimed);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/*///////////////////////////////////////////////////////////////
|
|
93
|
+
MISC FUNCTIONS FOR METADATA
|
|
94
|
+
//////////////////////////////////////////////////////////////*/
|
|
95
|
+
|
|
96
|
+
function _previewDeposit(
|
|
97
|
+
address tokenIn,
|
|
98
|
+
uint256 amountTokenToDeposit
|
|
99
|
+
) internal view override returns (uint256 amountSharesOut) {
|
|
100
|
+
if (tokenIn == STKGHO) return amountTokenToDeposit;
|
|
101
|
+
return IAaveStkGHO(STKGHO).previewStake(amountTokenToDeposit);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _previewRedeem(
|
|
105
|
+
address /*tokenOut*/,
|
|
106
|
+
uint256 amountSharesToRedeem
|
|
107
|
+
) internal view override returns (uint256 amountTokenOut) {
|
|
108
|
+
return amountSharesToRedeem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function getTokensIn() public view virtual override returns (address[] memory) {
|
|
112
|
+
return ArrayLib.create(GHO, STKGHO);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function getTokensOut() public view virtual override returns (address[] memory) {
|
|
116
|
+
return ArrayLib.create(STKGHO);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
120
|
+
return token == GHO || token == STKGHO;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
124
|
+
return token == STKGHO;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
128
|
+
return (AssetType.TOKEN, GHO, IERC20Metadata(GHO).decimals());
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -56,12 +56,16 @@ contract PendleEEigenSYUpg is PendleERC20SYUpg {
|
|
|
56
56
|
|
|
57
57
|
/// =================================================================
|
|
58
58
|
|
|
59
|
-
|
|
60
59
|
function exchangeRate() public view virtual override returns (uint256) {
|
|
61
60
|
return IVedaAccountant(vedaAccountant).getRateInQuoteSafe(EIGEN);
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
function assetInfo()
|
|
63
|
+
function assetInfo()
|
|
64
|
+
external
|
|
65
|
+
view
|
|
66
|
+
override
|
|
67
|
+
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
68
|
+
{
|
|
65
69
|
return (AssetType.TOKEN, EIGEN, IERC20Metadata(EIGEN).decimals());
|
|
66
70
|
}
|
|
67
71
|
}
|
|
@@ -15,7 +15,7 @@ contract PendleGlpSY is SYBaseWithRewardsUpg, GLPPreviewHelper {
|
|
|
15
15
|
address public immutable stakedGlp;
|
|
16
16
|
address public immutable rewardRouter;
|
|
17
17
|
address public immutable glpRouter;
|
|
18
|
-
address public immutable glpManager;
|
|
18
|
+
address public immutable glpManager = 0x3963FfC9dff443c2A94f21b129D429891E32ec18;
|
|
19
19
|
address public immutable weth;
|
|
20
20
|
|
|
21
21
|
constructor(
|
|
@@ -31,7 +31,6 @@ contract PendleGlpSY is SYBaseWithRewardsUpg, GLPPreviewHelper {
|
|
|
31
31
|
stakedGlp = _stakedGlp;
|
|
32
32
|
rewardRouter = _rewardRouter;
|
|
33
33
|
glpRouter = _glpRouter;
|
|
34
|
-
glpManager = IRewardRouterV2(glpRouter).glpManager();
|
|
35
34
|
weth = IRewardRouterV2(glpRouter).weth();
|
|
36
35
|
}
|
|
37
36
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../SYBase.sol";
|
|
5
|
+
import "../../../../interfaces/IPExchangeRateOracle.sol";
|
|
6
|
+
|
|
7
|
+
contract PendleCMETHSY is SYBase {
|
|
8
|
+
using PMath for int256;
|
|
9
|
+
|
|
10
|
+
address public exchangeRateOracle = 0x1E2Ad9764cfAc60876486A7c714bc71f5b55f5C2;
|
|
11
|
+
address public constant CMETH = 0xE6829d9a7eE3040e1276Fa75293Bde931859e8fA;
|
|
12
|
+
address public constant WETH = 0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111;
|
|
13
|
+
|
|
14
|
+
constructor() SYBase("SY cmETH", "SY-cmETH", CMETH) {}
|
|
15
|
+
|
|
16
|
+
function setExchangeRateOracle(address newOracle) external onlyOwner {
|
|
17
|
+
exchangeRateOracle = newOracle;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/*///////////////////////////////////////////////////////////////
|
|
21
|
+
DEPOSIT/REDEEM USING BASE TOKENS
|
|
22
|
+
//////////////////////////////////////////////////////////////*/
|
|
23
|
+
|
|
24
|
+
function _deposit(address, uint256 amountDeposited) internal pure override returns (uint256 /*amountSharesOut*/) {
|
|
25
|
+
return amountDeposited;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _redeem(
|
|
29
|
+
address receiver,
|
|
30
|
+
address tokenOut,
|
|
31
|
+
uint256 amountSharesToRedeem
|
|
32
|
+
) internal override returns (uint256 /*amountTokenOut*/) {
|
|
33
|
+
_transferOut(tokenOut, receiver, amountSharesToRedeem);
|
|
34
|
+
return amountSharesToRedeem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*///////////////////////////////////////////////////////////////
|
|
38
|
+
EXCHANGE-RATE
|
|
39
|
+
//////////////////////////////////////////////////////////////*/
|
|
40
|
+
|
|
41
|
+
function exchangeRate() public view override returns (uint256) {
|
|
42
|
+
return IPExchangeRateOracle(exchangeRateOracle).getExchangeRate();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/*///////////////////////////////////////////////////////////////
|
|
46
|
+
MISC FUNCTIONS FOR METADATA
|
|
47
|
+
//////////////////////////////////////////////////////////////*/
|
|
48
|
+
|
|
49
|
+
function _previewDeposit(
|
|
50
|
+
address,
|
|
51
|
+
uint256 amountTokenToDeposit
|
|
52
|
+
) internal pure override returns (uint256 /*amountSharesOut*/) {
|
|
53
|
+
return amountTokenToDeposit;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _previewRedeem(
|
|
57
|
+
address,
|
|
58
|
+
uint256 amountSharesToRedeem
|
|
59
|
+
) internal pure override returns (uint256 /*amountTokenOut*/) {
|
|
60
|
+
return amountSharesToRedeem;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getTokensIn() public view override returns (address[] memory res) {
|
|
64
|
+
return ArrayLib.create(yieldToken);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function getTokensOut() public view override returns (address[] memory res) {
|
|
68
|
+
return ArrayLib.create(yieldToken);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function isValidTokenIn(address token) public view override returns (bool) {
|
|
72
|
+
return token == yieldToken;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function isValidTokenOut(address token) public view override returns (bool) {
|
|
76
|
+
return token == yieldToken;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
80
|
+
return (AssetType.TOKEN, WETH, 18);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -64,7 +64,12 @@ contract PendleERC20SYUpg is SYBaseUpg {
|
|
|
64
64
|
return token == yieldToken;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
function assetInfo()
|
|
67
|
+
function assetInfo()
|
|
68
|
+
external
|
|
69
|
+
view
|
|
70
|
+
virtual
|
|
71
|
+
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
72
|
+
{
|
|
68
73
|
return (AssetType.TOKEN, yieldToken, IERC20Metadata(yieldToken).decimals());
|
|
69
74
|
}
|
|
70
75
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.0;
|
|
4
|
+
|
|
5
|
+
interface IAaveStkGHO {
|
|
6
|
+
function stake(address to, uint256 amount) external;
|
|
7
|
+
|
|
8
|
+
function redeem(address to, uint256 amount) external;
|
|
9
|
+
|
|
10
|
+
function claimRewards(address to, uint256 amount) external;
|
|
11
|
+
|
|
12
|
+
function getExchangeRate() external view returns (uint216);
|
|
13
|
+
|
|
14
|
+
function previewStake(uint256 assets) external view returns (uint256);
|
|
15
|
+
|
|
16
|
+
function previewRedeem(uint256 shares) external view returns (uint256);
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.0;
|
|
4
|
+
|
|
5
|
+
interface IAngleDistributor {
|
|
6
|
+
function claim(
|
|
7
|
+
address[] calldata users,
|
|
8
|
+
address[] calldata tokens,
|
|
9
|
+
uint256[] calldata amounts,
|
|
10
|
+
bytes32[][] calldata proofs
|
|
11
|
+
) external;
|
|
12
|
+
}
|
|
@@ -254,4 +254,9 @@ library SDKErrorsDirectory {
|
|
|
254
254
|
error InvalidTimestamp();
|
|
255
255
|
error InvalidWithdrawalFee();
|
|
256
256
|
error InvalidTotalSupply();
|
|
257
|
+
error OperationNotAllowed();
|
|
258
|
+
error WOMBAT_COV_RATIO_LIMIT_EXCEEDED();
|
|
259
|
+
error NotEnoughLiquidity();
|
|
260
|
+
error InvalidAmountToDeposit();
|
|
261
|
+
error TellerWithMultiAssetSupport__AssetNotSupported();
|
|
257
262
|
}
|
|
@@ -32,35 +32,11 @@ contract PendleSwap is IPSwapAggregator, TokenHelper {
|
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
require(isSuccess, "PendleSwap: Kyber scaling failed");
|
|
35
|
-
} else if (swapType == SwapType.ODOS) {
|
|
36
|
-
scaledCallData = _odosScaling(rawCallData, amountIn);
|
|
37
35
|
} else {
|
|
38
36
|
assert(false);
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
function _odosScaling(
|
|
43
|
-
bytes calldata rawCallData,
|
|
44
|
-
uint256 amountIn
|
|
45
|
-
) internal pure returns (bytes memory scaledCallData) {
|
|
46
|
-
bytes4 selector = bytes4(rawCallData[:4]);
|
|
47
|
-
bytes calldata dataToDecode = rawCallData[4:];
|
|
48
|
-
|
|
49
|
-
assert(selector == IOdosRouterV2.swap.selector);
|
|
50
|
-
(
|
|
51
|
-
IOdosRouterV2.swapTokenInfo memory tokenInfo,
|
|
52
|
-
bytes memory pathDefinition,
|
|
53
|
-
address executor,
|
|
54
|
-
uint32 referralCode
|
|
55
|
-
) = abi.decode(dataToDecode, (IOdosRouterV2.swapTokenInfo, bytes, address, uint32));
|
|
56
|
-
|
|
57
|
-
tokenInfo.outputQuote = (tokenInfo.outputQuote * amountIn) / tokenInfo.inputAmount;
|
|
58
|
-
tokenInfo.outputMin = (tokenInfo.outputMin * amountIn) / tokenInfo.inputAmount;
|
|
59
|
-
tokenInfo.inputAmount = amountIn;
|
|
60
|
-
|
|
61
|
-
return abi.encodeWithSelector(selector, tokenInfo, pathDefinition, executor, referralCode);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
40
|
receive() external payable {}
|
|
65
41
|
}
|
|
66
42
|
|
|
@@ -70,22 +46,3 @@ interface IKyberScalingHelper {
|
|
|
70
46
|
uint256 newAmount
|
|
71
47
|
) external view returns (bool isSuccess, bytes memory data);
|
|
72
48
|
}
|
|
73
|
-
|
|
74
|
-
interface IOdosRouterV2 {
|
|
75
|
-
struct swapTokenInfo {
|
|
76
|
-
address inputToken;
|
|
77
|
-
uint256 inputAmount;
|
|
78
|
-
address inputReceiver;
|
|
79
|
-
address outputToken;
|
|
80
|
-
uint256 outputQuote;
|
|
81
|
-
uint256 outputMin;
|
|
82
|
-
address outputReceiver;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function swap(
|
|
86
|
-
swapTokenInfo memory tokenInfo,
|
|
87
|
-
bytes calldata pathDefinition,
|
|
88
|
-
address executor,
|
|
89
|
-
uint32 referralCode
|
|
90
|
-
) external payable returns (uint256 amountOut);
|
|
91
|
-
}
|