From 7a0eb3c069c3283c908f9eba86aa4df6d0530061 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 11 May 2022 12:08:49 +0100 Subject: [PATCH] Show ETH addresses with injected checksum (#176) --- src/components/ui/Address.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ui/Address.tsx b/src/components/ui/Address.tsx index 84b1697..5e42d47 100644 --- a/src/components/ui/Address.tsx +++ b/src/components/ui/Address.tsx @@ -1,6 +1,7 @@ import React, { CSSProperties } from "react"; import { Box, Text } from "grommet"; import { Link, useHistory } from "react-router-dom"; +import {toChecksumAddress} from 'web3-utils'; import { useERC20Pool } from "src/hooks/ERC20_Pool"; import { getAddress } from "src/utils"; import { useCurrency } from "src/hooks/ONE-ETH-SwitcherHook"; @@ -82,7 +83,7 @@ export const Address = (props: IAddress) => { let outPutAddress = address; try { - outPutAddress = currency === "ONE" ? getAddress(address).bech32 : address; + outPutAddress = currency === "ONE" ? getAddress(address).bech32 : toChecksumAddress(address); } catch { outPutAddress = address; }