Skip to content
Discussion options

You must be logged in to vote

The utils.hexValue(hexString) method will serialize as a QUANTITY, which has. I leading 0’s except that 0 is 0x0. This should be what you want.

The safest way to handle this is hexValue(BigNumber.from(v).toHexString()). This will handle all sorts of edge cases for you. :)

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ricmoo
Comment options

Comment options

You must be logged in to vote
1 reply
@ricmoo
Comment options

Answer selected by ricmoo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
investigate Under investigation and may be a bug.
3 participants
Converted from issue

This discussion was converted from issue #1702 on June 24, 2021 00:55.