Skip to content

[utils] isHexChecksumAddress is poorly named and documented #10207

Description

@davidmurdoch

https://github.com/MetaMask/utils/blob/1bea7f378c37117260912af1921556bc57110d20/src/hex.ts#L63-L71

This function does NOT return if the given string is a "valid hex checksum address" (or a "Hex Checksum Address"). It returns true if the characters used in the given string are all allowed in an checksummed address.

The function (and likely some other similarly confusing functions/docs in this same file) should be updated to reflect their purpose.

Activity

  1. mcmire commented on Jul 9, 2025

    @mcmire
    Collaborator

    @davidmurdoch I agree, this is a confusing function. Not only does it not tell you whether you have a truly valid checksum address, we're running a string against a pattern ostensibly so we can reliably convert it into a more useful type — except all we can tell TypeScript is that it's a string that starts with 0x, which is better than nothing, but still not that useful. We should investigate how we are using this function in practice and figure out whether this is the right thing to use.

  2. changed the title [-]`isHexChecksumAddress` is poorly named and documented[/-] [+][utils] `isHexChecksumAddress` is poorly named and documented[/+] on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions