Replies: 2 comments
-
const tokenID = 96178001019380483532355422451609849948339356991030948866277126174730172245776; If the tokenID is passed in here, an error overflow will be reported. What should I do? |
Beta Was this translation helpful? Give feedback.
-
You must use either ES2020 BigInt or strings in JavaScript to represent numbers larger than 53 bits, otherwise rounding will occur and your token ID will be very wrong anyways. Please check out the notes on BigNumbers: https://docs.ethers.io/v5/api/utils/bignumber/#BigNumber--notes |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So @ricmoo what do you suggest should be done for this? In an ERC1155 contract that I'm testing right now, we've generated tokenIds that are similarly big and thus, I'm facing the same problem while trying to decode the TransferBatch event thrown by the _mintBatch function...
There must be a workaround...
Originally posted by @asmitadhungana in #1983 (reply in thread)
Beta Was this translation helpful? Give feedback.
All reactions