Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Utils and BigNumberFormatter to handle hex edge cases #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EGreg
Copy link

@EGreg EGreg commented Nov 29, 2022

The current web3.php was mysteriously returning numbers like this: 70706864786e6862 instead of the full hex from numbers like 70706864786e6862000000000000000000000000000000000000000000000026. It happens only in the edge case where the hex has a single 'e' in it. These changes fix that scenario.

If you're wondering how we found this out, we ran into an edge case with tokenIds in our NFT Smart Contract when we started generating token IDs of the form seriesId + autoIndex. It just so happened that our seriesId had a single e in it. And PHP's is_numeric interprets numbers of the form '123e456' to be decimal representations of large numbers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant