Skip to content

Commit 3c66fa8

Browse files
authored
Fix typo (#435)
* Fix typo * Update
1 parent 86f875f commit 3c66fa8

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

src/localConstants/gas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const GUARDED_TX_EXTRA_GAS_LIMIT = 50_000;

src/pages/Dashboard/widgets/BatchTransactions/helpers/getBatchTransactions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
TransactionsFactoryConfig,
66
TransferTransactionsFactory
77
} from 'lib';
8+
import { GUARDED_TX_EXTRA_GAS_LIMIT } from 'localConstants/gas';
89
import { TransactionProps } from 'types';
910

1011
const NUMBER_OF_TRANSACTIONS = 5;
@@ -37,7 +38,8 @@ export const getBatchTransactions = async ({
3738
);
3839

3940
if (isGuarded) {
40-
tokenTransfer.gasLimit = tokenTransfer.gasLimit + BigInt(50_000);
41+
tokenTransfer.gasLimit =
42+
tokenTransfer.gasLimit + BigInt(GUARDED_TX_EXTRA_GAS_LIMIT);
4143
}
4244

4345
return tokenTransfer;

src/pages/Dashboard/widgets/BatchTransactions/helpers/getSwapAndLockTransactions.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BATCH_TRANSACTIONS_SC } from 'config';
22
import { Address, GAS_PRICE, Transaction, VERSION } from 'lib';
3+
import { GUARDED_TX_EXTRA_GAS_LIMIT } from 'localConstants/gas';
34
import { TransactionProps } from 'types';
45

56
export const getSwapAndLockTransactions = ({
@@ -8,7 +9,7 @@ export const getSwapAndLockTransactions = ({
89
chainID,
910
nonce
1011
}: TransactionProps): Transaction[] => {
11-
const transcations = [
12+
const transactions = [
1213
new Transaction({
1314
chainID,
1415
gasLimit: BigInt(4200000),
@@ -60,10 +61,10 @@ export const getSwapAndLockTransactions = ({
6061
];
6162

6263
if (isGuarded) {
63-
transcations.forEach((tx) => {
64-
tx.gasLimit = tx.gasLimit + BigInt(50_000);
64+
transactions.forEach((tx) => {
65+
tx.gasLimit = tx.gasLimit + BigInt(GUARDED_TX_EXTRA_GAS_LIMIT);
6566
});
6667
}
6768

68-
return transcations;
69+
return transactions;
6970
};

src/pages/Dashboard/widgets/BatchTransactions/helpers/getWrapAndMultiTransferTransactions.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { BATCH_TRANSACTIONS_SC } from 'config';
1111
import { contractAddress } from 'config';
1212
import { Address } from 'lib';
13+
import { GUARDED_TX_EXTRA_GAS_LIMIT } from 'localConstants/gas';
1314
import { TransactionProps } from 'types';
1415

1516
export const getWrapAndMultiTransferTransactions = async ({
@@ -70,11 +71,11 @@ export const getWrapAndMultiTransferTransactions = async ({
7071
});
7172

7273
if (isGuarded) {
73-
wrapOneEgld.gasLimit = wrapOneEgld.gasLimit + BigInt(50_000);
74-
swapHalfWEgldToUsdc.gasLimit =
75-
swapHalfWEgldToUsdc.gasLimit + BigInt(50_000);
76-
multiTransferOneUsdcHalfWEgld.gasLimit =
77-
multiTransferOneUsdcHalfWEgld.gasLimit + BigInt(50_000);
74+
[wrapOneEgld, swapHalfWEgldToUsdc, multiTransferOneUsdcHalfWEgld].forEach(
75+
(tx) => {
76+
tx.gasLimit += BigInt(GUARDED_TX_EXTRA_GAS_LIMIT);
77+
}
78+
);
7879
}
7980

8081
return { wrapOneEgld, swapHalfWEgldToUsdc, multiTransferOneUsdcHalfWEgld };

0 commit comments

Comments
 (0)