From 865a0d8173e27c073f00d0d156b95e8d92208a94 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Fri, 17 Aug 2018 14:34:14 -0700 Subject: Use eth_getCode to sort transaction action type --- ui/app/helpers/confirm-transaction/util.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/app/helpers') diff --git a/ui/app/helpers/confirm-transaction/util.js b/ui/app/helpers/confirm-transaction/util.js index 76e80a8ac..3d0cb57e7 100644 --- a/ui/app/helpers/confirm-transaction/util.js +++ b/ui/app/helpers/confirm-transaction/util.js @@ -146,3 +146,8 @@ export function roundExponential (value) { // In JS, numbers with exponentials greater than 20 get displayed as an exponential. return bigNumberValue.e > 20 ? Number(bigNumberValue.toPrecision(PRECISION)) : value } + +export async function isSmartContractAddress (address) { + const code = await global.eth.getCode(address) + return code && code !== '0x' +} -- cgit v1.2.3