@pendle/core-v2 6.6.0 → 6.6.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/cross-chain/FixedPricePTAMMV2.sol/FixedPricePTAMMV2.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMMV2.sol/FixedPricePTAMMV2.json +766 -0
- package/build/artifacts/contracts/cross-chain/PendleSwapHelper.sol/PendleSwapHelper.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/PendleSwapHelper.sol/PendleSwapHelper.json +99 -0
- package/build/artifacts/contracts/cross-chain/funder/BridgeFunder.sol/BridgeFunder.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/funder/BridgeFunder.sol/BridgeFunder.json +210 -0
- package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterAltImpl.sol/OFTAdapterAltImpl.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterAltImpl.sol/OFTAdapterAltImpl.json +1294 -0
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalTokenAlt.sol/PendleBridgedPrincipalTokenAlt.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalTokenAlt.sol/PendleBridgedPrincipalTokenAlt.json +1602 -0
- package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.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/IPAllActionV3.sol/IPAllActionV3.json +0 -88
- 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/IPBridgeFunder.sol/IPBridgeFunder.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBridgeFunder.sol/IPBridgeFunder.json +85 -0
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMMV2.sol/IPFixedPricePTAMMSwapCallback.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPFixedPricePTAMM.sol → IPFixedPricePTAMMV2.sol}/IPFixedPricePTAMMSwapCallback.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMMV2.sol/IPFixedPricePTAMMV2.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPFixedPricePTAMM.sol/IPFixedPricePTAMM.json → IPFixedPricePTAMMV2.sol/IPFixedPricePTAMMV2.json} +285 -93
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.json +156 -0
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPSwapHelper.sol/IPSwapHelper.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPActionCrossChain.sol/IPActionCrossChain.json → IPSwapHelper.sol/IPSwapHelper.json} +2 -2
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.json +2 -2
- package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.json +258 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +265 -3
- package/build/artifacts/contracts/limit/helpers/MintSyHelper.sol/MintSyHelper.dbg.json +4 -0
- package/build/artifacts/contracts/limit/helpers/MintSyHelper.sol/MintSyHelper.json +156 -0
- package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.json +33 -2
- package/build/artifacts/contracts/offchain-helpers/PendleProxyAdmin.sol/PendleProxyAdmin.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/PendleProxyAdmin.sol/PendleProxyAdmin.json +171 -0
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.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/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.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/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.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/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/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.json +2 -2
- package/contracts/cross-chain/FixedPricePTAMMV2.sol +162 -0
- package/contracts/{router/ActionCrossChain.sol → cross-chain/PendleSwapHelper.sol} +11 -7
- package/contracts/cross-chain/funder/BridgeFunder.sol +61 -0
- package/contracts/cross-chain/oftImpl/hub/OFTAdapterAltImpl.sol +55 -0
- package/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalTokenAlt.sol +64 -0
- package/contracts/interfaces/IPAllActionTypeV3.sol +1 -0
- package/contracts/interfaces/IPAllActionV3.sol +1 -3
- package/contracts/interfaces/IPBridgeFunder.sol +17 -0
- package/contracts/interfaces/IPFixedPricePTAMMV2.sol +58 -0
- package/contracts/interfaces/IPLimitRouter.sol +22 -0
- package/contracts/interfaces/{IPActionCrossChain.sol → IPSwapHelper.sol} +1 -1
- package/contracts/limit/LimitRouterBase.sol +101 -47
- package/contracts/limit/PendleLimitRouter.sol +1 -1
- package/contracts/limit/helpers/MintSyHelper.sol +114 -0
- package/contracts/offchain-helpers/PendleFeeSetter.sol +19 -1
- package/contracts/offchain-helpers/PendleProxyAdmin.sol +11 -0
- package/contracts/router/base/ActionBase.sol +16 -2
- package/deployments/1-core.json +1 -0
- package/deployments/1-offchain-helper.json +1 -1
- package/deployments/10-core.json +1 -0
- package/deployments/10-offchain-helper.json +1 -1
- package/deployments/130-core.json +1 -0
- package/deployments/143-core.json +1 -0
- package/deployments/146-core.json +1 -0
- package/deployments/146-offchain-helper.json +1 -1
- package/deployments/42161-core.json +1 -0
- package/deployments/42161-offchain-helper.json +1 -1
- package/deployments/4217-core.json +14 -0
- package/deployments/43114-core.json +1 -0
- package/deployments/5000-core.json +1 -0
- package/deployments/5000-offchain-helper.json +1 -1
- package/deployments/56-core.json +1 -0
- package/deployments/56-offchain-helper.json +1 -1
- package/deployments/57073-core.json +1 -0
- package/deployments/747474-core.json +1 -0
- package/deployments/80094-core.json +1 -0
- package/deployments/80094-offchain-helper.json +1 -1
- package/deployments/8453-core.json +1 -0
- package/deployments/8453-offchain-helper.json +1 -1
- package/deployments/9745-core.json +1 -0
- package/deployments/9745-offchain-helper.json +1 -1
- package/deployments/999-core.json +1 -0
- package/deployments/999-offchain-helper.json +1 -1
- package/package.json +1 -1
- package/typechain-types/BridgeFunder.ts +344 -0
- package/typechain-types/FixedPricePTAMMV2.ts +1104 -0
- package/typechain-types/IPAllActionV3.ts +0 -54
- package/typechain-types/IPBridgeFunder.ts +165 -0
- package/typechain-types/IPFixedPricePTAMMV2.ts +864 -0
- package/typechain-types/IPLimitRouter.ts +104 -0
- package/typechain-types/IPSwapHelper.ts +161 -0
- package/typechain-types/LimitRouterBase.ts +233 -5
- package/typechain-types/MintSyHelper.ts +230 -0
- package/typechain-types/OFTAdapterAltImpl.ts +1350 -0
- package/typechain-types/PendleBridgedPrincipalTokenAlt.ts +1708 -0
- package/typechain-types/PendleFeeSetter.ts +53 -0
- package/typechain-types/PendleLimitRouter.ts +233 -5
- package/typechain-types/PendleProxyAdmin.ts +341 -0
- package/typechain-types/PendleSwapHelper.ts +161 -0
- package/typechain-types/ProxyAdmin.ts +341 -0
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
- package/typechain-types/factories/ActionCallbackV3__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/BridgeFunder__factory.ts +265 -0
- package/typechain-types/factories/ExpiredLpPtRedeemer__factory.ts +1 -1
- package/typechain-types/factories/FixedPricePTAMMV2__factory.ts +824 -0
- package/typechain-types/factories/IPAllActionV3__factory.ts +0 -88
- package/typechain-types/factories/IPBridgeFunder__factory.ts +100 -0
- package/typechain-types/factories/IPFixedPricePTAMMV2__factory.ts +621 -0
- package/typechain-types/factories/IPLimitRouter__factory.ts +156 -0
- package/typechain-types/factories/IPSwapHelper__factory.ts +111 -0
- package/typechain-types/factories/LimitBackendHelperV2__factory.ts +1 -1
- package/typechain-types/factories/LimitRouterBase__factory.ts +258 -1
- package/typechain-types/factories/MarketSweed__factory.ts +1 -1
- package/typechain-types/factories/MintSyHelper__factory.ts +168 -0
- package/typechain-types/factories/OFTAdapterAltImpl__factory.ts +1363 -0
- package/typechain-types/factories/PendleBridgedPrincipalTokenAlt__factory.ts +1702 -0
- package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeSetter__factory.ts +36 -1
- package/typechain-types/factories/PendleLimitRouter__factory.ts +268 -3
- package/typechain-types/factories/PendlePoolDeployHelperV2__factory.ts +1 -1
- package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleProxyAdmin__factory.ts +229 -0
- package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
- package/typechain-types/factories/PendleSwapHelper__factory.ts +152 -0
- package/typechain-types/factories/ProxyAdmin__factory.ts +210 -0
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +108 -0
- package/typechain-types/index.ts +22 -0
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.json +0 -667
- package/build/artifacts/contracts/interfaces/IPActionCrossChain.sol/IPActionCrossChain.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionCrossChain.sol/ActionCrossChain.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionCrossChain.sol/ActionCrossChain.json +0 -99
- package/contracts/cross-chain/FixedPricePTAMM.sol +0 -200
- package/contracts/interfaces/IPFixedPricePTAMM.sol +0 -69
|
@@ -4,18 +4,18 @@ pragma solidity ^0.8.17;
|
|
|
4
4
|
|
|
5
5
|
import "../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
6
6
|
import "../core/libraries/TokenHelper.sol";
|
|
7
|
+
import "../interfaces/IPAllActionV3.sol";
|
|
7
8
|
import "../interfaces/IPLimitRouter.sol";
|
|
8
9
|
import "../interfaces/IStandardizedYield.sol";
|
|
9
|
-
import "../interfaces/IWETH.sol";
|
|
10
10
|
import {LimitMathCore as LimitMath} from "./LimitMathCore.sol";
|
|
11
|
+
import "./helpers/MintSyHelper.sol";
|
|
11
12
|
import "./helpers/NonceManager.sol";
|
|
12
|
-
import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
|
|
13
13
|
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
|
|
14
14
|
|
|
15
15
|
abstract contract LimitRouterBase is
|
|
16
|
-
EIP712Upgradeable,
|
|
17
16
|
IPLimitRouter,
|
|
18
17
|
BoringOwnableUpgradeableV2,
|
|
18
|
+
MintSyHelper,
|
|
19
19
|
NonceManager,
|
|
20
20
|
TokenHelper
|
|
21
21
|
{
|
|
@@ -28,26 +28,28 @@ abstract contract LimitRouterBase is
|
|
|
28
28
|
|
|
29
29
|
uint128 internal constant _ORDER_DOES_NOT_EXIST = 0;
|
|
30
30
|
uint128 internal constant _ORDER_FILLED = 1;
|
|
31
|
-
uint256 internal constant NEW_PRIME = 12_421;
|
|
32
31
|
uint256 internal constant MAX_LN_FEE_RATE_ROOT = 48_790_164_169_432_003; // ln(1.05)
|
|
33
32
|
|
|
34
|
-
bytes private constant EMPTY_BYTES = abi.encode();
|
|
35
|
-
|
|
36
33
|
address public feeRecipient;
|
|
37
34
|
|
|
38
35
|
// YT => lnFeeRateRoot // not to be accessed directly
|
|
39
36
|
mapping(address => uint256) internal __lnFeeRateRoot;
|
|
40
37
|
|
|
41
38
|
address public immutable WNATIVE;
|
|
39
|
+
address public immutable ROUTER;
|
|
42
40
|
|
|
43
41
|
mapping(bytes32 => OrderStatus) internal _status;
|
|
44
42
|
|
|
45
43
|
address private __deprecated__ownerHelper;
|
|
46
44
|
|
|
47
|
-
|
|
45
|
+
address public mintSySigner1;
|
|
46
|
+
address public mintSySigner2;
|
|
47
|
+
|
|
48
|
+
uint256[97] private __gap;
|
|
48
49
|
|
|
49
|
-
constructor(address _WNATIVE) {
|
|
50
|
+
constructor(address _WNATIVE, address _ROUTER) {
|
|
50
51
|
WNATIVE = _WNATIVE;
|
|
52
|
+
ROUTER = _ROUTER;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
// solhint-disable-next-line no-empty-blocks
|
|
@@ -64,18 +66,20 @@ abstract contract LimitRouterBase is
|
|
|
64
66
|
FillOrderParams[] memory params,
|
|
65
67
|
address receiver,
|
|
66
68
|
uint256 maxTaking,
|
|
67
|
-
bytes
|
|
68
|
-
/*optData*/
|
|
69
|
+
bytes memory optData,
|
|
69
70
|
bytes memory callback
|
|
70
71
|
) external returns (uint256 actualMaking, uint256 actualTaking, uint256 totalFee, bytes memory callbackReturn) {
|
|
71
|
-
|
|
72
|
+
OptionalArgs memory oArgs = _decodeAndVerifySigOpt_prePrune(params, optData);
|
|
73
|
+
|
|
74
|
+
_validateSkipSigAndPruneOrders(params);
|
|
72
75
|
if (params.length == 0) return fillNoOrders(callback);
|
|
73
76
|
|
|
74
77
|
OrderType orderType = params[0].order.orderType;
|
|
78
|
+
Args memory a = Args(orderType, params, receiver, maxTaking, callback, oArgs);
|
|
75
79
|
if (orderType == OrderType.SY_FOR_PT || orderType == OrderType.SY_FOR_YT) {
|
|
76
|
-
return fillTokenForPY(
|
|
80
|
+
return fillTokenForPY(a);
|
|
77
81
|
} else {
|
|
78
|
-
return fillPYForToken(
|
|
82
|
+
return fillPYForToken(a);
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
|
|
@@ -87,6 +91,11 @@ abstract contract LimitRouterBase is
|
|
|
87
91
|
address receiver;
|
|
88
92
|
uint256 maxTaking;
|
|
89
93
|
bytes callback;
|
|
94
|
+
OptionalArgs oArgs;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
struct OptionalArgs {
|
|
98
|
+
MintSyData mintSyData;
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
function fillNoOrders(bytes memory callback)
|
|
@@ -104,7 +113,7 @@ abstract contract LimitRouterBase is
|
|
|
104
113
|
(address SY, address PT, address YT, bytes32[] memory orderHashes) = _checkSig_updMakingAndStatus(a.params);
|
|
105
114
|
|
|
106
115
|
// Token => This
|
|
107
|
-
uint256[] memory fromMakers = _transferFromMakers_mintSy_updMakings(SY, a.params);
|
|
116
|
+
uint256[] memory fromMakers = _transferFromMakers_mintSy_updMakings(SY, a.params, a.oArgs.mintSyData);
|
|
108
117
|
|
|
109
118
|
FillResults memory out = LimitMath.calcBatch(a.params, YT, getLnFeeRateRoot(YT));
|
|
110
119
|
(actualMaking, actualTaking, totalFee) = (out.totalMaking - out.totalFee, out.totalTaking, out.totalFee);
|
|
@@ -160,35 +169,43 @@ abstract contract LimitRouterBase is
|
|
|
160
169
|
}
|
|
161
170
|
|
|
162
171
|
// ----------------- verify & convert functions -----------------
|
|
163
|
-
|
|
172
|
+
|
|
173
|
+
function _decodeAndVerifySigOpt_prePrune(FillOrderParams[] memory params, bytes memory optData)
|
|
164
174
|
internal
|
|
165
175
|
view
|
|
166
|
-
returns (
|
|
176
|
+
returns (OptionalArgs memory oArgs)
|
|
167
177
|
{
|
|
178
|
+
if (optData.length != 0) {
|
|
179
|
+
(uint256 version, bytes memory payload) = abi.decode(optData, (uint256, bytes));
|
|
180
|
+
require(version == 1, "LOP: invalid version");
|
|
181
|
+
|
|
182
|
+
oArgs.mintSyData = abi.decode(payload, (MintSyData));
|
|
183
|
+
_verifyMintSyData(oArgs.mintSyData, hashFillParams(params), mintSySigner1, mintSySigner2);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function _validateSkipSigAndPruneOrders(FillOrderParams[] memory params) internal view {
|
|
168
188
|
uint256 len = params.length;
|
|
169
189
|
require(len != 0, "LOP: empty batch");
|
|
170
190
|
|
|
171
191
|
(address YT, OrderType orderType) = (params[0].order.YT, params[0].order.orderType);
|
|
172
192
|
require(block.timestamp < IPYieldToken(YT).expiry(), "LOP: PY expired");
|
|
173
193
|
|
|
174
|
-
uint256
|
|
194
|
+
uint256 keep = 0;
|
|
175
195
|
for (uint256 i = 0; i < len; i++) {
|
|
176
196
|
Order memory order = params[i].order;
|
|
197
|
+
|
|
198
|
+
require(i == 0 || order.token >= params[i - 1].order.token, "LOP: invalid ordering");
|
|
177
199
|
require(order.orderType == orderType && order.YT == YT, "LOP: mismatch types");
|
|
178
200
|
|
|
179
|
-
if (!(block.timestamp < order.expiry && order.nonce >= nonce[order.maker]))
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
201
|
+
if (!(block.timestamp < order.expiry && order.nonce >= nonce[order.maker])) continue;
|
|
202
|
+
|
|
203
|
+
params[keep] = params[i];
|
|
204
|
+
keep++;
|
|
183
205
|
}
|
|
184
206
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
for (uint256 i = 0; i < len; i++) {
|
|
188
|
-
if (params[i].signature.length != 0) {
|
|
189
|
-
res[iter] = params[i];
|
|
190
|
-
iter++;
|
|
191
|
-
}
|
|
207
|
+
assembly ("memory-safe") {
|
|
208
|
+
mstore(params, keep)
|
|
192
209
|
}
|
|
193
210
|
}
|
|
194
211
|
|
|
@@ -289,12 +306,13 @@ abstract contract LimitRouterBase is
|
|
|
289
306
|
return (orderHash, remainingMakerAmount, filledMakerAmount);
|
|
290
307
|
}
|
|
291
308
|
|
|
292
|
-
// ----------------- simple helper functions
|
|
309
|
+
// ----------------- simple helper functions -----------------
|
|
293
310
|
|
|
294
|
-
function _transferFromMakers_mintSy_updMakings(
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
311
|
+
function _transferFromMakers_mintSy_updMakings(
|
|
312
|
+
address SY,
|
|
313
|
+
FillOrderParams[] memory params,
|
|
314
|
+
MintSyData memory mintSyData
|
|
315
|
+
) internal returns (uint256[] memory fromMakers) {
|
|
298
316
|
uint256 len = params.length;
|
|
299
317
|
fromMakers = new uint256[](len);
|
|
300
318
|
|
|
@@ -309,21 +327,54 @@ abstract contract LimitRouterBase is
|
|
|
309
327
|
|
|
310
328
|
if (sharedToken == SY || totalMaking == 0) continue;
|
|
311
329
|
|
|
312
|
-
uint256 totalSy = __mintSy_Single(SY, sharedToken, totalMaking);
|
|
330
|
+
uint256 totalSy = __mintSy_Single(SY, sharedToken, totalMaking, mintSyData.inps, mintSyData.minSyOuts);
|
|
313
331
|
for (uint256 i = l; i < r; i++) {
|
|
314
332
|
uint256 netToken = params[i].makingAmount;
|
|
315
333
|
uint256 netSy = (netToken * totalSy) / totalMaking;
|
|
316
|
-
|
|
317
|
-
if (_isNewOrder(params[i].order)) {
|
|
318
|
-
require(netToken.mulDown(params[i].order.failSafeRate) <= netSy, "LOP: fail safe");
|
|
319
|
-
}
|
|
334
|
+
require(netToken.mulDown(params[i].order.failSafeRate) <= netSy, "LOP: fail safe");
|
|
320
335
|
|
|
321
336
|
params[i].makingAmount = netSy;
|
|
322
337
|
}
|
|
323
338
|
}
|
|
324
339
|
}
|
|
325
340
|
|
|
326
|
-
|
|
341
|
+
/// @dev each token group appears at most once because params are sorted by token
|
|
342
|
+
function __mintSy_Single(
|
|
343
|
+
address SY,
|
|
344
|
+
address token,
|
|
345
|
+
uint256 netTokenIn,
|
|
346
|
+
TokenInput[] memory inps,
|
|
347
|
+
uint256[] memory minSyOuts
|
|
348
|
+
) private returns (uint256 netSyOut) {
|
|
349
|
+
for (uint256 i = 0; i < inps.length; i++) {
|
|
350
|
+
if (inps[i].tokenIn == token) {
|
|
351
|
+
return __mintSy_Single_viaRouter(SY, token, netTokenIn, inps[i], minSyOuts[i]);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return __mintSy_Single_direct(SY, token, netTokenIn);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function __mintSy_Single_viaRouter(
|
|
358
|
+
address SY,
|
|
359
|
+
address token,
|
|
360
|
+
uint256 netTokenIn,
|
|
361
|
+
TokenInput memory inp,
|
|
362
|
+
uint256 minSyOut
|
|
363
|
+
) private returns (uint256 netSyOut) {
|
|
364
|
+
require(inp.swapData.needScale, "LOP: need scale");
|
|
365
|
+
require(netTokenIn <= inp.netTokenIn, "LOP: only scale down");
|
|
366
|
+
|
|
367
|
+
// Scale down input
|
|
368
|
+
uint256 scaledMinSyOut = (minSyOut * netTokenIn) / inp.netTokenIn;
|
|
369
|
+
require(scaledMinSyOut > 0, "LOP: zero scaledMinSy");
|
|
370
|
+
inp.netTokenIn = netTokenIn;
|
|
371
|
+
|
|
372
|
+
// Approve and mint via router
|
|
373
|
+
_safeApproveInf(token, ROUTER);
|
|
374
|
+
netSyOut = IPAllActionV3(ROUTER).mintSyFromToken(address(this), SY, scaledMinSyOut, inp);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function __mintSy_Single_direct(address SY, address token, uint256 netTokenIn) private returns (uint256 netSyOut) {
|
|
327
378
|
if (token == WNATIVE && !IStandardizedYield(SY).isValidTokenIn(WNATIVE)) {
|
|
328
379
|
_wrap_unwrap_ETH(WNATIVE, NATIVE, netTokenIn);
|
|
329
380
|
token = NATIVE;
|
|
@@ -374,12 +425,9 @@ abstract contract LimitRouterBase is
|
|
|
374
425
|
}
|
|
375
426
|
|
|
376
427
|
for (uint256 i = l; i < r; i++) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
require(netSy.mulDown(params[i].order.failSafeRate) <= netToken, "LOP: fail safe");
|
|
382
|
-
}
|
|
428
|
+
uint256 netSy = netSyOuts[i];
|
|
429
|
+
uint256 netToken = toMakers[i];
|
|
430
|
+
require(netSy.mulDown(params[i].order.failSafeRate) <= netToken, "LOP: fail safe");
|
|
383
431
|
}
|
|
384
432
|
}
|
|
385
433
|
}
|
|
@@ -432,8 +480,8 @@ abstract contract LimitRouterBase is
|
|
|
432
480
|
}
|
|
433
481
|
}
|
|
434
482
|
|
|
435
|
-
function
|
|
436
|
-
return
|
|
483
|
+
function hashFillParams(FillOrderParams[] memory params) public pure returns (bytes32) {
|
|
484
|
+
return keccak256(abi.encode(params));
|
|
437
485
|
}
|
|
438
486
|
|
|
439
487
|
function hashOrder(Order memory order) public view returns (bytes32) {
|
|
@@ -455,6 +503,12 @@ abstract contract LimitRouterBase is
|
|
|
455
503
|
feeRecipient = _feeRecipient;
|
|
456
504
|
}
|
|
457
505
|
|
|
506
|
+
function setMintSySigners(address _signer1, address _signer2) public onlyOwner {
|
|
507
|
+
mintSySigner1 = _signer1;
|
|
508
|
+
mintSySigner2 = _signer2;
|
|
509
|
+
emit MintSySignersSet(_signer1, _signer2);
|
|
510
|
+
}
|
|
511
|
+
|
|
458
512
|
/// @dev if zero fees are intended, it must be explicitly allowed again
|
|
459
513
|
function setLnFeeRateRoots(address[] memory YTs, uint256[] memory lnFeeRateRoots, bool allowZeroFees)
|
|
460
514
|
public
|
|
@@ -8,7 +8,7 @@ contract PendleLimitRouter is LimitRouterBase {
|
|
|
8
8
|
using Address for address;
|
|
9
9
|
using PMath for uint256;
|
|
10
10
|
|
|
11
|
-
constructor(address _WNATIVE) LimitRouterBase(_WNATIVE) {
|
|
11
|
+
constructor(address _WNATIVE, address _ROUTER) LimitRouterBase(_WNATIVE, _ROUTER) {
|
|
12
12
|
_disableInitializers();
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../interfaces/IPLimitRouter.sol";
|
|
5
|
+
import "../../interfaces/IPAllActionTypeV3.sol";
|
|
6
|
+
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
|
|
7
|
+
import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
|
|
8
|
+
|
|
9
|
+
abstract contract MintSyHelper is EIP712Upgradeable {
|
|
10
|
+
// forgefmt: disable-next-item
|
|
11
|
+
bytes32 internal constant SWAP_DATA_TYPEHASH = keccak256(
|
|
12
|
+
"SwapData("
|
|
13
|
+
"uint8 swapType,"
|
|
14
|
+
"address extRouter,"
|
|
15
|
+
"bytes extCalldata,"
|
|
16
|
+
"bool needScale"
|
|
17
|
+
")"
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// forgefmt: disable-next-item
|
|
21
|
+
bytes32 internal constant TOKEN_INPUT_TYPEHASH = keccak256(
|
|
22
|
+
"TokenInput("
|
|
23
|
+
"address tokenIn,"
|
|
24
|
+
"uint256 netTokenIn,"
|
|
25
|
+
"address tokenMintSy,"
|
|
26
|
+
"address pendleSwap,"
|
|
27
|
+
"SwapData swapData"
|
|
28
|
+
")"
|
|
29
|
+
"SwapData("
|
|
30
|
+
"uint8 swapType,"
|
|
31
|
+
"address extRouter,"
|
|
32
|
+
"bytes extCalldata,"
|
|
33
|
+
"bool needScale"
|
|
34
|
+
")"
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// forgefmt: disable-next-item
|
|
38
|
+
bytes32 internal constant MINT_SY_PAYLOAD_TYPEHASH = keccak256(
|
|
39
|
+
"MintSyPayload("
|
|
40
|
+
"TokenInput[] inps,"
|
|
41
|
+
"uint256[] minSyOuts,"
|
|
42
|
+
"uint256 expiry,"
|
|
43
|
+
"bytes32 fillParamsHash"
|
|
44
|
+
")"
|
|
45
|
+
"SwapData("
|
|
46
|
+
"uint8 swapType,"
|
|
47
|
+
"address extRouter,"
|
|
48
|
+
"bytes extCalldata,"
|
|
49
|
+
"bool needScale"
|
|
50
|
+
")"
|
|
51
|
+
"TokenInput("
|
|
52
|
+
"address tokenIn,"
|
|
53
|
+
"uint256 netTokenIn,"
|
|
54
|
+
"address tokenMintSy,"
|
|
55
|
+
"address pendleSwap,"
|
|
56
|
+
"SwapData swapData"
|
|
57
|
+
")"
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
function _verifyMintSyData(MintSyData memory mintSyData, bytes32 fillParamsHash, address signer1, address signer2)
|
|
61
|
+
internal
|
|
62
|
+
view
|
|
63
|
+
{
|
|
64
|
+
require(block.timestamp < mintSyData.expiry, "LOP: mintSy expired");
|
|
65
|
+
require(mintSyData.fillParamsHash == fillParamsHash, "LOP: mintSy params mismatch");
|
|
66
|
+
require(mintSyData.inps.length == mintSyData.minSyOuts.length, "LOP: length mismatch");
|
|
67
|
+
|
|
68
|
+
bytes32 digest =
|
|
69
|
+
hashMintSyPayload(mintSyData.inps, mintSyData.minSyOuts, mintSyData.expiry, mintSyData.fillParamsHash);
|
|
70
|
+
|
|
71
|
+
require(SignatureChecker.isValidSignatureNow(signer1, digest, mintSyData.sig1), "LOP: bad mintSy sig1");
|
|
72
|
+
require(SignatureChecker.isValidSignatureNow(signer2, digest, mintSyData.sig2), "LOP: bad mintSy sig2");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function _hashSwapData(SwapData memory d) internal pure returns (bytes32) {
|
|
76
|
+
return keccak256(abi.encode(SWAP_DATA_TYPEHASH, d.swapType, d.extRouter, keccak256(d.extCalldata), d.needScale));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function _hashTokenInput(TokenInput memory inp) internal pure returns (bytes32) {
|
|
80
|
+
return keccak256(
|
|
81
|
+
abi.encode(
|
|
82
|
+
TOKEN_INPUT_TYPEHASH,
|
|
83
|
+
inp.tokenIn,
|
|
84
|
+
inp.netTokenIn,
|
|
85
|
+
inp.tokenMintSy,
|
|
86
|
+
inp.pendleSwap,
|
|
87
|
+
_hashSwapData(inp.swapData)
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function hashMintSyPayload(
|
|
93
|
+
TokenInput[] memory inps,
|
|
94
|
+
uint256[] memory minSyOuts,
|
|
95
|
+
uint256 expiry,
|
|
96
|
+
bytes32 fillParamsHash
|
|
97
|
+
) public view returns (bytes32) {
|
|
98
|
+
bytes32[] memory inpHashes = new bytes32[](inps.length);
|
|
99
|
+
for (uint256 i = 0; i < inps.length; i++) {
|
|
100
|
+
inpHashes[i] = _hashTokenInput(inps[i]);
|
|
101
|
+
}
|
|
102
|
+
return _hashTypedDataV4(
|
|
103
|
+
keccak256(
|
|
104
|
+
abi.encode(
|
|
105
|
+
MINT_SY_PAYLOAD_TYPEHASH,
|
|
106
|
+
keccak256(abi.encodePacked(inpHashes)),
|
|
107
|
+
keccak256(abi.encodePacked(minSyOuts)),
|
|
108
|
+
expiry,
|
|
109
|
+
fillParamsHash
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -21,8 +21,10 @@ contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
|
|
|
21
21
|
event SetterSet(address indexed setter);
|
|
22
22
|
|
|
23
23
|
uint256 internal constant LIMIT_MAX_LN_FEE_RATE_ROOT = 48_790_164_169_432_003; // ln(1.05)
|
|
24
|
+
uint256 internal constant POST_FILL_AMM_LN_FEE_RATE_ROOT = 999_999_500_000; // ln(1.000001)
|
|
24
25
|
|
|
25
26
|
address public immutable router;
|
|
27
|
+
address public immutable postFillRouter;
|
|
26
28
|
IPLimitRouter public immutable limitRouter;
|
|
27
29
|
IPGovernanceProxy public immutable govProxy;
|
|
28
30
|
|
|
@@ -35,9 +37,10 @@ contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
|
|
|
35
37
|
_;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
constructor(address _router, address _limitRouter, address _govProxy) {
|
|
40
|
+
constructor(address _router, address _postFillRouter, address _limitRouter, address _govProxy) {
|
|
39
41
|
_disableInitializers();
|
|
40
42
|
router = _router;
|
|
43
|
+
postFillRouter = _postFillRouter;
|
|
41
44
|
limitRouter = IPLimitRouter(_limitRouter);
|
|
42
45
|
govProxy = IPGovernanceProxy(_govProxy);
|
|
43
46
|
}
|
|
@@ -50,6 +53,21 @@ contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
|
|
|
50
53
|
_setFeeFactors(_impliedRateToFeeFactor, _routerLnFeeToLimitLnFeeFactor);
|
|
51
54
|
}
|
|
52
55
|
|
|
56
|
+
function setPostFillRouterAMMFee(address[] memory markets) external onlyOwnerOrSetter {
|
|
57
|
+
uint256 n = markets.length;
|
|
58
|
+
|
|
59
|
+
IPGovernanceProxy.Call[] memory calls = new IPGovernanceProxy.Call[](n);
|
|
60
|
+
|
|
61
|
+
for (uint256 i = 0; i < n; ++i) {
|
|
62
|
+
calls[i].target = IPMarket(markets[i]).factory();
|
|
63
|
+
calls[i].callData = abi.encodeCall(
|
|
64
|
+
IPMarketFactory.setOverriddenFee, (postFillRouter, markets[i], POST_FILL_AMM_LN_FEE_RATE_ROOT.Uint80())
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
govProxy.aggregateWithScopedAccess(calls);
|
|
69
|
+
}
|
|
70
|
+
|
|
53
71
|
function setFees(address[] memory markets) external onlyOwnerOrSetter {
|
|
54
72
|
uint256 n = markets.length;
|
|
55
73
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
|
|
5
|
+
|
|
6
|
+
/// @dev ProxyAdmin with configurable initial owner, since OZ's ProxyAdmin doesn't support setting owner in constructor.
|
|
7
|
+
contract PendleProxyAdmin is ProxyAdmin {
|
|
8
|
+
constructor(address initialOwner) {
|
|
9
|
+
_transferOwnership(initialOwner);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -323,10 +323,12 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
323
323
|
IPLimitRouter router = IPLimitRouter(lim.limitRouter);
|
|
324
324
|
netLeft = netInput;
|
|
325
325
|
|
|
326
|
+
(bytes memory normalOptData, bytes memory flashOptData) = _decodeLimOptData(lim.optData);
|
|
327
|
+
|
|
326
328
|
if (lim.normalFills.length != 0) {
|
|
327
329
|
_safeApproveInf(address(tokenIn), lim.limitRouter);
|
|
328
330
|
(uint256 actualMaking, uint256 actualTaking, uint256 totalFee,) =
|
|
329
|
-
router.fill(lim.normalFills, receiver, netLeft,
|
|
331
|
+
router.fill(lim.normalFills, receiver, netLeft, normalOptData, EMPTY_BYTES);
|
|
330
332
|
netOut += actualMaking;
|
|
331
333
|
netLeft -= actualTaking;
|
|
332
334
|
netSyFee += totalFee;
|
|
@@ -337,7 +339,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
337
339
|
OrderType orderType = lim.flashFills[0].order.orderType;
|
|
338
340
|
|
|
339
341
|
(,, uint256 totalFee, bytes memory ret) = router.fill(
|
|
340
|
-
lim.flashFills, YT, type(uint256).max,
|
|
342
|
+
lim.flashFills, YT, type(uint256).max, flashOptData, abi.encode(orderType, YT, netLeft, receiver)
|
|
341
343
|
);
|
|
342
344
|
(uint256 netUse, uint256 netReceived) = abi.decode(ret, (uint256, uint256));
|
|
343
345
|
|
|
@@ -349,6 +351,18 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
349
351
|
doMarketOrder = netLeft > netInput.mulDown(lim.epsSkipMarket);
|
|
350
352
|
}
|
|
351
353
|
|
|
354
|
+
function _decodeLimOptData(bytes memory limOptData)
|
|
355
|
+
internal
|
|
356
|
+
pure
|
|
357
|
+
returns (bytes memory normalOptData, bytes memory flashOptData)
|
|
358
|
+
{
|
|
359
|
+
if (limOptData.length != 0) {
|
|
360
|
+
(uint256 version, bytes memory payload) = abi.decode(limOptData, (uint256, bytes));
|
|
361
|
+
require(version == 1, "invalid version");
|
|
362
|
+
(normalOptData, flashOptData) = abi.decode(payload, (bytes, bytes));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
352
366
|
function _isEmptyLimit(LimitOrderData calldata a) internal pure returns (bool) {
|
|
353
367
|
return a.normalFills.length == 0 && a.flashFills.length == 0;
|
|
354
368
|
}
|
package/deployments/1-core.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"poolDeployHelperV2": "0xF642d8Daa026B8aEd6dFE82FACbA2E077AF199E2",
|
|
47
47
|
"limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
|
|
48
48
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
49
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
49
50
|
"reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
|
|
50
51
|
"commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
|
|
51
52
|
"syFactory": "0x466CeD3b33045Ea986B2f306C8D0aA8067961CF8",
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
9
9
|
"checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
|
|
10
10
|
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
11
|
-
"feeSetter": "
|
|
11
|
+
"feeSetter": "0x95e9FC738e9C94E730536C6f28c88295d3374466"
|
|
12
12
|
}
|
package/deployments/10-core.json
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"poolDeployHelper": "0x439B4d66255eFf74e621FBacb00D7162b588Ff4b",
|
|
45
45
|
"limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
|
|
46
46
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
47
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
47
48
|
"reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
|
|
48
49
|
"vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
|
|
49
50
|
"externalRewardsDistributor": "0x33305665f69B4642D1275f4Ce81c23651674D21C",
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
8
8
|
"checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
|
|
9
9
|
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
10
|
-
"feeSetter": "
|
|
10
|
+
"feeSetter": "0x95e9FC738e9C94E730536C6f28c88295d3374466"
|
|
11
11
|
}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"pendleSwap": "0xd4F480965D2347d421F1bEC7F545682E5Ec2151D",
|
|
23
23
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
24
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
24
25
|
"sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb",
|
|
25
26
|
"crossChainSwapHub": "0xd41c99760f4A7e27E736ED25cd6915110948Ea8a",
|
|
26
27
|
"depositBoxFactory": "0x15Ff9D268ef3300a3fcCe5DE4bc4326316c5dD6D"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"hardwareDeployer": "0xeea6F790F18563E91b18DF00B89d9f79b2E6761F"
|
|
13
13
|
},
|
|
14
14
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
15
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
15
16
|
"crossChainSwapHub": "0xd41c99760f4A7e27E736ED25cd6915110948Ea8a",
|
|
16
17
|
"depositBoxFactory": "0x15Ff9D268ef3300a3fcCe5DE4bc4326316c5dD6D",
|
|
17
18
|
"sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"marketFactoryV6": "0x0AB3ae25c42a2f3748a018556989355D568Fa6d6",
|
|
39
39
|
"poolDeployHelperV2": "0x0b692f06CA82e3075dC537224450885Fd138e655",
|
|
40
40
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
41
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
41
42
|
"commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
|
|
42
43
|
"syFactory": "0x466CeD3b33045Ea986B2f306C8D0aA8067961CF8",
|
|
43
44
|
"receiverEndpoint": "0x3209E9412cca80B18338f2a56ADA59c484c39644",
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
8
8
|
"checkSolvent": "0x21332dCAe68b603B9170d25D21fda68f18Da91df",
|
|
9
9
|
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
10
|
-
"feeSetter": "
|
|
10
|
+
"feeSetter": "0x95e9FC738e9C94E730536C6f28c88295d3374466"
|
|
11
11
|
}
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"poolDeployHelper": "0xEE2eF4ADaf5Bd61FD107fD169CAe3AB79958B928",
|
|
45
45
|
"limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
|
|
46
46
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
47
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
47
48
|
"reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
|
|
48
49
|
"vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
|
|
49
50
|
"externalRewardsDistributor": "0x33305665f69B4642D1275f4Ce81c23651674D21C",
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
9
9
|
"checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
|
|
10
10
|
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
11
|
-
"feeSetter": "
|
|
11
|
+
"feeSetter": "0x95e9FC738e9C94E730536C6f28c88295d3374466",
|
|
12
12
|
"apiDeposit": "0x0B554A6B0E6E69aCAE26cF522aa8eA6f833B6C48"
|
|
13
13
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deployer": "0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7",
|
|
3
|
+
"network": {
|
|
4
|
+
"chainId": 4217,
|
|
5
|
+
"wrappedNative": "0x4200000000000000000000000000000000000006",
|
|
6
|
+
"governance": "0x7877AdFaDEd756f3248a0EBfe8Ac2E2eF87b75Ac",
|
|
7
|
+
"devMultisig": "0xE6F0489ED91dc27f40f9dbe8f81fccbFC16b9cb1",
|
|
8
|
+
"hardwareDeployer": "0xeea6F790F18563E91b18DF00B89d9f79b2E6761F"
|
|
9
|
+
},
|
|
10
|
+
"proxyAdmin": "0xD1253ec561EE8708Bd08a77e817668B288f643b3",
|
|
11
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
12
|
+
"governanceProxy": "0x2aD631F72fB16d91c4953A7f4260A97C2fE2f31e",
|
|
13
|
+
"sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb"
|
|
14
|
+
}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"governanceProxy": "0x2aD631F72fB16d91c4953A7f4260A97C2fE2f31e",
|
|
22
22
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
23
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
23
24
|
"crossChainSwapHub": "0xd41c99760f4A7e27E736ED25cd6915110948Ea8a",
|
|
24
25
|
"depositBoxFactory": "0x15Ff9D268ef3300a3fcCe5DE4bc4326316c5dD6D"
|
|
25
26
|
}
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"poolDeployHelperV2": "0x6E716B682D0b63E7BF2C7b1cD20F2Fc2F3596fc7",
|
|
44
44
|
"limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
|
|
45
45
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
46
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
46
47
|
"reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
|
|
47
48
|
"commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
|
|
48
49
|
"syFactory": "0x466CeD3b33045Ea986B2f306C8D0aA8067961CF8",
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
9
9
|
"checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
|
|
10
10
|
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
11
|
-
"feeSetter": "
|
|
11
|
+
"feeSetter": "0x95e9FC738e9C94E730536C6f28c88295d3374466"
|
|
12
12
|
}
|
package/deployments/56-core.json
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"poolDeployHelper": "0xF536323e5825dCb1Bc9b4DE74D63111189532b5f",
|
|
45
45
|
"limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
|
|
46
46
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
47
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
47
48
|
"reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
|
|
48
49
|
"commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
|
|
49
50
|
"syFactory": "0x466CeD3b33045Ea986B2f306C8D0aA8067961CF8",
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
9
9
|
"checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
|
|
10
10
|
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
11
|
-
"feeSetter": "
|
|
11
|
+
"feeSetter": "0x95e9FC738e9C94E730536C6f28c88295d3374466"
|
|
12
12
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"hardwareDeployer": "0xeea6F790F18563E91b18DF00B89d9f79b2E6761F"
|
|
13
13
|
},
|
|
14
14
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
15
|
+
"devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
|
|
15
16
|
"sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb",
|
|
16
17
|
"crossChainSwapHub": "0xd41c99760f4A7e27E736ED25cd6915110948Ea8a",
|
|
17
18
|
"depositBoxFactory": "0x15Ff9D268ef3300a3fcCe5DE4bc4326316c5dD6D"
|