aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/helpers
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-10-30 09:47:07 +0800
committerGitHub <noreply@github.com>2018-10-30 09:47:07 +0800
commit310229d22e5e916e8d6e3b1a469b9b196e0f70c2 (patch)
tree518bd3f5fb01c792fe2e44db3aace1c20f22c7e1 /ui/app/helpers
parent1bb4a8428c73c1f1137793b25900db159eec3fa8 (diff)
parent9b42416fc0d92662d1a21759db357e7f439d7a7b (diff)
downloadtangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.tar.gz
tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.tar.zst
tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.zip
Merge pull request #5567 from MetaMask/HowardBraham-develop
Feature: Warn when attempting to send tx with data to non-contract
Diffstat (limited to 'ui/app/helpers')
-rw-r--r--ui/app/helpers/transactions.util.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/app/helpers/transactions.util.js b/ui/app/helpers/transactions.util.js
index 64ec82225..2f4b1d095 100644
--- a/ui/app/helpers/transactions.util.js
+++ b/ui/app/helpers/transactions.util.js
@@ -125,7 +125,9 @@ export function getLatestSubmittedTxWithNonce (transactions = [], nonce = '0x0')
export async function isSmartContractAddress (address) {
const code = await global.eth.getCode(address)
- return code && code !== '0x'
+ // Geth will return '0x', and ganache-core v2.2.1 will return '0x0'
+ const codeIsEmpty = !code || code === '0x' || code === '0x0'
+ return !codeIsEmpty
}
export function sumHexes (...args) {