From 2262b5ed4b726baa3fc2e9872652879f117a28a0 Mon Sep 17 00:00:00 2001 From: ivpavici Date: Fri, 22 Mar 2024 13:14:58 +0100 Subject: [PATCH] docs: validateChecksumAddress --- src/utils/address.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/address.ts b/src/utils/address.ts index e0647df86..8183f3eff 100644 --- a/src/utils/address.ts +++ b/src/utils/address.ts @@ -41,6 +41,14 @@ export function getChecksumAddress(address: BigNumberish): string { return addHexPrefix(chars.join('')); } +/** + * If the casing of an address is mixed, it is a Checksum Address, which uses a specific pattern of uppercase and lowercase letters within + * a given address to reduce the risk of errors introduced from typing an address or cut and paste issues. + * + * @param address string + * + * @returns true if the ChecksumAddress is valid + */ export function validateChecksumAddress(address: string): boolean { return getChecksumAddress(address) === address; }