@pendle/core-v2 5.12.2-cross-chain-pt → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.json +2 -2
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.json +2 -2
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +4 -0
- package/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol +1 -3
- package/deployments/1-core.json +1 -2
- package/deployments/999-core.json +52 -0
- package/deployments/999-offchain-helper.json +7 -0
- package/package.json +6 -6
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleSparkLinearDiscountOracleFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleSparkLinearDiscountOracle__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +0 -108
- package/typechain-types/index.ts +0 -24
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.json +0 -466
- package/build/artifacts/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol/PendlePTOFTAdapterFactory.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol/PendlePTOFTAdapterFactory.json +0 -191
- package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterImpl.sol/OFTAdapterImpl.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterImpl.sol/OFTAdapterImpl.json +0 -1265
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/BasePendleBridgedPrincipalToken.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/BasePendleBridgedPrincipalToken.json +0 -1527
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken_18Decimals.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken_18Decimals.json +0 -1558
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken_6Decimals.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken_6Decimals.json +0 -1558
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken_8Decimals.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken_8Decimals.json +0 -1558
- package/build/artifacts/contracts/interfaces/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.json +0 -928
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.json +0 -57
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.json +0 -302
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.json +0 -34
- package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.json +0 -81
- package/contracts/cross-chain/FixedPricePTAMM.sol +0 -121
- package/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol +0 -33
- package/contracts/cross-chain/oftImpl/hub/OFTAdapterImpl.sol +0 -12
- package/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol +0 -61
- package/contracts/interfaces/IPBridgedPrincipalToken.sol +0 -11
- package/contracts/interfaces/IPChainlinkOracleEssential.sol +0 -11
- package/contracts/interfaces/IPFixedPricePTAMM.sol +0 -54
- package/contracts/interfaces/IPPTOFTAdapterFactory.sol +0 -12
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.19;
|
|
3
|
-
|
|
4
|
-
import {IPBridgedPrincipalToken} from "../../../interfaces/IPBridgedPrincipalToken.sol";
|
|
5
|
-
import {OFT, OFTCore, IOFT} from "@layerzerolabs/oft-evm/contracts/OFT.sol";
|
|
6
|
-
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
7
|
-
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
8
|
-
|
|
9
|
-
abstract contract BasePendleBridgedPrincipalToken is IPBridgedPrincipalToken, OFT {
|
|
10
|
-
uint256 public immutable expiry;
|
|
11
|
-
|
|
12
|
-
constructor(
|
|
13
|
-
string memory _name,
|
|
14
|
-
string memory _symbol,
|
|
15
|
-
address _lzEndpoint,
|
|
16
|
-
address _delegate,
|
|
17
|
-
uint256 _expiry
|
|
18
|
-
) OFT(_name, _symbol, _lzEndpoint, _delegate) {
|
|
19
|
-
expiry = _expiry;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The below contracts only overrides the `decimals()` and `sharedDecimals()` function
|
|
25
|
-
* - For Pendle PT, the decimals are based on the underlying asset. So we need
|
|
26
|
-
* to set the decimals correctly at **deployment**.
|
|
27
|
-
* - For technical reason, in OFT's constructor, the `decimals()` function was
|
|
28
|
-
* invoked.
|
|
29
|
-
* (https://github.com/LayerZero-Labs/devtools/blob/feb000c1717ee89f965996cc9ab5a8a75effbcab/packages/oft-evm/contracts/OFT.sol#L25)
|
|
30
|
-
* - The current best way to do this is to hard-code the decimals in the contracts.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
// prettier-ignore
|
|
34
|
-
contract PendleBridgedPrincipalToken_18Decimals is BasePendleBridgedPrincipalToken {
|
|
35
|
-
constructor(string memory _name, string memory _symbol, address _lzEndpoint, address _delegate, uint256 _expiry)
|
|
36
|
-
BasePendleBridgedPrincipalToken(_name, _symbol, _lzEndpoint, _delegate, _expiry)
|
|
37
|
-
{}
|
|
38
|
-
|
|
39
|
-
function decimals() public pure override(ERC20, IERC20Metadata) returns (uint8) { return 18; }
|
|
40
|
-
function sharedDecimals() public pure override(OFTCore, IOFT) returns (uint8) { return 6; }
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// prettier-ignore
|
|
44
|
-
contract PendleBridgedPrincipalToken_6Decimals is BasePendleBridgedPrincipalToken {
|
|
45
|
-
constructor(string memory _name, string memory _symbol, address _lzEndpoint, address _delegate, uint256 _expiry)
|
|
46
|
-
BasePendleBridgedPrincipalToken(_name, _symbol, _lzEndpoint, _delegate, _expiry)
|
|
47
|
-
{}
|
|
48
|
-
|
|
49
|
-
function decimals() public pure override(ERC20, IERC20Metadata) returns (uint8) { return 6; }
|
|
50
|
-
function sharedDecimals() public pure override(OFTCore, IOFT) returns (uint8) { return 6; }
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// prettier-ignore
|
|
54
|
-
contract PendleBridgedPrincipalToken_8Decimals is BasePendleBridgedPrincipalToken {
|
|
55
|
-
constructor(string memory _name, string memory _symbol, address _lzEndpoint, address _delegate, uint256 _expiry)
|
|
56
|
-
BasePendleBridgedPrincipalToken(_name, _symbol, _lzEndpoint, _delegate, _expiry)
|
|
57
|
-
{}
|
|
58
|
-
|
|
59
|
-
function decimals() public pure override(ERC20, IERC20Metadata) returns (uint8) { return 8; }
|
|
60
|
-
function sharedDecimals() public pure override(OFTCore, IOFT) returns (uint8) { return 6; }
|
|
61
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.0;
|
|
3
|
-
|
|
4
|
-
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
5
|
-
import {IOFT} from "@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol";
|
|
6
|
-
import {IOAppCore} from "@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol";
|
|
7
|
-
import {IOAppOptionsType3} from "@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppOptionsType3.sol";
|
|
8
|
-
|
|
9
|
-
interface IPBridgedPrincipalToken is IOFT, IOAppCore, IOAppOptionsType3, IERC20Metadata {
|
|
10
|
-
function expiry() external view returns (uint256);
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.0;
|
|
3
|
-
|
|
4
|
-
interface IPChainlinkOracleEssential {
|
|
5
|
-
function decimals() external view returns (uint8);
|
|
6
|
-
|
|
7
|
-
function latestRoundData()
|
|
8
|
-
external
|
|
9
|
-
view
|
|
10
|
-
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
|
|
11
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
|
|
2
|
-
pragma solidity ^0.8.19;
|
|
3
|
-
|
|
4
|
-
import {IPBridgedPrincipalToken} from "./IPBridgedPrincipalToken.sol";
|
|
5
|
-
import {IPChainlinkOracleEssential} from "../interfaces/IPChainlinkOracleEssential.sol";
|
|
6
|
-
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
7
|
-
|
|
8
|
-
interface IPFixedPricePTAMM {
|
|
9
|
-
event Swap(
|
|
10
|
-
address indexed caller,
|
|
11
|
-
address indexed receiver,
|
|
12
|
-
address PT,
|
|
13
|
-
uint256 netPtIn,
|
|
14
|
-
address token,
|
|
15
|
-
uint256 netTokenOut
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
event PriceOracleUpdated(address indexed PT, address indexed token, address indexed priceOracle);
|
|
19
|
-
|
|
20
|
-
event Seeded(address indexed token, uint256 amount);
|
|
21
|
-
event Unseeded(address indexed token, uint256 amount);
|
|
22
|
-
|
|
23
|
-
function priceOracle(address PT, address token) external view returns (IPChainlinkOracleEssential);
|
|
24
|
-
|
|
25
|
-
function getPtToTokenPrice(address PT, address token) external view returns (uint256);
|
|
26
|
-
|
|
27
|
-
function swapPtForExactToken(
|
|
28
|
-
address receiver,
|
|
29
|
-
address PT,
|
|
30
|
-
address token,
|
|
31
|
-
uint256 exactTokenOut,
|
|
32
|
-
bytes calldata data
|
|
33
|
-
) external payable returns (uint256 netPtIn);
|
|
34
|
-
|
|
35
|
-
function swapExactPtForToken(
|
|
36
|
-
address receiver,
|
|
37
|
-
address PT,
|
|
38
|
-
uint256 exactPtIn,
|
|
39
|
-
address token,
|
|
40
|
-
bytes calldata data
|
|
41
|
-
) external payable returns (uint256 netTokenOut);
|
|
42
|
-
|
|
43
|
-
// Admin functions
|
|
44
|
-
|
|
45
|
-
function setPriceOracle(address PT, address token, address priceOracle) external;
|
|
46
|
-
|
|
47
|
-
function addFund(address token, uint256 amount) external payable;
|
|
48
|
-
|
|
49
|
-
function removeFund(address token, uint256 amount) external;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface IPFixedPricePTAMMSwapCallback {
|
|
53
|
-
function swapCallback(uint256 exactTokenOut, uint256 netPtIn, bytes calldata data) external;
|
|
54
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.0;
|
|
3
|
-
|
|
4
|
-
interface IPPTOFTAdapterFactory {
|
|
5
|
-
event PtAdapterCreated(address indexed pt, address indexed adapter);
|
|
6
|
-
|
|
7
|
-
function initialize(address _owner) external;
|
|
8
|
-
|
|
9
|
-
function createPtAdapter(address pt) external returns (address);
|
|
10
|
-
|
|
11
|
-
function ptAdapter(address pt) external view returns (address);
|
|
12
|
-
}
|