diff options
Diffstat (limited to 'ui/app/util.js')
-rw-r--r-- | ui/app/util.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js index 8c85c5926..8b194e0c7 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -59,6 +59,7 @@ module.exports = { allNull, getTokenAddressFromTokenObject, checksumAddress, + addressSlicer, } function valuesFor (obj) { @@ -303,3 +304,11 @@ function getTokenAddressFromTokenObject (token) { function checksumAddress (address) { return address ? ethUtil.toChecksumAddress(address) : '' } + +function addressSlicer (address = '') { + if (address.length < 11) { + return address + } + + return `${address.slice(0, 6)}...${address.slice(-4)}` +} |