@pendle/core-v2 6.3.2-swaphubtest → 6.3.2-swaphubtest2
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/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.json +438 -220
- package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.json +436 -218
- package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.json +389 -171
- package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +116 -72
- package/contracts/cross-chain/swap-hub/SwapHubBase.sol +54 -84
- package/contracts/interfaces/IPCrossChainSwapHub.sol +49 -44
- package/package.json +1 -1
- package/typechain-types/IPCrossChainSwapHub.ts +323 -282
- package/typechain-types/PendleCrossChainSwapHub.ts +323 -282
- package/typechain-types/SwapHubBase.ts +323 -282
- package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +388 -172
- package/typechain-types/factories/PendleCrossChainSwapHub__factory.ts +444 -228
- package/typechain-types/factories/SwapHubBase__factory.ts +443 -227
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
4
|
interface IPCrossChainSwapHub {
|
|
5
|
-
error
|
|
5
|
+
error ActionExecuted();
|
|
6
6
|
error InsufficientTokenReceived();
|
|
7
|
-
error InvalidAmountIn();
|
|
8
7
|
error InvalidNonce();
|
|
9
8
|
error InvalidSignature();
|
|
10
|
-
error InvalidValidator();
|
|
11
|
-
error IntentExecuted();
|
|
12
|
-
error IntentHashMismatch();
|
|
13
9
|
error MessageExpired();
|
|
14
10
|
|
|
11
|
+
enum ActionStatus {
|
|
12
|
+
NOT_EXECUTED,
|
|
13
|
+
SUCCEEDED,
|
|
14
|
+
FAILED
|
|
15
|
+
}
|
|
16
|
+
|
|
15
17
|
struct WithdrawTokenMessage {
|
|
16
18
|
address owner;
|
|
17
19
|
uint32 boxId;
|
|
@@ -20,8 +22,8 @@ interface IPCrossChainSwapHub {
|
|
|
20
22
|
//
|
|
21
23
|
address receiver;
|
|
22
24
|
address token;
|
|
23
|
-
uint256
|
|
24
|
-
uint256
|
|
25
|
+
uint256 amountWithdraw;
|
|
26
|
+
uint256 amountFee;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
struct BridgeTokenMessage {
|
|
@@ -31,8 +33,8 @@ interface IPCrossChainSwapHub {
|
|
|
31
33
|
uint256 nonce;
|
|
32
34
|
//
|
|
33
35
|
address token;
|
|
34
|
-
uint256
|
|
35
|
-
uint256
|
|
36
|
+
uint256 amountBridge;
|
|
37
|
+
uint256 amountFee;
|
|
36
38
|
//
|
|
37
39
|
address bridgeExtRouter;
|
|
38
40
|
bytes bridgeCalldata;
|
|
@@ -46,59 +48,62 @@ interface IPCrossChainSwapHub {
|
|
|
46
48
|
//
|
|
47
49
|
address tokenSpent;
|
|
48
50
|
uint256 amountSpent;
|
|
51
|
+
uint256 amountFee;
|
|
49
52
|
address tokenReceived;
|
|
50
53
|
uint256 minReceived;
|
|
51
|
-
|
|
54
|
+
address receiver;
|
|
52
55
|
//
|
|
53
56
|
address swapExecutor;
|
|
54
57
|
address swapExtRouter;
|
|
55
58
|
bytes swapCalldata;
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
struct
|
|
61
|
+
struct BuyCrossChainPtMessage {
|
|
59
62
|
address owner;
|
|
60
63
|
uint32 boxId;
|
|
61
|
-
uint256 salt;
|
|
62
64
|
uint256 expiry;
|
|
65
|
+
uint256 nonce;
|
|
63
66
|
//
|
|
64
67
|
address tokenSpent;
|
|
65
|
-
uint256
|
|
66
|
-
|
|
68
|
+
uint256 amountSpent;
|
|
69
|
+
uint256 amountFee;
|
|
67
70
|
address ptAdapter;
|
|
68
71
|
uint256 minPtReceived;
|
|
69
|
-
uint32
|
|
72
|
+
uint32 dstEid;
|
|
70
73
|
bytes32 receiver;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
struct ExecuteBuyCrossChainPtMessage {
|
|
74
|
-
address validator;
|
|
75
|
-
bytes32 intentHash;
|
|
76
|
-
uint256 amountSpent;
|
|
77
|
-
uint256 feeAmount;
|
|
74
|
+
//
|
|
78
75
|
address swapExecutor;
|
|
79
76
|
address swapExtRouter;
|
|
80
77
|
bytes swapCalldata;
|
|
81
|
-
uint256 expiry;
|
|
82
78
|
}
|
|
83
79
|
|
|
84
80
|
event WithdrawToken(
|
|
85
|
-
address indexed owner,
|
|
81
|
+
address indexed owner,
|
|
82
|
+
uint32 boxId,
|
|
83
|
+
bytes32 actionHash,
|
|
84
|
+
address receiver,
|
|
85
|
+
address token,
|
|
86
|
+
uint256 amountWithdraw,
|
|
87
|
+
uint256 amountFee
|
|
86
88
|
);
|
|
87
89
|
|
|
88
90
|
event BridgeToken(
|
|
89
91
|
address indexed owner,
|
|
90
92
|
uint32 boxId,
|
|
93
|
+
bytes32 actionHash,
|
|
91
94
|
address bridgeExtRouter,
|
|
92
95
|
address token,
|
|
93
|
-
uint256
|
|
94
|
-
uint256
|
|
96
|
+
uint256 amountBridge,
|
|
97
|
+
uint256 amountFee
|
|
95
98
|
);
|
|
96
99
|
|
|
97
100
|
event SwapToken(
|
|
98
101
|
address indexed owner,
|
|
99
102
|
uint32 boxId,
|
|
103
|
+
bytes32 actionHash,
|
|
100
104
|
address tokenSpent,
|
|
101
105
|
uint256 amountSpent,
|
|
106
|
+
uint256 amountFee,
|
|
102
107
|
address tokenReceived,
|
|
103
108
|
uint256 netTokenReceived
|
|
104
109
|
);
|
|
@@ -106,17 +111,20 @@ interface IPCrossChainSwapHub {
|
|
|
106
111
|
event BuyCrossChainPt(
|
|
107
112
|
address indexed owner,
|
|
108
113
|
uint32 boxId,
|
|
109
|
-
bytes32
|
|
114
|
+
bytes32 actionHash,
|
|
110
115
|
address tokenSpent,
|
|
111
116
|
uint256 amountSpent,
|
|
112
|
-
|
|
117
|
+
uint256 amountFee,
|
|
113
118
|
address ptAdapter,
|
|
119
|
+
address pt,
|
|
114
120
|
uint256 netPtReceived
|
|
115
121
|
);
|
|
116
122
|
|
|
117
|
-
event
|
|
123
|
+
event ClaimFeeForFailedAction(
|
|
124
|
+
address indexed owner, uint32 boxId, bytes32 actionHash, address token, uint256 amount
|
|
125
|
+
);
|
|
118
126
|
|
|
119
|
-
event
|
|
127
|
+
event SetExecutor(address indexed executor, bool isExecutor);
|
|
120
128
|
|
|
121
129
|
function BEACON_PROXY_CODE_CONTRACT() external view returns (address);
|
|
122
130
|
|
|
@@ -126,12 +134,10 @@ interface IPCrossChainSwapHub {
|
|
|
126
134
|
|
|
127
135
|
function ownerNonce(address owner) external view returns (uint256);
|
|
128
136
|
|
|
129
|
-
function
|
|
137
|
+
function actionStatus(bytes32 actionHash) external view returns (ActionStatus);
|
|
130
138
|
|
|
131
139
|
function isExecutor(address executor) external view returns (bool);
|
|
132
140
|
|
|
133
|
-
function isValidator(address validator) external view returns (bool);
|
|
134
|
-
|
|
135
141
|
function computeDepositBox(address owner, uint32 boxId) external view returns (address box, bytes32 salt);
|
|
136
142
|
|
|
137
143
|
function hashTypedData(WithdrawTokenMessage memory message) external view returns (bytes32);
|
|
@@ -140,9 +146,7 @@ interface IPCrossChainSwapHub {
|
|
|
140
146
|
|
|
141
147
|
function hashTypedData(SwapTokenMessage memory message) external view returns (bytes32);
|
|
142
148
|
|
|
143
|
-
function hashTypedData(
|
|
144
|
-
|
|
145
|
-
function hashTypedData(ExecuteBuyCrossChainPtMessage memory message) external view returns (bytes32);
|
|
149
|
+
function hashTypedData(BuyCrossChainPtMessage memory message) external view returns (bytes32);
|
|
146
150
|
|
|
147
151
|
function withdrawToken(WithdrawTokenMessage memory message, bytes memory signature) external;
|
|
148
152
|
|
|
@@ -150,14 +154,15 @@ interface IPCrossChainSwapHub {
|
|
|
150
154
|
|
|
151
155
|
function swapToken(SwapTokenMessage memory message, bytes memory signature) external;
|
|
152
156
|
|
|
153
|
-
function buyCrossChainPt(
|
|
154
|
-
BuyCrossChainPtIntent memory intent,
|
|
155
|
-
bytes memory intentSig,
|
|
156
|
-
ExecuteBuyCrossChainPtMessage memory execMsg,
|
|
157
|
-
bytes memory execSig
|
|
158
|
-
) external payable;
|
|
157
|
+
function buyCrossChainPt(BuyCrossChainPtMessage memory message, bytes memory signature) external payable;
|
|
159
158
|
|
|
160
|
-
function
|
|
159
|
+
function claimFee(WithdrawTokenMessage memory message, bytes memory signature) external;
|
|
160
|
+
|
|
161
|
+
function claimFee(BridgeTokenMessage memory message, bytes memory signature) external;
|
|
161
162
|
|
|
162
|
-
function
|
|
163
|
+
function claimFee(SwapTokenMessage memory message, bytes memory signature) external;
|
|
164
|
+
|
|
165
|
+
function claimFee(BuyCrossChainPtMessage memory message, bytes memory signature) external;
|
|
166
|
+
|
|
167
|
+
function setExecutor(address executor, bool isExecutor) external;
|
|
163
168
|
}
|
package/package.json
CHANGED