Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isAddress() does not check checksum if passed-in address is lower-case #3403

Closed
1 task done
kunstmusik opened this issue Mar 3, 2025 · 3 comments
Closed
1 task done

Comments

@kunstmusik
Copy link

Check existing issues

Viem Version

2.21.7

Current Behavior

If an address is all lower-case, it will not have it's checksum checked. The problematic code is here:

if (address.toLowerCase() === address) return true

Expected Behavior

Passing in any address will have checksum checked when strict is true.

Steps To Reproduce

  1. Pass in eth address with .toLowerCase() called upon it.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/viem-getting-started-x9vfv5fu?file=index.ts,package.json

Anything else?

No response

@jxom
Copy link
Member

jxom commented Mar 4, 2025

This is correct behavior.

@jxom jxom closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2025
@kunstmusik
Copy link
Author

How is this the correct behavior? Docs for the function say "Enables strict mode. Whether or not to compare the address against its checksum." and here it is bypassing that with strict = true. If the behavior is correct, it would be worth fixing the documentation to explain this case.

Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants