@pendle/core-v2 4.4.6 → 4.5.0-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC20WithSupplyCapSY.sol/PendleERC20WithSupplyCapSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC20WithSupplyCapSY.sol/PendleERC20WithSupplyCapSY.json +1073 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Tensorplex/PendleStTAOSY.sol/PendleStTAOSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Tensorplex/PendleStTAOSY.sol/PendleStTAOSY.json +2 -2
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.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 +4 -0
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.json +149 -0
- 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/IPAllActionV3.sol/IPAllActionV3.json +134 -72
- package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterHelper.sol/IPRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +2 -2
- 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 -28
- 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 -124
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.json +3 -51
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -50
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +4 -0
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +149 -0
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -76
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -92
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +4 -0
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +35 -0
- package/build/artifacts/contracts/router/RouterStorage.sol/RouterStorage.dbg.json +4 -0
- package/build/artifacts/contracts/router/RouterStorage.sol/RouterStorage.json +10 -0
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/contracts/core/StandardizedYield/implementations/PendleERC20WithSupplyCapSY.sol +55 -0
- package/contracts/core/StandardizedYield/implementations/Tensorplex/PendleStTAOSY.sol +1 -1
- package/contracts/interfaces/IPActionStorageStatic.sol +1 -0
- package/contracts/interfaces/IPActionStorageV4.sol +25 -0
- package/contracts/interfaces/IPAllActionV3.sol +2 -2
- package/contracts/interfaces/IPMiniDiamond.sol +1 -0
- package/contracts/limit/LimitRouterBase.sol +48 -25
- package/contracts/router/ActionAddRemoveLiqV3.sol +12 -12
- package/contracts/router/ActionCallbackV3.sol +14 -13
- package/contracts/router/ActionMiscV3.sol +1 -3
- package/contracts/router/ActionStorageV4.sol +64 -0
- package/contracts/router/ActionSwapYTV3.sol +3 -3
- package/contracts/router/PendleRouterV4.sol +23 -0
- package/contracts/router/RouterStorage.sol +19 -0
- package/contracts/router/base/ActionBase.sol +5 -7
- package/contracts/router/base/MarketApproxLib.sol +18 -16
- package/deployments/1-core.json +1 -1
- package/deployments/1-markets/ENA-AUG2024.json +13 -0
- package/deployments/1-markets/EZETH-DEC2024.json +11 -0
- package/deployments/1-markets/SUSDE-JUL2024.json +13 -0
- package/deployments/1-markets/WEETH-DEC2024.json +13 -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/deployments/56-markets/EZETH-BSC-SEP2024.json +13 -0
- package/package.json +1 -1
- package/typechain-types/ActionCallbackV3.ts +5 -5
- package/typechain-types/ActionStorageV4.ts +293 -0
- package/typechain-types/IPActionStorageV4.ts +293 -0
- package/typechain-types/IPAllActionV3.ts +208 -109
- package/typechain-types/PendleERC20WithSupplyCapSY.ts +1332 -0
- package/typechain-types/PendleRouterV4.ts +57 -0
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -123
- package/typechain-types/factories/ActionCallbackV3__factory.ts +2 -50
- 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 -27
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMiscV3__factory.ts +1 -49
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageV4__factory.ts +202 -0
- package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -75
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -91
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/IPActionStorageV4__factory.ts +164 -0
- package/typechain-types/factories/IPAllActionV3__factory.ts +134 -72
- package/typechain-types/factories/PendleERC20WithSupplyCapSY__factory.ts +1157 -0
- package/typechain-types/factories/PendleLimitRouter__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 +96 -0
- package/typechain-types/factories/PendleStTAOSY__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +31 -58
- package/typechain-types/index.ts +8 -14
- package/build/artifacts/contracts/interfaces/IDiamondCut.sol/IDiamondCut.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IDiamondCut.sol/IDiamondCut.json +0 -93
- package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.json +0 -87
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.json +0 -1002
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/RouterV2InterfaceForRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/RouterV2InterfaceForRouterHelper.json +0 -466
- package/build/artifacts/contracts/router/PendleRouterV3.sol/PendleRouterV3.dbg.json +0 -4
- package/build/artifacts/contracts/router/PendleRouterV3.sol/PendleRouterV3.json +0 -179
- package/contracts/interfaces/IDiamondCut.sol +0 -32
- package/contracts/interfaces/IDiamondLoupe.sol +0 -38
- package/contracts/router/PendleRouterHelper.sol +0 -305
- package/contracts/router/PendleRouterV3.sol +0 -235
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "@openzeppelin/contracts/proxy/Proxy.sol";
|
|
5
|
-
import "../interfaces/IPAllActionV3.sol";
|
|
6
|
-
import "../interfaces/IDiamondLoupe.sol";
|
|
7
|
-
import "../interfaces/IDiamondCut.sol";
|
|
8
|
-
|
|
9
|
-
// solhint-disable no-empty-blocks
|
|
10
|
-
contract PendleRouterV3 is Proxy, IDiamondLoupe {
|
|
11
|
-
address internal immutable ACTION_ADD_REMOVE_LIQ;
|
|
12
|
-
address internal immutable ACTION_SWAP_PT;
|
|
13
|
-
address internal immutable ACTION_SWAP_YT;
|
|
14
|
-
address internal immutable ACTION_MISC;
|
|
15
|
-
address internal immutable ACTION_CALLBACK;
|
|
16
|
-
|
|
17
|
-
event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);
|
|
18
|
-
|
|
19
|
-
constructor(
|
|
20
|
-
address _ACTION_ADD_REMOVE_LIQ,
|
|
21
|
-
address _ACTION_SWAP_PT,
|
|
22
|
-
address _ACTION_SWAP_YT,
|
|
23
|
-
address _ACTION_MISC,
|
|
24
|
-
address _ACTION_CALLBACK
|
|
25
|
-
) {
|
|
26
|
-
ACTION_ADD_REMOVE_LIQ = _ACTION_ADD_REMOVE_LIQ;
|
|
27
|
-
ACTION_SWAP_PT = _ACTION_SWAP_PT;
|
|
28
|
-
ACTION_SWAP_YT = _ACTION_SWAP_YT;
|
|
29
|
-
ACTION_MISC = _ACTION_MISC;
|
|
30
|
-
ACTION_CALLBACK = _ACTION_CALLBACK;
|
|
31
|
-
_emitEvents();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function _emitEvents() internal {
|
|
35
|
-
Facet[] memory facets_ = facets();
|
|
36
|
-
|
|
37
|
-
uint256 nFacets = facets_.length;
|
|
38
|
-
|
|
39
|
-
IDiamondCut.FacetCut[] memory cuts = new IDiamondCut.FacetCut[](nFacets);
|
|
40
|
-
for (uint256 i; i < nFacets; ) {
|
|
41
|
-
cuts[i].facetAddress = facets_[i].facetAddress;
|
|
42
|
-
cuts[i].action = IDiamondCut.FacetCutAction.Add;
|
|
43
|
-
cuts[i].functionSelectors = facets_[i].functionSelectors;
|
|
44
|
-
unchecked {
|
|
45
|
-
++i;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
emit DiamondCut(cuts, address(0), "");
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
receive() external payable virtual override {}
|
|
53
|
-
|
|
54
|
-
/// @notice Gets all facet addresses and their four byte function selectors.
|
|
55
|
-
/// @return facets_ Facet
|
|
56
|
-
function facets() public view returns (Facet[] memory facets_) {
|
|
57
|
-
address[] memory facetAddresses_ = facetAddresses();
|
|
58
|
-
uint256 numFacets = facetAddresses_.length;
|
|
59
|
-
|
|
60
|
-
facets_ = new Facet[](numFacets);
|
|
61
|
-
for (uint256 i; i < numFacets; ) {
|
|
62
|
-
facets_[i].facetAddress = facetAddresses_[i];
|
|
63
|
-
facets_[i].functionSelectors = facetFunctionSelectors(facetAddresses_[i]);
|
|
64
|
-
unchecked {
|
|
65
|
-
i++;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function facetFunctionSelectors(address facet) public view returns (bytes4[] memory res) {
|
|
71
|
-
if (facet == address(this)) {
|
|
72
|
-
res = new bytes4[](4);
|
|
73
|
-
res[0] = 0x52ef6b2c; // facetAddresses
|
|
74
|
-
res[1] = 0x7a0ed627; // facets
|
|
75
|
-
res[2] = 0xadfca15e; // facetFunctionSelectors
|
|
76
|
-
res[3] = 0xcdffacc6; // facetAddress
|
|
77
|
-
}
|
|
78
|
-
if (facet == ACTION_ADD_REMOVE_LIQ) {
|
|
79
|
-
res = new bytes4[](12);
|
|
80
|
-
res[0] = 0x12599ac6; // addLiquiditySingleToken
|
|
81
|
-
res[1] = 0x2756ce06; // addLiquidityDualTokenAndPt
|
|
82
|
-
res[2] = 0x3dbe1c55; // addLiquiditySingleTokenKeepYt
|
|
83
|
-
res[3] = 0x4e390267; // addLiquiditySinglePt
|
|
84
|
-
res[4] = 0x58bda475; // addLiquiditySingleSy
|
|
85
|
-
res[5] = 0x60da0860; // removeLiquiditySingleToken
|
|
86
|
-
res[6] = 0x6b77ac9e; // removeLiquiditySinglePt
|
|
87
|
-
res[7] = 0x844384aa; // addLiquiditySingleSyKeepYt
|
|
88
|
-
res[8] = 0x97ee279e; // addLiquidityDualSyAndPt
|
|
89
|
-
res[9] = 0xb00f09d7; // removeLiquidityDualTokenAndPt
|
|
90
|
-
res[10] = 0xb7d75b8b; // removeLiquidityDualSyAndPt
|
|
91
|
-
res[11] = 0xd13b4fdc; // removeLiquiditySingleSy
|
|
92
|
-
}
|
|
93
|
-
if (facet == ACTION_SWAP_YT) {
|
|
94
|
-
res = new bytes4[](6);
|
|
95
|
-
res[0] = 0x05eb5327; // swapExactYtForToken
|
|
96
|
-
res[1] = 0x448b9b95; // swapExactYtForPt
|
|
97
|
-
res[2] = 0x7b8b4b95; // swapExactSyForYt
|
|
98
|
-
res[3] = 0x80c4d566; // swapExactYtForSy
|
|
99
|
-
res[4] = 0xc861a898; // swapExactPtForYt
|
|
100
|
-
res[5] = 0xed48907e; // swapExactTokenForYt
|
|
101
|
-
}
|
|
102
|
-
if (facet == ACTION_SWAP_PT) {
|
|
103
|
-
res = new bytes4[](4);
|
|
104
|
-
res[0] = 0x2a50917c; // swapExactSyForPt
|
|
105
|
-
res[1] = 0x3346d3a3; // swapExactPtForSy
|
|
106
|
-
res[2] = 0x594a88cc; // swapExactPtForToken
|
|
107
|
-
res[3] = 0xc81f847a; // swapExactTokenForPt
|
|
108
|
-
}
|
|
109
|
-
if (facet == ACTION_CALLBACK) {
|
|
110
|
-
res = new bytes4[](2);
|
|
111
|
-
res[0] = 0xeb3a7d47; // limitRouterCallback
|
|
112
|
-
res[1] = 0xfa483e72; // swapCallback
|
|
113
|
-
}
|
|
114
|
-
if (facet == ACTION_MISC) {
|
|
115
|
-
res = new bytes4[](12);
|
|
116
|
-
res[0] = 0x1a8631b2; // mintPyFromSy
|
|
117
|
-
res[1] = 0x2d8f9d8d; // boostMarkets
|
|
118
|
-
res[2] = 0x2e071dc6; // mintSyFromToken
|
|
119
|
-
res[3] = 0x339748cb; // redeemPyToSy
|
|
120
|
-
res[4] = 0x339a5572; // redeemSyToToken
|
|
121
|
-
res[5] = 0x47f1de22; // redeemPyToToken
|
|
122
|
-
res[6] = 0x5d3e105c; // swapTokenToToken
|
|
123
|
-
res[7] = 0x60fc8466; // multicall
|
|
124
|
-
res[8] = 0xa89eba4a; // swapTokenToTokenViaSy
|
|
125
|
-
res[9] = 0xbd61951d; // simulate
|
|
126
|
-
res[10] = 0xd0f42385; // mintPyFromToken
|
|
127
|
-
res[11] = 0xf7e375e8; // redeemDueInterestAndRewards
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function facetAddress(bytes4 sig) public view returns (address) {
|
|
132
|
-
if (sig < 0x6b77ac9e) {
|
|
133
|
-
if (sig < 0x3dbe1c55) {
|
|
134
|
-
if (sig < 0x2d8f9d8d) {
|
|
135
|
-
if (sig < 0x1a8631b2) {
|
|
136
|
-
if (sig == 0x05eb5327) return ACTION_SWAP_YT; //swapExactYtForToken
|
|
137
|
-
if (sig == 0x12599ac6) return ACTION_ADD_REMOVE_LIQ; //addLiquiditySingleToken
|
|
138
|
-
} else {
|
|
139
|
-
if (sig == 0x1a8631b2) return ACTION_MISC; //mintPyFromSy
|
|
140
|
-
if (sig == 0x2756ce06) return ACTION_ADD_REMOVE_LIQ; //addLiquidityDualTokenAndPt
|
|
141
|
-
if (sig == 0x2a50917c) return ACTION_SWAP_PT; //swapExactSyForPt
|
|
142
|
-
}
|
|
143
|
-
} else {
|
|
144
|
-
if (sig < 0x3346d3a3) {
|
|
145
|
-
if (sig == 0x2d8f9d8d) return ACTION_MISC; //boostMarkets
|
|
146
|
-
if (sig == 0x2e071dc6) return ACTION_MISC; //mintSyFromToken
|
|
147
|
-
} else {
|
|
148
|
-
if (sig == 0x3346d3a3) return ACTION_SWAP_PT; //swapExactPtForSy
|
|
149
|
-
if (sig == 0x339748cb) return ACTION_MISC; //redeemPyToSy
|
|
150
|
-
if (sig == 0x339a5572) return ACTION_MISC; //redeemSyToToken
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
} else {
|
|
154
|
-
if (sig < 0x58bda475) {
|
|
155
|
-
if (sig < 0x47f1de22) {
|
|
156
|
-
if (sig == 0x3dbe1c55) return ACTION_ADD_REMOVE_LIQ; //addLiquiditySingleTokenKeepYt
|
|
157
|
-
if (sig == 0x448b9b95) return ACTION_SWAP_YT; //swapExactYtForPt
|
|
158
|
-
} else {
|
|
159
|
-
if (sig == 0x47f1de22) return ACTION_MISC; //redeemPyToToken
|
|
160
|
-
if (sig == 0x4e390267) return ACTION_ADD_REMOVE_LIQ; //addLiquiditySinglePt
|
|
161
|
-
if (sig == 0x52ef6b2c) return address(this); //facetAddresses
|
|
162
|
-
}
|
|
163
|
-
} else {
|
|
164
|
-
if (sig < 0x5d3e105c) {
|
|
165
|
-
if (sig == 0x58bda475) return ACTION_ADD_REMOVE_LIQ; //addLiquiditySingleSy
|
|
166
|
-
if (sig == 0x594a88cc) return ACTION_SWAP_PT; //swapExactPtForToken
|
|
167
|
-
} else {
|
|
168
|
-
if (sig == 0x5d3e105c) return ACTION_MISC; //swapTokenToToken
|
|
169
|
-
if (sig == 0x60da0860) return ACTION_ADD_REMOVE_LIQ; //removeLiquiditySingleToken
|
|
170
|
-
if (sig == 0x60fc8466) return ACTION_MISC; //multicall
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
} else {
|
|
175
|
-
if (sig < 0xbd61951d) {
|
|
176
|
-
if (sig < 0x97ee279e) {
|
|
177
|
-
if (sig < 0x7b8b4b95) {
|
|
178
|
-
if (sig == 0x6b77ac9e) return ACTION_ADD_REMOVE_LIQ; //removeLiquiditySinglePt
|
|
179
|
-
if (sig == 0x7a0ed627) return address(this); //facets
|
|
180
|
-
} else {
|
|
181
|
-
if (sig == 0x7b8b4b95) return ACTION_SWAP_YT; //swapExactSyForYt
|
|
182
|
-
if (sig == 0x80c4d566) return ACTION_SWAP_YT; //swapExactYtForSy
|
|
183
|
-
if (sig == 0x844384aa) return ACTION_ADD_REMOVE_LIQ; //addLiquiditySingleSyKeepYt
|
|
184
|
-
}
|
|
185
|
-
} else {
|
|
186
|
-
if (sig < 0xadfca15e) {
|
|
187
|
-
if (sig == 0x97ee279e) return ACTION_ADD_REMOVE_LIQ; //addLiquidityDualSyAndPt
|
|
188
|
-
if (sig == 0xa89eba4a) return ACTION_MISC; //swapTokenToTokenViaSy
|
|
189
|
-
} else {
|
|
190
|
-
if (sig == 0xadfca15e) return address(this); //facetFunctionSelectors
|
|
191
|
-
if (sig == 0xb00f09d7) return ACTION_ADD_REMOVE_LIQ; //removeLiquidityDualTokenAndPt
|
|
192
|
-
if (sig == 0xb7d75b8b) return ACTION_ADD_REMOVE_LIQ; //removeLiquidityDualSyAndPt
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
} else {
|
|
196
|
-
if (sig < 0xd13b4fdc) {
|
|
197
|
-
if (sig < 0xc861a898) {
|
|
198
|
-
if (sig == 0xbd61951d) return ACTION_MISC; //simulate
|
|
199
|
-
if (sig == 0xc81f847a) return ACTION_SWAP_PT; //swapExactTokenForPt
|
|
200
|
-
} else {
|
|
201
|
-
if (sig == 0xc861a898) return ACTION_SWAP_YT; //swapExactPtForYt
|
|
202
|
-
if (sig == 0xcdffacc6) return address(this); //facetAddress
|
|
203
|
-
if (sig == 0xd0f42385) return ACTION_MISC; //mintPyFromToken
|
|
204
|
-
}
|
|
205
|
-
} else {
|
|
206
|
-
if (sig < 0xed48907e) {
|
|
207
|
-
if (sig == 0xd13b4fdc) return ACTION_ADD_REMOVE_LIQ; //removeLiquiditySingleSy
|
|
208
|
-
if (sig == 0xeb3a7d47) return ACTION_CALLBACK; //limitRouterCallback
|
|
209
|
-
} else {
|
|
210
|
-
if (sig == 0xed48907e) return ACTION_SWAP_YT; //swapExactTokenForYt
|
|
211
|
-
if (sig == 0xf7e375e8) return ACTION_MISC; //redeemDueInterestAndRewards
|
|
212
|
-
if (sig == 0xfa483e72) return ACTION_CALLBACK; //swapCallback
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
revert Errors.RouterInvalidAction(sig);
|
|
218
|
-
// NUM_FUNC: 40 AVG:4.80 WORST_CASE:6 STOP_BRANCH:3
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
function facetAddresses() public view returns (address[] memory) {
|
|
222
|
-
address[] memory res = new address[](6);
|
|
223
|
-
res[0] = address(this);
|
|
224
|
-
res[1] = ACTION_ADD_REMOVE_LIQ;
|
|
225
|
-
res[2] = ACTION_SWAP_YT;
|
|
226
|
-
res[3] = ACTION_SWAP_PT;
|
|
227
|
-
res[4] = ACTION_CALLBACK;
|
|
228
|
-
res[5] = ACTION_MISC;
|
|
229
|
-
return res;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function _implementation() internal view override returns (address) {
|
|
233
|
-
return facetAddress(msg.sig);
|
|
234
|
-
}
|
|
235
|
-
}
|