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

Mixcase checksum assertion #173

Merged
merged 2 commits into from
Jun 7, 2024
Merged

Conversation

rileystephens28
Copy link
Member

Expose new validateAddress method and force users to input already valid mixed case checksummed addresses

Copy link
Contributor

@alejoacosta74 alejoacosta74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments. Looks good to me.

A quick test shows the expected error when passing an address with the wrong checksum:

❯ npx hardhat run scripts/test-mixcase.js  --network cyprus1                                                            10:11:31
from: 0x00539bc2ce3ed0fd039c582cb700ef5398bb0491
to: 0x00539bc2ce3ed0fd039c582cb700ef5398bb0491
TypeError: invalid address checksum (argument="address", value="0x00539bc2ce3ed0fd039c582cb700ef5398bb0491", code=INVALID_ARGUMENT, version=0.0.1)
 {
  code: 'INVALID_ARGUMENT',
  argument: 'address',
  value: '0x00539bc2ce3ed0fd039c582cb700ef5398bb0491',
  shortMessage: 'invalid address checksum'
}

@rileystephens28 rileystephens28 force-pushed the mixcase-checksum-assertion branch from c696899 to 9a6edc5 Compare June 7, 2024 15:33
@rileystephens28 rileystephens28 merged commit 9632a40 into master Jun 7, 2024
@rileystephens28 rileystephens28 deleted the mixcase-checksum-assertion branch June 7, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants