From 67af60ef7168134761c9a099d0023be0bb68c902 Mon Sep 17 00:00:00 2001 From: Agustin Pane Date: Thu, 21 Jan 2021 15:26:25 -0300 Subject: [PATCH] Adds isEmptyAddress method --- src/logic/wallets/ethAddresses.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/logic/wallets/ethAddresses.ts b/src/logic/wallets/ethAddresses.ts index 834e6654..891da66a 100644 --- a/src/logic/wallets/ethAddresses.ts +++ b/src/logic/wallets/ethAddresses.ts @@ -1,12 +1,18 @@ import { List } from 'immutable' import { SafeRecord } from 'src/logic/safe/store/models/safe' import { sameString } from 'src/utils/strings' +import { EMPTY_DATA } from 'src/logic/wallets/ethTransactions' export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' export const sameAddress = (firstAddress: string | undefined, secondAddress: string | undefined): boolean => { return sameString(firstAddress, secondAddress) } +export const isEmptyAddress = (address: string | undefined): boolean => { + if (!address) return true + return sameAddress(address, EMPTY_DATA) || sameAddress(address, ZERO_ADDRESS) +} + export const shortVersionOf = (value: string, cut: number): string => { if (!value) { return 'Unknown'