zilliqa-js
zilliqa-js copied to clipboard
Missing consistency between `fromBech32Address()` and ZRC-6 addresses
Describe the bug
Missing consistency between fromBech32Address()
and ZRC-6 addresses.
To Reproduce
- Deploy the basic ZRC-6 contract template
- Mint an NFT to an address
- Call
fromBech32Address("zil1nn480ye58tppav7mp79v3e65g5lykvp4aeuj53")
- This will result in the string:
0x9Cea7793343AC21EB3DB0f8Ac8e754453e4b3035
- The Get State of balances on the ZRC-6 contract will return:
0x9cea7793343ac21eb3db0f8ac8e754453e4b3035
- 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
Desktop (please complete the following information):
Mac OS
- Browser Firefox
- Version [96.0.1 (64-bit)
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.
Should we then use toChecksumAddress
instead to verify and compare addresses?