Tokens: be able to represent as numbers
See original GitHub issueWe are able to represent tokens as strings (token.toString()
) and as string arrays (token.toList()
), but in certain cases, there’s a need to represent them as numbers. Introduce token.toNumber()
.
We need to somehow encode the fact that this is a token into a number. It’s not going to be elegant (e.g. -66737346654.<random>
can be the key to the token map).
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
22.1.2. Parsing of Numbers and Symbols
A token is a potential number if it satisfies the following requirements: It consists entirely of digits, signs (+ or -), ratio markers...
Read more >Numbers on role tokens? - BoardGameGeek
As the Announcer, place any tokens with numbers on them near you, and open your eyes in between roles if you need to...
Read more >Tokens - IBM
Also, be aware that in Assembler language, hexadecimal numbers are represented with the X in front of the number. REXX only accepts hexadecimal...
Read more >Tokens: their Significance for the Origin of Counting and Writing
The plain tokens stood for farm products: small and large cones, spheres and flat disks stood for different measures of barley; ovoids for...
Read more >Understanding ERC-20 token contracts | by Jim McDonald
An ERC-20 token contract is defined by the contract's address and the total supply of tokens available to it, but has a number...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This does bring up a more general concern around input validation which exists not only for numbers and I suspect we are violating already in a few places.
By the way, I just realized something. We should make the number VERY LARGE as opposed to VERY SMALL, so that if users manipulate it by accident it’ll reduce the opportunity for it to break the token: