aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <flyswatter@users.noreply.github.com>2017-09-19 02:17:00 +0800
committerGitHub <noreply@github.com>2017-09-19 02:17:00 +0800
commit67accea693cb5f3167279ecdbe869cc464f7665a (patch)
tree42c69f96eaa7f9abadda977417c7b42d4eece114 /ui
parentef6967325e43de26edc0d99ac5853804648024ae (diff)
parent99856189ed463d5ff140b36399313993ffd5541c (diff)
downloadtangerine-wallet-browser-67accea693cb5f3167279ecdbe869cc464f7665a.tar
tangerine-wallet-browser-67accea693cb5f3167279ecdbe869cc464f7665a.tar.gz
tangerine-wallet-browser-67accea693cb5f3167279ecdbe869cc464f7665a.tar.bz2
tangerine-wallet-browser-67accea693cb5f3167279ecdbe869cc464f7665a.tar.lz
tangerine-wallet-browser-67accea693cb5f3167279ecdbe869cc464f7665a.tar.xz
tangerine-wallet-browser-67accea693cb5f3167279ecdbe869cc464f7665a.tar.zst
tangerine-wallet-browser-67accea693cb5f3167279ecdbe869cc464f7665a.zip
Merge branch 'master' into mixed-case
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/pending-tx.js65
-rw-r--r--ui/app/info.js2
2 files changed, 41 insertions, 26 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 3e53d47f9..c3350fcc1 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -52,7 +52,9 @@ PendingTx.prototype.render = function () {
const gas = txParams.gas
const gasBn = hexToBn(gas)
const gasLimit = new BN(parseInt(blockGasLimit))
- const safeGasLimit = this.bnMultiplyByFraction(gasLimit, 19, 20).toString(10)
+ const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20)
+ const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20)
+ const safeGasLimit = safeGasLimitBN.toString(10)
// Gas Price
const gasPrice = txParams.gasPrice || MIN_GAS_PRICE_BN.toString(16)
@@ -66,6 +68,8 @@ PendingTx.prototype.render = function () {
const balanceBn = hexToBn(balance)
const insufficientBalance = balanceBn.lt(maxCost)
+ const dangerousGasLimit = gasBn.gte(saferGasLimitBN)
+ const gasLimitSpecified = txMeta.gasLimitSpecified
const buyDisabled = insufficientBalance || !this.state.valid || !isValidAddress || this.state.submitting
const showRejectAll = props.unconfTxListLength > 1
@@ -263,33 +267,44 @@ PendingTx.prototype.render = function () {
text-transform: uppercase;
}
`),
+ h('.cell.row', {
+ style: {
+ textAlign: 'center',
+ },
+ }, [
+ txMeta.simulationFails ?
+ h('.error', {
+ style: {
+ fontSize: '0.9em',
+ },
+ }, 'Transaction Error. Exception thrown in contract code.')
+ : null,
- txMeta.simulationFails ?
- h('.error', {
- style: {
- marginLeft: 50,
- fontSize: '0.9em',
- },
- }, 'Transaction Error. Exception thrown in contract code.')
- : null,
+ !isValidAddress ?
+ h('.error', {
+ style: {
+ fontSize: '0.9em',
+ },
+ }, 'Recipient address is invalid. Sending this transaction will result in a loss of ETH.')
+ : null,
- !isValidAddress ?
- h('.error', {
- style: {
- marginLeft: 50,
- fontSize: '0.9em',
- },
- }, 'Recipient address is invalid. Sending this transaction will result in a loss of ETH.')
- : null,
+ insufficientBalance ?
+ h('span.error', {
+ style: {
+ fontSize: '0.9em',
+ },
+ }, 'Insufficient balance for transaction')
+ : null,
+
+ (dangerousGasLimit && !gasLimitSpecified) ?
+ h('span.error', {
+ style: {
+ fontSize: '0.9em',
+ },
+ }, 'Gas limit set dangerously high. Approving this transaction is likely to fail.')
+ : null,
+ ]),
- insufficientBalance ?
- h('span.error', {
- style: {
- marginLeft: 50,
- fontSize: '0.9em',
- },
- }, 'Insufficient balance for transaction')
- : null,
// send + cancel
h('.flex-row.flex-space-around.conf-buttons', {
diff --git a/ui/app/info.js b/ui/app/info.js
index c69d83715..4c7d4cb4c 100644
--- a/ui/app/info.js
+++ b/ui/app/info.js
@@ -103,7 +103,7 @@ InfoScreen.prototype.render = function () {
[
h('div.fa.fa-support', [
h('a.info', {
- href: 'https://support.metamask.com',
+ href: 'https://support.metamask.io',
target: '_blank',
}, 'Visit our Support Center'),
]),