Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hard coded upper limit to gas limit #2884

Merged
merged 1 commit into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/components/UI/CustomGas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ class CustomGas extends PureComponent {
let warningGasLimit;
if (!value || value === '' || !isDecimal(value)) warningGasLimit = strings('transaction.invalid_gas');
else if (bnValue && !isBN(bnValue)) warningGasLimit = strings('transaction.invalid_gas');
else if (bnValue.lt(new BN(21000)) || bnValue.gt(new BN(7920028)))
warningGasLimit = strings('custom_gas.warning_gas_limit');
else if (bnValue.lt(new BN(21000))) warningGasLimit = strings('custom_gas.warning_gas_limit');
else if (this.props.minimumGasLimit && bnValue.lt(new BN(this.props.minimumGasLimit)))
warningGasLimit = strings('custom_gas.warning_gas_limit_estimated', {
gas: this.props.minimumGasLimit.toString(10)
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/TransactionEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ class TransactionEditor extends PureComponent {
if (gas && !isBN(gas)) return strings('transaction.invalid_gas');
if (!gasPrice) return strings('transaction.invalid_gas_price');
if (gasPrice && !isBN(gasPrice)) return strings('transaction.invalid_gas_price');
if (gas.lt(new BN(21000)) || gas.gt(new BN(7920028))) return strings('custom_gas.warning_gas_limit');
if (gas.lt(new BN(21000))) return strings('custom_gas.warning_gas_limit');

const checksummedFrom = safeToChecksumAddress(from) || '';
const fromAccount = this.props.accounts[checksummedFrom];
Expand Down
2 changes: 1 addition & 1 deletion locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@
"gas_limit": "Gas Limit:",
"gas_price": "Gas Price: (GWEI)",
"save": "Save",
"warning_gas_limit": "Gas limit must be greater than 20999 and less than 7920027",
"warning_gas_limit": "Gas limit must be greater than 20999",
"warning_gas_limit_estimated": "Estimated gas limit is {{gas}}, use it as minimum value",
"cost_explanation": "The gas fee covers the cost of processing your transaction on the Ethereum network. MetaMask does not profit from this fee. The higher the fee the better chances of your transaction getting processed."
},
Expand Down