toTwos error report boundary #3873
-
Ethers Version6.1.0 Search TermsNo response Describe the Problem76132430147301787307387321647360254710447941205250659333197368533072997592449n is smaller than 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn, but toTwos(76132430147301787307387321647360254710447941205250659333197368533072997592449n, 256) report a rangeError: Code SnippettoTwos(76132430147301787307387321647360254710447941205250659333197368533072997592449n, 256) Contract ABINo response ErrorsRangeError: too high (operation="toTwos", fault="overflow", value=76132430147301787307387321647360254710447941205250659333197368533072997592449, code=NUMERIC_FAULT, version=6.1.0) Environmentnode.js (v12 or newer) Environment (Other)No response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
The maximum two-compliment number is 0x7fff…ff. It needs a bit at the top to accommodate the compliment bit. So, you get the range -0x8000…00 through 0x7fff…ff, inclusive. |
Beta Was this translation helpful? Give feedback.
-
Sorry. Looking into this now. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay. Fixed in v6.3.0. Thanks! |
Beta Was this translation helpful? Give feedback.
Sorry for the delay. Fixed in v6.3.0.
Thanks!