@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.
@@ -2,16 +2,18 @@
2
2
  pragma solidity ^0.8.0;
3
3
 
4
4
  interface IPCrossChainSwapHub {
5
- error ExcessiveNativeFee();
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 withdrawAmount;
24
- uint256 feeAmount;
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 bridgeAmount;
35
- uint256 feeAmount;
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
- uint256 feeAmount;
54
+ address receiver;
52
55
  //
53
56
  address swapExecutor;
54
57
  address swapExtRouter;
55
58
  bytes swapCalldata;
56
59
  }
57
60
 
58
- struct BuyCrossChainPtIntent {
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 maxAmountSpent;
66
- address pt;
68
+ uint256 amountSpent;
69
+ uint256 amountFee;
67
70
  address ptAdapter;
68
71
  uint256 minPtReceived;
69
- uint32 dstLzEid;
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, uint32 boxId, address receiver, address token, uint256 withdrawAmount, uint256 feeAmount
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 bridgeAmount,
94
- uint256 feeAmount
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 intentHash,
114
+ bytes32 actionHash,
110
115
  address tokenSpent,
111
116
  uint256 amountSpent,
112
- address pt,
117
+ uint256 amountFee,
113
118
  address ptAdapter,
119
+ address pt,
114
120
  uint256 netPtReceived
115
121
  );
116
122
 
117
- event SetExecutor(address indexed executor, bool isExecutor);
123
+ event ClaimFeeForFailedAction(
124
+ address indexed owner, uint32 boxId, bytes32 actionHash, address token, uint256 amount
125
+ );
118
126
 
119
- event SetValidator(address indexed validator, bool isValidator);
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 isIntentExecuted(bytes32 intentHash) external view returns (bool);
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(BuyCrossChainPtIntent memory intent) external view returns (bytes32);
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 setExecutor(address executor, bool isExecutor) external;
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 setValidator(address validator, bool isValidator) external;
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
@@ -2,7 +2,7 @@
2
2
  "name": "@pendle/core-v2",
3
3
  "description": "Core smart contracts of Pendle Protocol.",
4
4
  "license": "BUSL-1.1",
5
- "version": "6.3.2-swaphubtest",
5
+ "version": "6.3.2-swaphubtest2",
6
6
  "homepage": "https://pendle.finance",
7
7
  "keywords": [
8
8
  "pendle",