@pendle/core-v2 5.1.0 → 5.1.1-beta
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/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 +3 -3
- 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/PendleERC20SYUpg.sol/PendleERC20SYUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC20SYUpg.sol/PendleERC20SYUpg.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Venus/PendleVTokenRateHelper.sol/PendleVTokenRateHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Venus/PendleVTokenRateHelper.sol/PendleVTokenRateHelper.json +24 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Venus/PendleVenusBNBSY.sol/PendleVenusBNBSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Venus/PendleVenusBNBSY.sol/PendleVenusBNBSY.json +1139 -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/interfaces/Venus/IVenusBNB.sol/IVenusBNB.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Venus/IVenusBNB.sol/IVenusBNB.json +37 -0
- package/build/artifacts/contracts/interfaces/Venus/IVenusComptroller.sol/IVenusComptroller.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Venus/IVenusComptroller.sol/IVenusComptroller.json +29 -0
- package/build/artifacts/contracts/interfaces/Venus/IVenusInterestModel.sol/IVenusInterestRateModel.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Venus/IVenusInterestModel.sol/IVenusInterestRateModel.json +74 -0
- package/build/artifacts/contracts/interfaces/Venus/IVenusToken.sol/IVenusToken.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Venus/IVenusToken.sol/IVenusToken.json +128 -0
- 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/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/IOdosRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.json +82 -0
- 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/core/StandardizedYield/implementations/EtherFi/PendleEEigenSYUpg.sol +11 -0
- package/contracts/core/StandardizedYield/implementations/PendleERC20SYUpg.sol +1 -1
- package/contracts/core/StandardizedYield/implementations/Venus/PendleVTokenRateHelper.sol +76 -0
- package/contracts/core/StandardizedYield/implementations/Venus/PendleVenusBNBSY.sol +116 -0
- package/contracts/interfaces/Venus/IVenusBNB.sol +8 -0
- package/contracts/interfaces/Venus/IVenusComptroller.sol +6 -0
- package/contracts/interfaces/Venus/IVenusInterestModel.sol +13 -0
- package/contracts/interfaces/Venus/IVenusToken.sol +22 -0
- package/contracts/router/swap-aggregator/IPSwapAggregator.sol +1 -1
- package/contracts/router/swap-aggregator/PendleSwap.sol +43 -0
- package/deployments/1-core.json +1 -1
- package/deployments/1-markets/EEIGEN-MAINNET-MAR2025.json +14 -0
- package/deployments/10-core.json +1 -1
- package/deployments/42161-core.json +1 -1
- package/deployments/5000-core.json +1 -1
- package/deployments/56-core.json +1 -1
- package/package.json +1 -1
- package/typechain-types/IOdosRouterV2.ts +147 -0
- package/typechain-types/IVenusBNB.ts +124 -0
- package/typechain-types/IVenusComptroller.ts +106 -0
- package/typechain-types/IVenusInterestRateModel.ts +162 -0
- package/typechain-types/IVenusToken.ts +249 -0
- package/typechain-types/PendleEEigenSYUpg.ts +1 -3
- package/typechain-types/PendleVTokenRateHelper.ts +81 -0
- package/typechain-types/PendleVenusBNBSY.ts +1440 -0
- 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/IOdosRouterV2__factory.ts +94 -0
- package/typechain-types/factories/IVenusBNB__factory.ts +49 -0
- package/typechain-types/factories/IVenusComptroller__factory.ts +44 -0
- package/typechain-types/factories/IVenusInterestRateModel__factory.ts +93 -0
- package/typechain-types/factories/IVenusToken__factory.ts +140 -0
- package/typechain-types/factories/PendleEBTCSY__factory.ts +1 -1
- package/typechain-types/factories/PendleEEigenSYUpg__factory.ts +2 -2
- package/typechain-types/factories/PendleERC20SYUpg__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/PendleSwap__factory.ts +1 -1
- package/typechain-types/factories/PendleUSDEL2SY__factory.ts +1 -1
- package/typechain-types/factories/PendleVTokenRateHelper__factory.ts +43 -0
- package/typechain-types/factories/PendleVenusBNBSY__factory.ts +1192 -0
- 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/hardhat.d.ts +63 -18
- package/typechain-types/index.ts +14 -4
|
@@ -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": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220da643b87add84288dd162c91139bbf95d5c78614cb732d014f02ce9aa45d5c3e64736f6c63430008170033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220da643b87add84288dd162c91139bbf95d5c78614cb732d014f02ce9aa45d5c3e64736f6c63430008170033",
|
|
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": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bad487affab4f61235828e7014031ed28eb28c5b903f205ac723bb86e05a774f64736f6c63430008170033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bad487affab4f61235828e7014031ed28eb28c5b903f205ac723bb86e05a774f64736f6c63430008170033",
|
|
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": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203b20c166ed1d83e9b81522eaf007a930cdfbea7e52288ad671dc0e00a7ffa02264736f6c63430008170033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203b20c166ed1d83e9b81522eaf007a930cdfbea7e52288ad671dc0e00a7ffa02264736f6c63430008170033",
|
|
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": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212208b269dddddd7f28fc58e7af7f2d7a3609150935bffb207cc78c9bdbc85c8ff3164736f6c63430008170033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212208b269dddddd7f28fc58e7af7f2d7a3609150935bffb207cc78c9bdbc85c8ff3164736f6c63430008170033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "IOdosRouterV2",
|
|
4
|
+
"sourceName": "contracts/router/swap-aggregator/PendleSwap.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"components": [
|
|
10
|
+
{
|
|
11
|
+
"internalType": "address",
|
|
12
|
+
"name": "inputToken",
|
|
13
|
+
"type": "address"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"internalType": "uint256",
|
|
17
|
+
"name": "inputAmount",
|
|
18
|
+
"type": "uint256"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"internalType": "address",
|
|
22
|
+
"name": "inputReceiver",
|
|
23
|
+
"type": "address"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"internalType": "address",
|
|
27
|
+
"name": "outputToken",
|
|
28
|
+
"type": "address"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"internalType": "uint256",
|
|
32
|
+
"name": "outputQuote",
|
|
33
|
+
"type": "uint256"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"internalType": "uint256",
|
|
37
|
+
"name": "outputMin",
|
|
38
|
+
"type": "uint256"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"internalType": "address",
|
|
42
|
+
"name": "outputReceiver",
|
|
43
|
+
"type": "address"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"internalType": "struct IOdosRouterV2.swapTokenInfo",
|
|
47
|
+
"name": "tokenInfo",
|
|
48
|
+
"type": "tuple"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"internalType": "bytes",
|
|
52
|
+
"name": "pathDefinition",
|
|
53
|
+
"type": "bytes"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"internalType": "address",
|
|
57
|
+
"name": "executor",
|
|
58
|
+
"type": "address"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"internalType": "uint32",
|
|
62
|
+
"name": "referralCode",
|
|
63
|
+
"type": "uint32"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"name": "swap",
|
|
67
|
+
"outputs": [
|
|
68
|
+
{
|
|
69
|
+
"internalType": "uint256",
|
|
70
|
+
"name": "amountOut",
|
|
71
|
+
"type": "uint256"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"stateMutability": "payable",
|
|
75
|
+
"type": "function"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"bytecode": "0x",
|
|
79
|
+
"deployedBytecode": "0x",
|
|
80
|
+
"linkReferences": {},
|
|
81
|
+
"deployedLinkReferences": {}
|
|
82
|
+
}
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"type": "receive"
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
"bytecode": "
|
|
70
|
-
"deployedBytecode": "
|
|
69
|
+
"bytecode": "0x60a0604052732f577a41bec1be1152aeea12e73b7391d15f655d60805234801561002857600080fd5b50608051610dda61004a600039600081816060015261026f0152610dda6000f3fe60806040526004361061002d5760003560e01c80632bdb823c146100395780638930af571461004e57600080fd5b3661003457005b600080fd5b61004c610047366004610759565b61009e565b005b34801561005a57600080fd5b506100827f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100b7836100b260408401602085016107b8565b610176565b6101706100ca60808301606084016107ea565b610115576100db6040830183610807565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061013892505050565b6101386101256020840184610854565b6101326040850185610807565b8661023a565b6001600160a01b0385161561014e576000610150565b835b61016060408501602086016107b8565b6001600160a01b03169190610384565b50505050565b6001600160a01b038216610188575050565b61019a60026001600160601b0361088b565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526001600160601b03929092169184169063dd62ed3e90604401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021791906108b1565b101561023657610229828260006103aa565b61023682826000196103aa565b5050565b60606001856003811115610250576102506108ca565b036103495760405163726d379760e11b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e4da6f2e906102a8908890889088906004016108e0565b600060405180830381865afa1580156102c5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102ed91908101906109d2565b92509050806103435760405162461bcd60e51b815260206004820181905260248201527f50656e646c65537761703a204b79626572207363616c696e67206661696c656460448201526064015b60405180910390fd5b5061037c565b600285600381111561035d5761035d6108ca565b036103745761036d8484846104b4565b905061037c565b61037c610a63565b949350505050565b606061037c848484604051806060016040528060298152602001610d7c602991396105c8565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b17905291516000928392908716916104069190610a79565b6000604051808303816000865af19150503d8060008114610443576040519150601f19603f3d011682016040523d82523d6000602084013e610448565b606091505b50915091508180156104725750805115806104725750808060200190518101906104729190610a95565b6104ad5760405162461bcd60e51b815260206004820152600c60248201526b5361666520417070726f766560a01b604482015260640161033a565b5050505050565b606060006104c56004828688610ab2565b6104ce91610adc565b90503660006104e0866004818a610ab2565b90925090506001600160e01b03198316630ed8d73960e21b1461050557610505610a63565b600080808061051685870187610b81565b935093509350935083602001518985608001516105339190610c67565b61053d9190610c92565b6080850152602084015160a0850151610557908b90610c67565b6105619190610c92565b60a0850152602084018990526040518790610586908690869086908690602401610cd2565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529750505050505050509392505050565b6060824710156106295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161033a565b600080866001600160a01b031685876040516106459190610a79565b60006040518083038185875af1925050503d8060008114610682576040519150601f19603f3d011682016040523d82523d6000602084013e610687565b606091505b5091509150610698878383876106a3565b979650505050505050565b6060831561071257825160000361070b576001600160a01b0385163b61070b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161033a565b508161037c565b61037c83838151156107275781518083602001fd5b8060405162461bcd60e51b815260040161033a9190610d68565b6001600160a01b038116811461075657600080fd5b50565b60008060006060848603121561076e57600080fd5b833561077981610741565b92506020840135915060408401356001600160401b0381111561079b57600080fd5b8401608081870312156107ad57600080fd5b809150509250925092565b6000602082840312156107ca57600080fd5b81356107d581610741565b9392505050565b801515811461075657600080fd5b6000602082840312156107fc57600080fd5b81356107d5816107dc565b6000808335601e1984360301811261081e57600080fd5b8301803591506001600160401b0382111561083857600080fd5b60200191503681900382131561084d57600080fd5b9250929050565b60006020828403121561086657600080fd5b8135600481106107d557600080fd5b634e487b7160e01b600052601260045260246000fd5b60006001600160601b03838116806108a5576108a5610875565b92169190910492915050565b6000602082840312156108c357600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b604081528260408201528284606083013760006060848301015260006060601f19601f8601168301019050826020830152949350505050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b038111828210171561095157610951610919565b60405290565b604051601f8201601f191681016001600160401b038111828210171561097f5761097f610919565b604052919050565b60006001600160401b038211156109a0576109a0610919565b50601f01601f191660200190565b60005b838110156109c95781810151838201526020016109b1565b50506000910152565b600080604083850312156109e557600080fd5b82516109f0816107dc565b60208401519092506001600160401b03811115610a0c57600080fd5b8301601f81018513610a1d57600080fd5b8051610a30610a2b82610987565b610957565b818152866020838501011115610a4557600080fd5b610a568260208301602086016109ae565b8093505050509250929050565b634e487b7160e01b600052600160045260246000fd5b60008251610a8b8184602087016109ae565b9190910192915050565b600060208284031215610aa757600080fd5b81516107d5816107dc565b60008085851115610ac257600080fd5b83861115610acf57600080fd5b5050820193919092039150565b6001600160e01b03198135818116916004851015610b045780818660040360031b1b83161692505b505092915050565b600082601f830112610b1d57600080fd5b8135610b2b610a2b82610987565b818152846020838601011115610b4057600080fd5b816020850160208301376000918101602001919091529392505050565b8035610b6881610741565b919050565b803563ffffffff81168114610b6857600080fd5b600080600080848603610140811215610b9957600080fd5b60e0811215610ba757600080fd5b50610bb061092f565b8535610bbb81610741565b8152602086810135908201526040860135610bd581610741565b60408201526060860135610be881610741565b806060830152506080860135608082015260a086013560a082015260c0860135610c1181610741565b60c0820152935060e08501356001600160401b03811115610c3157600080fd5b610c3d87828801610b0c565b935050610c4d6101008601610b5d565b9150610c5c6101208601610b6d565b905092959194509250565b8082028115828204841417610c8c57634e487b7160e01b600052601160045260246000fd5b92915050565b600082610ca157610ca1610875565b500490565b60008151808452610cbe8160208601602086016109ae565b601f01601f19169290920160200192915050565b600061014060018060a01b03808851168452602088015160208501528060408901511660408501528060608901511660608501526080880151608085015260a088015160a08501528060c08901511660c0850152508060e0840152610d3981840187610ca6565b915050610d526101008301856001600160a01b03169052565b63ffffffff831661012083015295945050505050565b6020815260006107d56020830184610ca656fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a2646970667358221220a43fc64cc90b430839015393e15266d14960934e135f73b94b55c3a8c9fb5ec864736f6c63430008170033",
|
|
70
|
+
"deployedBytecode": "0x60806040526004361061002d5760003560e01c80632bdb823c146100395780638930af571461004e57600080fd5b3661003457005b600080fd5b61004c610047366004610759565b61009e565b005b34801561005a57600080fd5b506100827f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100b7836100b260408401602085016107b8565b610176565b6101706100ca60808301606084016107ea565b610115576100db6040830183610807565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061013892505050565b6101386101256020840184610854565b6101326040850185610807565b8661023a565b6001600160a01b0385161561014e576000610150565b835b61016060408501602086016107b8565b6001600160a01b03169190610384565b50505050565b6001600160a01b038216610188575050565b61019a60026001600160601b0361088b565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526001600160601b03929092169184169063dd62ed3e90604401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021791906108b1565b101561023657610229828260006103aa565b61023682826000196103aa565b5050565b60606001856003811115610250576102506108ca565b036103495760405163726d379760e11b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e4da6f2e906102a8908890889088906004016108e0565b600060405180830381865afa1580156102c5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102ed91908101906109d2565b92509050806103435760405162461bcd60e51b815260206004820181905260248201527f50656e646c65537761703a204b79626572207363616c696e67206661696c656460448201526064015b60405180910390fd5b5061037c565b600285600381111561035d5761035d6108ca565b036103745761036d8484846104b4565b905061037c565b61037c610a63565b949350505050565b606061037c848484604051806060016040528060298152602001610d7c602991396105c8565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b17905291516000928392908716916104069190610a79565b6000604051808303816000865af19150503d8060008114610443576040519150601f19603f3d011682016040523d82523d6000602084013e610448565b606091505b50915091508180156104725750805115806104725750808060200190518101906104729190610a95565b6104ad5760405162461bcd60e51b815260206004820152600c60248201526b5361666520417070726f766560a01b604482015260640161033a565b5050505050565b606060006104c56004828688610ab2565b6104ce91610adc565b90503660006104e0866004818a610ab2565b90925090506001600160e01b03198316630ed8d73960e21b1461050557610505610a63565b600080808061051685870187610b81565b935093509350935083602001518985608001516105339190610c67565b61053d9190610c92565b6080850152602084015160a0850151610557908b90610c67565b6105619190610c92565b60a0850152602084018990526040518790610586908690869086908690602401610cd2565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529750505050505050509392505050565b6060824710156106295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161033a565b600080866001600160a01b031685876040516106459190610a79565b60006040518083038185875af1925050503d8060008114610682576040519150601f19603f3d011682016040523d82523d6000602084013e610687565b606091505b5091509150610698878383876106a3565b979650505050505050565b6060831561071257825160000361070b576001600160a01b0385163b61070b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161033a565b508161037c565b61037c83838151156107275781518083602001fd5b8060405162461bcd60e51b815260040161033a9190610d68565b6001600160a01b038116811461075657600080fd5b50565b60008060006060848603121561076e57600080fd5b833561077981610741565b92506020840135915060408401356001600160401b0381111561079b57600080fd5b8401608081870312156107ad57600080fd5b809150509250925092565b6000602082840312156107ca57600080fd5b81356107d581610741565b9392505050565b801515811461075657600080fd5b6000602082840312156107fc57600080fd5b81356107d5816107dc565b6000808335601e1984360301811261081e57600080fd5b8301803591506001600160401b0382111561083857600080fd5b60200191503681900382131561084d57600080fd5b9250929050565b60006020828403121561086657600080fd5b8135600481106107d557600080fd5b634e487b7160e01b600052601260045260246000fd5b60006001600160601b03838116806108a5576108a5610875565b92169190910492915050565b6000602082840312156108c357600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b604081528260408201528284606083013760006060848301015260006060601f19601f8601168301019050826020830152949350505050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b038111828210171561095157610951610919565b60405290565b604051601f8201601f191681016001600160401b038111828210171561097f5761097f610919565b604052919050565b60006001600160401b038211156109a0576109a0610919565b50601f01601f191660200190565b60005b838110156109c95781810151838201526020016109b1565b50506000910152565b600080604083850312156109e557600080fd5b82516109f0816107dc565b60208401519092506001600160401b03811115610a0c57600080fd5b8301601f81018513610a1d57600080fd5b8051610a30610a2b82610987565b610957565b818152866020838501011115610a4557600080fd5b610a568260208301602086016109ae565b8093505050509250929050565b634e487b7160e01b600052600160045260246000fd5b60008251610a8b8184602087016109ae565b9190910192915050565b600060208284031215610aa757600080fd5b81516107d5816107dc565b60008085851115610ac257600080fd5b83861115610acf57600080fd5b5050820193919092039150565b6001600160e01b03198135818116916004851015610b045780818660040360031b1b83161692505b505092915050565b600082601f830112610b1d57600080fd5b8135610b2b610a2b82610987565b818152846020838601011115610b4057600080fd5b816020850160208301376000918101602001919091529392505050565b8035610b6881610741565b919050565b803563ffffffff81168114610b6857600080fd5b600080600080848603610140811215610b9957600080fd5b60e0811215610ba757600080fd5b50610bb061092f565b8535610bbb81610741565b8152602086810135908201526040860135610bd581610741565b60408201526060860135610be881610741565b806060830152506080860135608082015260a086013560a082015260c0860135610c1181610741565b60c0820152935060e08501356001600160401b03811115610c3157600080fd5b610c3d87828801610b0c565b935050610c4d6101008601610b5d565b9150610c5c6101208601610b6d565b905092959194509250565b8082028115828204841417610c8c57634e487b7160e01b600052601160045260246000fd5b92915050565b600082610ca157610ca1610875565b500490565b60008151808452610cbe8160208601602086016109ae565b601f01601f19169290920160200192915050565b600061014060018060a01b03808851168452602088015160208501528060408901511660408501528060608901511660608501526080880151608085015260a088015160a08501528060c08901511660c0850152508060e0840152610d3981840187610ca6565b915050610d526101008301856001600160a01b03169052565b63ffffffff831661012083015295945050505050565b6020815260006107d56020830184610ca656fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a2646970667358221220a43fc64cc90b430839015393e15266d14960934e135f73b94b55c3a8c9fb5ec864736f6c63430008170033",
|
|
71
71
|
"linkReferences": {},
|
|
72
72
|
"deployedLinkReferences": {}
|
|
73
73
|
}
|
|
@@ -53,4 +53,15 @@ contract PendleEEigenSYUpg is PendleERC20SYUpg {
|
|
|
53
53
|
function getTokensIn() public pure override returns (address[] memory res) {
|
|
54
54
|
return ArrayLib.create(EIGEN, EEIGEN);
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
/// =================================================================
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
61
|
+
return IVedaAccountant(vedaAccountant).getRateInQuoteSafe(EIGEN);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function assetInfo() external override view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
65
|
+
return (AssetType.TOKEN, EIGEN, IERC20Metadata(EIGEN).decimals());
|
|
66
|
+
}
|
|
56
67
|
}
|
|
@@ -64,7 +64,7 @@ contract PendleERC20SYUpg is SYBaseUpg {
|
|
|
64
64
|
return token == yieldToken;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
67
|
+
function assetInfo() external virtual view returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
68
68
|
return (AssetType.TOKEN, yieldToken, IERC20Metadata(yieldToken).decimals());
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../../../interfaces/Venus/IVenusToken.sol";
|
|
5
|
+
import "../../../../interfaces/Venus/IVenusInterestModel.sol";
|
|
6
|
+
|
|
7
|
+
abstract contract PendleVTokenRateHelper {
|
|
8
|
+
// solhint-disable immutable-vars-naming
|
|
9
|
+
// solhint-disable const-name-snakecase
|
|
10
|
+
address public immutable vToken;
|
|
11
|
+
uint256 private immutable initialExchangeRateMantissa;
|
|
12
|
+
uint256 private constant borrowRateMaxMantissa = 0.0005e16;
|
|
13
|
+
|
|
14
|
+
constructor(address _vToken, uint256 _initialExchangeRateMantissa) {
|
|
15
|
+
vToken = _vToken;
|
|
16
|
+
initialExchangeRateMantissa = _initialExchangeRateMantissa;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _exchangeRateCurrentView() internal view returns (uint256) {
|
|
20
|
+
uint256 currentBlock = block.number;
|
|
21
|
+
|
|
22
|
+
uint256 accrualBlockPrior = IVenusToken(vToken).accrualBlockNumber();
|
|
23
|
+
|
|
24
|
+
if (accrualBlockPrior == currentBlock) return IVenusToken(vToken).exchangeRateStored();
|
|
25
|
+
|
|
26
|
+
/* Read the previous values out of storage */
|
|
27
|
+
uint256 cashPrior = IVenusToken(vToken).getCash();
|
|
28
|
+
uint256 borrowsPrior = IVenusToken(vToken).totalBorrows();
|
|
29
|
+
uint256 reservesPrior = IVenusToken(vToken).totalReserves();
|
|
30
|
+
|
|
31
|
+
/* Calculate the current borrow interest rate */
|
|
32
|
+
uint256 borrowRateMantissa = IVenusInterestRateModel(IVenusToken(vToken).interestRateModel()).getBorrowRate(
|
|
33
|
+
cashPrior,
|
|
34
|
+
borrowsPrior,
|
|
35
|
+
reservesPrior
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
if (borrowRateMantissa > borrowRateMaxMantissa) revert("borrowRate > borrowRateMax");
|
|
39
|
+
// revert Errors.SYQiTokenBorrowRateTooHigh(borrowRateMantissa, borrowRateMaxMantissa);
|
|
40
|
+
|
|
41
|
+
uint256 blockDelta = currentBlock - accrualBlockPrior;
|
|
42
|
+
|
|
43
|
+
uint256 simpleInterestFactor = borrowRateMantissa * blockDelta;
|
|
44
|
+
|
|
45
|
+
uint256 interestAccumulated = (simpleInterestFactor * borrowsPrior) / 1e18;
|
|
46
|
+
|
|
47
|
+
uint256 totalBorrowsNew = interestAccumulated + borrowsPrior;
|
|
48
|
+
|
|
49
|
+
uint256 totalReservesNew = (IVenusToken(vToken).reserveFactorMantissa() * interestAccumulated) /
|
|
50
|
+
1e18 +
|
|
51
|
+
reservesPrior;
|
|
52
|
+
|
|
53
|
+
return _calcExchangeRate(IVenusToken(vToken).totalSupply(), cashPrior, totalBorrowsNew, totalReservesNew);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _calcExchangeRate(
|
|
57
|
+
uint256 totalSupply,
|
|
58
|
+
uint256 totalCash,
|
|
59
|
+
uint256 totalBorrows,
|
|
60
|
+
uint256 totalReserves
|
|
61
|
+
) private view returns (uint256) {
|
|
62
|
+
uint256 _totalSupply = totalSupply;
|
|
63
|
+
if (_totalSupply == 0) {
|
|
64
|
+
return initialExchangeRateMantissa;
|
|
65
|
+
} else {
|
|
66
|
+
uint256 cashPlusBorrowsMinusReserves;
|
|
67
|
+
uint256 exchangeRate;
|
|
68
|
+
|
|
69
|
+
cashPlusBorrowsMinusReserves = totalCash + totalBorrows - totalReserves;
|
|
70
|
+
|
|
71
|
+
exchangeRate = (cashPlusBorrowsMinusReserves * 1e18) / _totalSupply;
|
|
72
|
+
|
|
73
|
+
return exchangeRate;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../SYBaseWithRewards.sol";
|
|
5
|
+
import "./PendleVTokenRateHelper.sol";
|
|
6
|
+
import "../../../../interfaces/Venus/IVenusBNB.sol";
|
|
7
|
+
import "../../../../interfaces/Venus/IVenusComptroller.sol";
|
|
8
|
+
|
|
9
|
+
contract PendleVenusBNBSY is SYBaseWithRewards, PendleVTokenRateHelper {
|
|
10
|
+
using PMath for uint256;
|
|
11
|
+
|
|
12
|
+
error VenusError(uint256 errorCode);
|
|
13
|
+
|
|
14
|
+
address public constant VBNB = 0xA07c5b74C9B40447a954e1466938b865b6BBea36;
|
|
15
|
+
address public constant XVS = 0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63;
|
|
16
|
+
address public constant COMPTROLLER = 0xfD36E2c2a6789Db23113685031d7F16329158384;
|
|
17
|
+
uint256 public constant INITIAL_EXCHANGE_RATE = 2 * 10 ** 26;
|
|
18
|
+
|
|
19
|
+
constructor()
|
|
20
|
+
SYBaseWithRewards("SY Venus BNB", "SY-vBNB", VBNB)
|
|
21
|
+
PendleVTokenRateHelper(VBNB, INITIAL_EXCHANGE_RATE)
|
|
22
|
+
{}
|
|
23
|
+
|
|
24
|
+
/*///////////////////////////////////////////////////////////////
|
|
25
|
+
DEPOSIT/REDEEM USING BASE TOKENS
|
|
26
|
+
//////////////////////////////////////////////////////////////*/
|
|
27
|
+
|
|
28
|
+
function _deposit(address tokenIn, uint256 amountDeposited) internal virtual override returns (uint256) {
|
|
29
|
+
if (tokenIn == VBNB) {
|
|
30
|
+
return amountDeposited;
|
|
31
|
+
} else {
|
|
32
|
+
uint256 preBalance = _selfBalance(VBNB);
|
|
33
|
+
IVenusBNB(VBNB).mint{value: amountDeposited}(); // alr reverts on error
|
|
34
|
+
return _selfBalance(VBNB) - preBalance;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _redeem(
|
|
39
|
+
address receiver,
|
|
40
|
+
address tokenOut,
|
|
41
|
+
uint256 amountSharesToRedeem
|
|
42
|
+
) internal virtual override returns (uint256 amountTokenOut) {
|
|
43
|
+
if (tokenOut == VBNB) {
|
|
44
|
+
_transferOut(VBNB, receiver, amountTokenOut = amountSharesToRedeem);
|
|
45
|
+
} else {
|
|
46
|
+
uint256 err = IVenusBNB(VBNB).redeem(amountSharesToRedeem);
|
|
47
|
+
if (err != 0) {
|
|
48
|
+
revert VenusError(err);
|
|
49
|
+
}
|
|
50
|
+
_transferOut(NATIVE, receiver, amountTokenOut = _selfBalance(NATIVE));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/*///////////////////////////////////////////////////////////////
|
|
55
|
+
EXCHANGE-RATE
|
|
56
|
+
//////////////////////////////////////////////////////////////*/
|
|
57
|
+
|
|
58
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
59
|
+
return _exchangeRateCurrentView();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/*///////////////////////////////////////////////////////////////
|
|
63
|
+
REWARDS-RELATED
|
|
64
|
+
//////////////////////////////////////////////////////////////*/
|
|
65
|
+
|
|
66
|
+
function _getRewardTokens() internal pure override returns (address[] memory res) {
|
|
67
|
+
return ArrayLib.create(XVS);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function _redeemExternalReward() internal override {
|
|
71
|
+
IVenusComptroller(COMPTROLLER).claimVenus(address(this), ArrayLib.create(VBNB));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/*///////////////////////////////////////////////////////////////
|
|
75
|
+
MISC FUNCTIONS FOR METADATA
|
|
76
|
+
//////////////////////////////////////////////////////////////*/
|
|
77
|
+
|
|
78
|
+
function _previewDeposit(address tokenIn, uint256 amountTokenToDeposit) internal view override returns (uint256) {
|
|
79
|
+
if (tokenIn == VBNB) {
|
|
80
|
+
return amountTokenToDeposit;
|
|
81
|
+
}
|
|
82
|
+
uint256 rate = _exchangeRateCurrentView();
|
|
83
|
+
return amountTokenToDeposit.divDown(rate);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function _previewRedeem(
|
|
87
|
+
address tokenOut,
|
|
88
|
+
uint256 amountSharesToRedeem
|
|
89
|
+
) internal view override returns (uint256 amountTokenOut) {
|
|
90
|
+
if (tokenOut == VBNB) {
|
|
91
|
+
return amountSharesToRedeem;
|
|
92
|
+
}
|
|
93
|
+
uint256 rate = _exchangeRateCurrentView();
|
|
94
|
+
return amountSharesToRedeem.mulDown(rate);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
98
|
+
return ArrayLib.create(NATIVE, VBNB);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
102
|
+
return ArrayLib.create(NATIVE, VBNB);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
106
|
+
return token == NATIVE || token == VBNB;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
110
|
+
return token == NATIVE || token == VBNB;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function assetInfo() external pure returns (AssetType assetType, address assetAddress, uint8 assetDecimals) {
|
|
114
|
+
return (AssetType.TOKEN, NATIVE, 18);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
interface IVenusInterestRateModel {
|
|
5
|
+
function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view returns (uint256);
|
|
6
|
+
|
|
7
|
+
function getSupplyRate(
|
|
8
|
+
uint256 cash,
|
|
9
|
+
uint256 borrows,
|
|
10
|
+
uint256 reserves,
|
|
11
|
+
uint256 reserveFactorMantissa
|
|
12
|
+
) external view returns (uint256);
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
interface IVenusToken {
|
|
5
|
+
function exchangeRateCurrent() external returns (uint256);
|
|
6
|
+
|
|
7
|
+
function exchangeRateStored() external view returns (uint256);
|
|
8
|
+
|
|
9
|
+
function getCash() external view returns (uint256);
|
|
10
|
+
|
|
11
|
+
function totalBorrows() external view returns (uint256);
|
|
12
|
+
|
|
13
|
+
function totalReserves() external view returns (uint256);
|
|
14
|
+
|
|
15
|
+
function totalSupply() external view returns (uint256);
|
|
16
|
+
|
|
17
|
+
function accrualBlockNumber() external view returns (uint256);
|
|
18
|
+
|
|
19
|
+
function interestRateModel() external view returns (address);
|
|
20
|
+
|
|
21
|
+
function reserveFactorMantissa() external view returns (uint256);
|
|
22
|
+
}
|
|
@@ -32,11 +32,35 @@ 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);
|
|
35
37
|
} else {
|
|
36
38
|
assert(false);
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
|
|
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
|
+
|
|
40
64
|
receive() external payable {}
|
|
41
65
|
}
|
|
42
66
|
|
|
@@ -46,3 +70,22 @@ interface IKyberScalingHelper {
|
|
|
46
70
|
uint256 newAmount
|
|
47
71
|
) external view returns (bool isSuccess, bytes memory data);
|
|
48
72
|
}
|
|
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
|
+
}
|
package/deployments/1-core.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"ActionStorageV4": "0x6a0Ed0A9193FCBe7ae9B0F3D90F88e365Cca64fC"
|
|
32
32
|
},
|
|
33
33
|
"routerStatic": "0x263833d47eA3fA4a30f269323aba6a107f9eB14C",
|
|
34
|
-
"pendleSwap": "
|
|
34
|
+
"pendleSwap": "0x96aFA57f8D46C32a12d08CE3a61D17763F918B39",
|
|
35
35
|
"pyYtLpOracle": "0x9a9fa8338dd5e5b2188006f1cd2ef26d921650c2",
|
|
36
36
|
"yieldContractFactoryV3": "0xdF3601014686674e53d1Fa52F7602525483F9122",
|
|
37
37
|
"marketFactoryV3": "0x1A6fCc85557BC4fB7B534ed835a03EF056552D52",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY eEIGEN",
|
|
3
|
+
"SY": "0xa9b8eA09BbB7D3f423398F3757573BF6621a70eA",
|
|
4
|
+
"YT": "0xC76395183036C6F3D042460a4F8cC143EB9d7c73",
|
|
5
|
+
"PT": "0xd2b9f0587e89A508e5786525c82ae494389f2ddA",
|
|
6
|
+
"market": "0x07c5b1f5265591a8E0e541466654B07DD2d1a6FD",
|
|
7
|
+
"expiry": 1743033600,
|
|
8
|
+
"scalarRoot": "27447975601000000000",
|
|
9
|
+
"initAnchor": "1048433588000000000",
|
|
10
|
+
"lnFeeRateRoot": "1998002662000000",
|
|
11
|
+
"deployTxHash": "0x987f9858d85289d54c853285a6b2f95d44857d9b49f45ca17932a4264deb9972",
|
|
12
|
+
"deployBlockNumber": 21019588,
|
|
13
|
+
"reversedFee": 0.19999999993256523
|
|
14
|
+
}
|
package/deployments/10-core.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"ActionStorageV4": "0x6a0Ed0A9193FCBe7ae9B0F3D90F88e365Cca64fC"
|
|
31
31
|
},
|
|
32
32
|
"routerStatic": "0x704478Dd72FD7F9B83d1F1e0fc18C14B54F034d0",
|
|
33
|
-
"pendleSwap": "
|
|
33
|
+
"pendleSwap": "0x96aFA57f8D46C32a12d08CE3a61D17763F918B39",
|
|
34
34
|
"pyYtLpOracle": "0x9a9fa8338dd5e5b2188006f1cd2ef26d921650c2",
|
|
35
35
|
"yieldContractFactoryV3": "0xfa6B22FC4c3Ad88B68c16b3061a16b1714F6Bd57",
|
|
36
36
|
"marketFactoryV3": "0x4A2B38b9cBd83c86F261a4d64c243795D4d44aBC",
|