@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
|
@@ -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": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212200d7413abdb872e5b5a8bbc78892d3079ede81e32ae79698279c5a62c3f4aef0964736f6c634300081e0033",
|
|
7
|
+
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212200d7413abdb872e5b5a8bbc78892d3079ede81e32ae79698279c5a62c3f4aef0964736f6c634300081e0033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "MarketApproxPtInLibV2",
|
|
4
4
|
"sourceName": "contracts/router/math/MarketApproxLibV2.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220b15ed4506ea173efdf5a1c91008b9ea868e37437fa7a7eda34843eb85b61d08364736f6c634300081e0033",
|
|
7
|
+
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220b15ed4506ea173efdf5a1c91008b9ea868e37437fa7a7eda34843eb85b61d08364736f6c634300081e0033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "MarketApproxPtOutLibV2",
|
|
4
4
|
"sourceName": "contracts/router/math/MarketApproxLibV2.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220d61e3865ad4a7726615c39319c8ef235ee1c10bfc13aed9dc4e3b5c04c0464b664736f6c634300081e0033",
|
|
7
|
+
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220d61e3865ad4a7726615c39319c8ef235ee1c10bfc13aed9dc4e3b5c04c0464b664736f6c634300081e0033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
|
|
2
|
+
pragma solidity ^0.8.19;
|
|
3
|
+
|
|
4
|
+
import {IPChainlinkOracleEssential} from "../interfaces/IPChainlinkOracleEssential.sol";
|
|
5
|
+
import {IPFixedPricePTAMMSwapCallback, IPFixedPricePTAMMV2} from "../interfaces/IPFixedPricePTAMMV2.sol";
|
|
6
|
+
|
|
7
|
+
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
|
|
8
|
+
import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
|
|
9
|
+
import {
|
|
10
|
+
IERC20MetadataUpgradeable
|
|
11
|
+
} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
|
|
12
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
13
|
+
|
|
14
|
+
import {BoringOwnableUpgradeableV2} from "../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
15
|
+
import {TokenHelper} from "../core/libraries/TokenHelper.sol";
|
|
16
|
+
import {PMath} from "../core/libraries/math/PMath.sol";
|
|
17
|
+
|
|
18
|
+
contract FixedPricePTAMMV2 is
|
|
19
|
+
IPFixedPricePTAMMV2,
|
|
20
|
+
BoringOwnableUpgradeableV2,
|
|
21
|
+
ERC20Upgradeable,
|
|
22
|
+
ReentrancyGuardUpgradeable,
|
|
23
|
+
TokenHelper
|
|
24
|
+
{
|
|
25
|
+
// cast index-erc7201 "pendle.FixedPricePTAMM.storage"
|
|
26
|
+
uint256 internal constant STORAGE_SLOT = 0xbbf04d9aae855c6bd76c8f4ba7a918994ad0d002f537323e58c83cbfe5249000;
|
|
27
|
+
|
|
28
|
+
using PMath for uint256;
|
|
29
|
+
using PMath for int256;
|
|
30
|
+
|
|
31
|
+
address public immutable outputToken;
|
|
32
|
+
|
|
33
|
+
constructor(address _outputToken) {
|
|
34
|
+
_disableInitializers();
|
|
35
|
+
outputToken = _outputToken;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function initialize(address _owner) external initializer {
|
|
39
|
+
__BoringOwnableV2_init(_owner);
|
|
40
|
+
__ERC20_init(
|
|
41
|
+
string.concat(IERC20Metadata(outputToken).name(), " receipt"),
|
|
42
|
+
string.concat(IERC20Metadata(outputToken).symbol(), "-receipt")
|
|
43
|
+
);
|
|
44
|
+
__ReentrancyGuard_init();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function decimals() public view override(ERC20Upgradeable, IERC20MetadataUpgradeable) returns (uint8) {
|
|
48
|
+
return IERC20Metadata(outputToken).decimals();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
struct OracleData {
|
|
52
|
+
bool isPaused;
|
|
53
|
+
address oracle;
|
|
54
|
+
// @notice This can be seen as the price at maturity.
|
|
55
|
+
// @notice This can help with decimals conversion.
|
|
56
|
+
uint256 multiplier;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
struct Storage {
|
|
60
|
+
mapping(address PT => OracleData) priceOracle;
|
|
61
|
+
mapping(address PT => uint256) totalPT;
|
|
62
|
+
mapping(address user => bool) isWhitelisted;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function $() internal pure returns (Storage storage res) {
|
|
66
|
+
assembly ("memory-safe") {
|
|
67
|
+
res.slot := STORAGE_SLOT
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function priceOracle(address PT)
|
|
72
|
+
public
|
|
73
|
+
view
|
|
74
|
+
returns (bool isPaused, IPChainlinkOracleEssential oracle, uint256 multiplier)
|
|
75
|
+
{
|
|
76
|
+
OracleData memory data = $().priceOracle[PT];
|
|
77
|
+
isPaused = data.isPaused;
|
|
78
|
+
oracle = IPChainlinkOracleEssential(data.oracle);
|
|
79
|
+
multiplier = data.multiplier;
|
|
80
|
+
|
|
81
|
+
require(address(oracle) != address(0), "FixedPricePTAMMV2: oracle not set");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function totalPt(address PT) external view returns (uint256) {
|
|
85
|
+
return $().totalPT[PT];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function isWhitelisted(address user) external view returns (bool) {
|
|
89
|
+
return $().isWhitelisted[user];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function previewSwapExactPtForToken(address PT, uint256 exactPtIn) public view returns (uint256 amountTokenOut) {
|
|
93
|
+
(bool isPaused, IPChainlinkOracleEssential oracle, uint256 multiplier) = priceOracle(PT);
|
|
94
|
+
require(!isPaused, "FixedPricePTAMMV2: trading paused");
|
|
95
|
+
|
|
96
|
+
(, int256 rawPrice,,,) = oracle.latestRoundData();
|
|
97
|
+
|
|
98
|
+
// exactPtIn * rawPrice * multiplier
|
|
99
|
+
return (exactPtIn * rawPrice.Uint() * multiplier) / (PMath.ONE * PMath.ONE);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function swapExactPtForToken(address receiver, address PT, uint256 exactPtIn, bytes calldata data)
|
|
103
|
+
external
|
|
104
|
+
nonReentrant
|
|
105
|
+
returns (uint256 netTokenOut)
|
|
106
|
+
{
|
|
107
|
+
netTokenOut = previewSwapExactPtForToken(PT, exactPtIn);
|
|
108
|
+
|
|
109
|
+
_transferOut(outputToken, receiver, netTokenOut);
|
|
110
|
+
|
|
111
|
+
if (data.length > 0) {
|
|
112
|
+
IPFixedPricePTAMMSwapCallback(msg.sender).swapCallback(netTokenOut, exactPtIn, data);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
$().totalPT[PT] += exactPtIn;
|
|
116
|
+
require(_selfBalance(PT) >= $().totalPT[PT], "FixedPricePTAMMV2: insufficient PT received");
|
|
117
|
+
|
|
118
|
+
emit Swap(msg.sender, receiver, PT, exactPtIn, netTokenOut);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Add/remove funds
|
|
122
|
+
|
|
123
|
+
modifier onlyWhitelisted() {
|
|
124
|
+
require($().isWhitelisted[msg.sender], "FixedPricePTAMMV2: Not whitelisted");
|
|
125
|
+
_;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function addFundWhitelisted(uint256 amount) external onlyWhitelisted nonReentrant {
|
|
129
|
+
_transferIn(outputToken, msg.sender, amount);
|
|
130
|
+
_mint(msg.sender, amount);
|
|
131
|
+
emit TokenFunded(msg.sender, amount);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function removeFund(uint256 amount) external nonReentrant {
|
|
135
|
+
_burn(msg.sender, amount);
|
|
136
|
+
_transferOut(outputToken, msg.sender, amount);
|
|
137
|
+
emit TokenWithdrawn(msg.sender, amount);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Admin functions
|
|
141
|
+
|
|
142
|
+
function withdrawPt(address PT, uint256 amount) external onlyOwner {
|
|
143
|
+
_transferOut(PT, msg.sender, amount);
|
|
144
|
+
$().totalPT[PT] -= amount;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function setWhitelist(address user, bool isWhitelisted_) external onlyOwner {
|
|
148
|
+
$().isWhitelisted[user] = isWhitelisted_;
|
|
149
|
+
emit WhitelistUpdated(user, isWhitelisted_);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function setPriceOracle(address PT, address _priceOracle, uint256 _multiplier) external onlyOwner {
|
|
153
|
+
$().priceOracle[PT].oracle = _priceOracle;
|
|
154
|
+
$().priceOracle[PT].multiplier = _multiplier;
|
|
155
|
+
emit PriceOracleUpdated(PT, _priceOracle);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function setPausePtTrading(address PT, bool isPaused) external onlyOwner {
|
|
159
|
+
$().priceOracle[PT].isPaused = isPaused;
|
|
160
|
+
emit PauseStatusUpdated(PT, isPaused);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {IPSwapAggregator, SwapType} from "
|
|
4
|
+
import {TokenHelper} from "../core/libraries/TokenHelper.sol";
|
|
5
|
+
import {IPFixedPricePTAMMV2} from "../interfaces/IPFixedPricePTAMMV2.sol";
|
|
6
|
+
import {IPSwapHelper, TokenOutput} from "../interfaces/IPSwapHelper.sol";
|
|
7
|
+
import {IPSwapAggregator, SwapType} from "../router/swap-aggregator/IPSwapAggregator.sol";
|
|
8
8
|
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
9
9
|
|
|
10
|
-
contract
|
|
10
|
+
contract PendleSwapHelper is IPSwapHelper, TokenHelper {
|
|
11
11
|
function swapWithFixedPricePTAMM(
|
|
12
12
|
address receiver,
|
|
13
13
|
address fixedPricePTAMM,
|
|
@@ -15,9 +15,13 @@ contract ActionCrossChain is ActionBase, IPActionCrossChain {
|
|
|
15
15
|
uint256 exactPtIn,
|
|
16
16
|
TokenOutput calldata out
|
|
17
17
|
) external returns (uint256 netTokenOut) {
|
|
18
|
+
require(
|
|
19
|
+
out.tokenRedeemSy == IPFixedPricePTAMMV2(fixedPricePTAMM).outputToken(), "SwapHelper: INVALID_TOKEN_REDEEM"
|
|
20
|
+
);
|
|
21
|
+
|
|
18
22
|
_transferFrom(IERC20(PT), msg.sender, fixedPricePTAMM, exactPtIn);
|
|
19
|
-
uint256 tokenOut =
|
|
20
|
-
.swapExactPtForToken(__swapDestination(receiver, out), PT, exactPtIn,
|
|
23
|
+
uint256 tokenOut = IPFixedPricePTAMMV2(fixedPricePTAMM)
|
|
24
|
+
.swapExactPtForToken(__swapDestination(receiver, out), PT, exactPtIn, "");
|
|
21
25
|
return __handleTokenOutput(receiver, tokenOut, out);
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.30;
|
|
3
|
+
|
|
4
|
+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
5
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
6
|
+
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
|
|
7
|
+
import {BoringOwnableUpgradeableV2} from "../../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
8
|
+
import {TokenHelper} from "../../core/libraries/TokenHelper.sol";
|
|
9
|
+
import {BridgeData, IPBridgeFunder} from "../../interfaces/IPBridgeFunder.sol";
|
|
10
|
+
import {IPDepositBox} from "../../interfaces/IPDepositBox.sol";
|
|
11
|
+
import {IPDepositBoxFactory} from "../../interfaces/IPDepositBoxFactory.sol";
|
|
12
|
+
|
|
13
|
+
contract BridgeFunder is IPBridgeFunder, BoringOwnableUpgradeableV2, TokenHelper {
|
|
14
|
+
using Address for address;
|
|
15
|
+
using SafeERC20 for IERC20;
|
|
16
|
+
|
|
17
|
+
IPDepositBoxFactory public immutable DEPOSIT_BOX_FACTORY;
|
|
18
|
+
|
|
19
|
+
constructor(address depositBoxFactory_) {
|
|
20
|
+
_disableInitializers();
|
|
21
|
+
DEPOSIT_BOX_FACTORY = IPDepositBoxFactory(depositBoxFactory_);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function initialize(address _owner) external initializer {
|
|
25
|
+
__BoringOwnableV2_init(_owner);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
modifier onlyDepositBox() {
|
|
29
|
+
IPDepositBox box = IPDepositBox(msg.sender);
|
|
30
|
+
address owner = box.OWNER();
|
|
31
|
+
uint32 boxId = box.BOX_ID();
|
|
32
|
+
|
|
33
|
+
(address computedBox,,) = DEPOSIT_BOX_FACTORY.computeDepositBox(owner, boxId);
|
|
34
|
+
require(computedBox == address(box), "BridgeFunder: caller is not deposit box");
|
|
35
|
+
_;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function bridge(BridgeData memory $) external onlyDepositBox returns (bytes memory result) {
|
|
39
|
+
require(
|
|
40
|
+
$.bridgeToken != $.feeToken && $.bridgeToken != NATIVE && $.feeToken != NATIVE,
|
|
41
|
+
"BridgeFunder: unsupported token"
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
_transferIn($.bridgeToken, msg.sender, $.bridgeAmount);
|
|
45
|
+
_approveForExtRouter($.bridgeToken, $.bridgeExtRouter, $.bridgeAmount);
|
|
46
|
+
_approveForExtRouter($.feeToken, $.bridgeExtRouter, $.feeAmount);
|
|
47
|
+
|
|
48
|
+
result = $.bridgeExtRouter.functionCall($.bridgeCalldata);
|
|
49
|
+
|
|
50
|
+
_approveForExtRouter($.bridgeToken, $.bridgeExtRouter, 0);
|
|
51
|
+
_approveForExtRouter($.feeToken, $.bridgeExtRouter, 0);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function withdraw(address receiver, address token, uint256 amount) external onlyOwner {
|
|
55
|
+
_transferOut(token, receiver, amount);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _approveForExtRouter(address token, address extRouter, uint256 amount) internal {
|
|
59
|
+
IERC20(token).forceApprove(extRouter, amount);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.0;
|
|
4
|
+
|
|
5
|
+
import {OFTAdapterImpl} from "./OFTAdapterImpl.sol";
|
|
6
|
+
import {
|
|
7
|
+
MessagingParams,
|
|
8
|
+
MessagingFee,
|
|
9
|
+
MessagingReceipt
|
|
10
|
+
} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
|
|
11
|
+
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
12
|
+
|
|
13
|
+
// @notice Base OFT contract, without any additional functionality (like RateLimiter).
|
|
14
|
+
// @dev This contract inherits Ownable from OpenZeppelin v4.
|
|
15
|
+
// @dev Sender is set as the contract owner at deployment.
|
|
16
|
+
contract OFTAdapterAltImpl is OFTAdapterImpl {
|
|
17
|
+
using SafeERC20 for IERC20;
|
|
18
|
+
|
|
19
|
+
error MsgValueNotZero(uint256 msgValue);
|
|
20
|
+
error NativeTokenUnavailable();
|
|
21
|
+
|
|
22
|
+
address public immutable nativeToken;
|
|
23
|
+
|
|
24
|
+
constructor(address _token, address _endpoint, address _delegate) OFTAdapterImpl(_token, _endpoint, _delegate) {
|
|
25
|
+
nativeToken = endpoint.nativeToken();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _lzSend(
|
|
29
|
+
uint32 _dstEid,
|
|
30
|
+
bytes memory _message,
|
|
31
|
+
bytes memory _options,
|
|
32
|
+
MessagingFee memory _fee,
|
|
33
|
+
address _refundAddress
|
|
34
|
+
) internal override returns (MessagingReceipt memory receipt) {
|
|
35
|
+
// In Alt implementation, msg.value should always be 0 since we use ERC20 tokens for fees
|
|
36
|
+
if (msg.value > 0) revert MsgValueNotZero(msg.value);
|
|
37
|
+
|
|
38
|
+
// Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.
|
|
39
|
+
_payNative(_fee.nativeFee);
|
|
40
|
+
if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);
|
|
41
|
+
|
|
42
|
+
return endpoint.send(
|
|
43
|
+
MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0), _refundAddress
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function _payNative(uint256 _nativeFee) internal override returns (uint256 nativeFee) {
|
|
48
|
+
if (nativeToken == address(0)) revert NativeTokenUnavailable();
|
|
49
|
+
|
|
50
|
+
// Pay Native token fee by sending tokens to the endpoint.
|
|
51
|
+
IERC20(nativeToken).safeTransferFrom(msg.sender, address(endpoint), _nativeFee);
|
|
52
|
+
|
|
53
|
+
return _nativeFee;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.19;
|
|
3
|
+
|
|
4
|
+
import {PendleBridgedPrincipalToken} from "./PendleBridgedPrincipalToken.sol";
|
|
5
|
+
import {
|
|
6
|
+
MessagingParams,
|
|
7
|
+
MessagingFee,
|
|
8
|
+
MessagingReceipt
|
|
9
|
+
} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
|
|
10
|
+
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
11
|
+
|
|
12
|
+
contract PendleBridgedPrincipalTokenAlt is PendleBridgedPrincipalToken {
|
|
13
|
+
using SafeERC20 for IERC20;
|
|
14
|
+
|
|
15
|
+
error MsgValueNotZero(uint256 msgValue);
|
|
16
|
+
error NativeTokenUnavailable();
|
|
17
|
+
|
|
18
|
+
address public immutable nativeToken;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
string memory _name,
|
|
22
|
+
string memory _symbol,
|
|
23
|
+
address _lzEndpoint,
|
|
24
|
+
address _delegate,
|
|
25
|
+
uint256 _expiry,
|
|
26
|
+
uint8 _localDecimals,
|
|
27
|
+
uint8 _sharedDecimals,
|
|
28
|
+
address initialOwner
|
|
29
|
+
)
|
|
30
|
+
PendleBridgedPrincipalToken(
|
|
31
|
+
_name, _symbol, _lzEndpoint, _delegate, _expiry, _localDecimals, _sharedDecimals, initialOwner
|
|
32
|
+
)
|
|
33
|
+
{
|
|
34
|
+
nativeToken = endpoint.nativeToken();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function _lzSend(
|
|
38
|
+
uint32 _dstEid,
|
|
39
|
+
bytes memory _message,
|
|
40
|
+
bytes memory _options,
|
|
41
|
+
MessagingFee memory _fee,
|
|
42
|
+
address _refundAddress
|
|
43
|
+
) internal override returns (MessagingReceipt memory receipt) {
|
|
44
|
+
// In Alt implementation, msg.value should always be 0 since we use ERC20 tokens for fees
|
|
45
|
+
if (msg.value > 0) revert MsgValueNotZero(msg.value);
|
|
46
|
+
|
|
47
|
+
// Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.
|
|
48
|
+
_payNative(_fee.nativeFee);
|
|
49
|
+
if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);
|
|
50
|
+
|
|
51
|
+
return endpoint.send(
|
|
52
|
+
MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0), _refundAddress
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _payNative(uint256 _nativeFee) internal override returns (uint256 nativeFee) {
|
|
57
|
+
if (nativeToken == address(0)) revert NativeTokenUnavailable();
|
|
58
|
+
|
|
59
|
+
// Pay Native token fee by sending tokens to the endpoint.
|
|
60
|
+
IERC20(nativeToken).safeTransferFrom(msg.sender, address(endpoint), _nativeFee);
|
|
61
|
+
|
|
62
|
+
return _nativeFee;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -4,7 +4,6 @@ pragma solidity ^0.8.0;
|
|
|
4
4
|
|
|
5
5
|
import "./IPActionAddRemoveLiqV3.sol";
|
|
6
6
|
import "./IPActionCallbackV3.sol";
|
|
7
|
-
import "./IPActionCrossChain.sol";
|
|
8
7
|
import "./IPActionMiscV3.sol";
|
|
9
8
|
import "./IPActionSimple.sol";
|
|
10
9
|
import "./IPActionStorageV4.sol";
|
|
@@ -18,6 +17,5 @@ interface IPAllActionV3 is
|
|
|
18
17
|
IPActionMiscV3,
|
|
19
18
|
IPActionCallbackV3,
|
|
20
19
|
IPActionStorageV4,
|
|
21
|
-
IPActionSimple
|
|
22
|
-
IPActionCrossChain
|
|
20
|
+
IPActionSimple
|
|
23
21
|
{}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
struct BridgeData {
|
|
5
|
+
address bridgeToken;
|
|
6
|
+
uint256 bridgeAmount;
|
|
7
|
+
address feeToken;
|
|
8
|
+
uint256 feeAmount;
|
|
9
|
+
address bridgeExtRouter;
|
|
10
|
+
bytes bridgeCalldata;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IPBridgeFunder {
|
|
14
|
+
function bridge(BridgeData memory data) external returns (bytes memory);
|
|
15
|
+
|
|
16
|
+
function withdraw(address receiver, address token, uint256 amount) external;
|
|
17
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
|
|
2
|
+
pragma solidity ^0.8.19;
|
|
3
|
+
|
|
4
|
+
import {IPChainlinkOracleEssential} from "../interfaces/IPChainlinkOracleEssential.sol";
|
|
5
|
+
import {
|
|
6
|
+
IERC20MetadataUpgradeable
|
|
7
|
+
} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
|
|
8
|
+
|
|
9
|
+
interface IPFixedPricePTAMMV2 is IERC20MetadataUpgradeable {
|
|
10
|
+
event Swap(address indexed caller, address indexed receiver, address PT, uint256 netPtIn, uint256 netTokenOut);
|
|
11
|
+
|
|
12
|
+
event PriceOracleUpdated(address indexed PT, address indexed priceOracle);
|
|
13
|
+
|
|
14
|
+
event TokenFunded(address indexed sender, uint256 amount);
|
|
15
|
+
|
|
16
|
+
event TokenWithdrawn(address indexed sender, uint256 amount);
|
|
17
|
+
|
|
18
|
+
event WhitelistUpdated(address indexed user, bool isWhitelisted);
|
|
19
|
+
|
|
20
|
+
event PauseStatusUpdated(address indexed PT, bool isPaused);
|
|
21
|
+
|
|
22
|
+
function outputToken() external view returns (address);
|
|
23
|
+
|
|
24
|
+
function priceOracle(address PT)
|
|
25
|
+
external
|
|
26
|
+
view
|
|
27
|
+
returns (bool isPaused, IPChainlinkOracleEssential, uint256 multiplier);
|
|
28
|
+
|
|
29
|
+
function totalPt(address PT) external view returns (uint256);
|
|
30
|
+
|
|
31
|
+
function isWhitelisted(address user) external view returns (bool);
|
|
32
|
+
|
|
33
|
+
function previewSwapExactPtForToken(address PT, uint256 exactPtIn) external view returns (uint256 amountTokenOut);
|
|
34
|
+
|
|
35
|
+
function swapExactPtForToken(address receiver, address PT, uint256 exactPtIn, bytes calldata data)
|
|
36
|
+
external
|
|
37
|
+
returns (uint256 netTokenOut);
|
|
38
|
+
|
|
39
|
+
// Add/remove funds
|
|
40
|
+
|
|
41
|
+
function addFundWhitelisted(uint256 amount) external;
|
|
42
|
+
|
|
43
|
+
function removeFund(uint256 amount) external;
|
|
44
|
+
|
|
45
|
+
// Admin functions
|
|
46
|
+
|
|
47
|
+
function withdrawPt(address PT, uint256 amount) external;
|
|
48
|
+
|
|
49
|
+
function setWhitelist(address user, bool isWhitelisted) external;
|
|
50
|
+
|
|
51
|
+
function setPriceOracle(address PT, address priceOracle, uint256 multiplier) external;
|
|
52
|
+
|
|
53
|
+
function setPausePtTrading(address PT, bool isPaused) external;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface IPFixedPricePTAMMSwapCallback {
|
|
57
|
+
function swapCallback(uint256 exactTokenOut, uint256 netPtIn, bytes calldata data) external;
|
|
58
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
4
|
import "../core/StandardizedYield/PYIndex.sol";
|
|
5
|
+
import "../interfaces/IPAllActionTypeV3.sol";
|
|
5
6
|
|
|
6
7
|
interface IPLimitOrderType {
|
|
7
8
|
enum OrderType {
|
|
@@ -59,6 +60,16 @@ struct FillOrderParams {
|
|
|
59
60
|
uint256 makingAmount;
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
struct MintSyData {
|
|
64
|
+
TokenInput[] inps;
|
|
65
|
+
uint256[] minSyOuts;
|
|
66
|
+
uint256 expiry;
|
|
67
|
+
bytes32 fillParamsHash;
|
|
68
|
+
|
|
69
|
+
bytes sig1;
|
|
70
|
+
bytes sig2;
|
|
71
|
+
}
|
|
72
|
+
|
|
62
73
|
interface IPLimitRouterCallback is IPLimitOrderType {
|
|
63
74
|
function limitRouterCallback(uint256 actualMaking, uint256 actualTaking, uint256 totalFee, bytes memory data)
|
|
64
75
|
external
|
|
@@ -94,6 +105,9 @@ interface IPLimitRouter is IPLimitOrderType {
|
|
|
94
105
|
// event added on 2/1/2025
|
|
95
106
|
event LnFeeRateRootsSet(address[] YTs, uint256[] lnFeeRateRoots);
|
|
96
107
|
|
|
108
|
+
// event added on 11/3/2026
|
|
109
|
+
event MintSySignersSet(address signer1, address signer2);
|
|
110
|
+
|
|
97
111
|
// @dev actualMaking, actualTaking are in the SY form
|
|
98
112
|
function fill(
|
|
99
113
|
FillOrderParams[] memory params,
|
|
@@ -105,6 +119,12 @@ interface IPLimitRouter is IPLimitOrderType {
|
|
|
105
119
|
|
|
106
120
|
function feeRecipient() external view returns (address);
|
|
107
121
|
|
|
122
|
+
function mintSySigner1() external view returns (address);
|
|
123
|
+
|
|
124
|
+
function mintSySigner2() external view returns (address);
|
|
125
|
+
|
|
126
|
+
function hashFillParams(FillOrderParams[] memory params) external pure returns (bytes32);
|
|
127
|
+
|
|
108
128
|
function hashOrder(Order memory order) external view returns (bytes32);
|
|
109
129
|
|
|
110
130
|
function preSignSingle(Order calldata order) external;
|
|
@@ -131,6 +151,8 @@ interface IPLimitRouter is IPLimitOrderType {
|
|
|
131
151
|
|
|
132
152
|
function WNATIVE() external view returns (address);
|
|
133
153
|
|
|
154
|
+
function ROUTER() external view returns (address);
|
|
155
|
+
|
|
134
156
|
function _checkSig(Order memory order, bytes memory signature)
|
|
135
157
|
external
|
|
136
158
|
view
|