Etherscan shows an ERC-20 contract and this many tokens: 000000000000000000000000000000000000000000000000000000070c96a0ea


How do I convert that to a number I can understand? I can use easily C#, Python, Javascript or is there some type of web converter?

  • I just saw that Eitherscan can convert it under "Event Logs": etherscan.io/tx/… Sep 10 '17 at 20:53
  • But how many tokens is 30,275,969,258? Is that Gwei, so divide by 1,000,000,000? Sep 10 '17 at 20:58
  • Turns out I bought about approx 302, so why divided by 100,000?? Sep 10 '17 at 21:01

It's hexadecimal. In python, long(your_number, 16)

Note that because Soldity doesn't support decimals, it's common to multiply by a million or billion or so before storing them on the contract. (The same principle is used with ETH, which the system stores in units of a very small fraction of 1 ETH called Wei.) So you may also need to find out what the contract is multiplying by and divide by that.

  • Oh, so each contract basically chooses its own unit of measure then. And the ERC-20 standard does not enforce that? Sep 10 '17 at 22:27
  • The number of decimals is usually given in a function called decimals(), but IIUC this isn't strictly part of the standard. theethereum.wiki/w/index.php/ERC20_Token_Standard Sep 10 '17 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.