Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Missing consistency between fromBech32Address() and ZRC-6 addresses #434

Open
crimson-med opened this issue Jan 20, 2022 · 2 comments
Open

Comments

@crimson-med
Copy link

Describe the bug

Missing consistency between fromBech32Address() and ZRC-6 addresses.

To Reproduce

  1. Deploy the basic ZRC-6 contract template
  2. Mint an NFT to an address
  3. Call fromBech32Address("zil1nn480ye58tppav7mp79v3e65g5lykvp4aeuj53")
  4. This will result in the string: 0x9Cea7793343AC21EB3DB0f8Ac8e754453e4b3035
  5. The Get State of balances on the ZRC-6 contract will return: 0x9cea7793343ac21eb3db0f8ac8e754453e4b3035
  6. The contract one is essentially all lower case.

Expected behavior

fromBech32Address() should return all in lower case and should be global around all of the API

Screenshots

Screenshot 2022-01-20 at 2 04 45 PM

Desktop (please complete the following information):

Mac OS

  • Browser Firefox
  • Version [96.0.1 (64-bit)
@bb111189
Copy link
Contributor

The mixture of the upper and lower case are due to checksum and it will be better for the SDK to return a checksummed address for safety purposes.

@crimson-med
Copy link
Author

Should we then use toChecksumAddress instead to verify and compare addresses?

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