File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ contract Swap is
32
32
error InvalidAddress ();
33
33
error Unauthorized ();
34
34
error ApprovalFailed ();
35
- error TransferFailed ();
35
+ error TransferFailed (string );
36
36
error InsufficientAmount (string );
37
37
38
38
event TokenSwap (
@@ -141,7 +141,9 @@ contract Swap is
141
141
amount
142
142
);
143
143
if (! success) {
144
- revert TransferFailed ();
144
+ revert TransferFailed (
145
+ "Failed to transfer ZRC-20 tokens from the sender to the contract "
146
+ );
145
147
}
146
148
147
149
(uint256 out , address gasZRC20 , uint256 gasFee ) = handleGasAndSwap (
@@ -188,7 +190,9 @@ contract Swap is
188
190
189
191
uint256 minInput = quoteMinInput (inputToken, targetToken);
190
192
if (amount < minInput) {
191
- revert InsufficientAmount ("not enough tokens " );
193
+ revert InsufficientAmount (
194
+ "The input amount is less than the min amount required to cover the withdraw gas fee "
195
+ );
192
196
}
193
197
194
198
if (gasZRC20 == inputToken) {
@@ -256,7 +260,9 @@ contract Swap is
256
260
out
257
261
);
258
262
if (! success) {
259
- revert TransferFailed ();
263
+ revert TransferFailed (
264
+ "Failed to transfer target tokens to the recipient on ZetaChain "
265
+ );
260
266
}
261
267
}
262
268
}
You can’t perform that action at this time.
0 commit comments