0

If let say we launch a ICO using Ethereum blockchain, how can I check for total token left in the market?

The typical workflow will be like:

  1. Investor send n ETH to my wallet
  2. System will verify the amount of ETH sent by investor
  3. System send custom token (XXX) to investor
  4. System display total token left on the website

Any API that can get the XXX token left?

0

1 Answer 1

0

you can use this api for simple ERC-TOKEN

https://api.etherscan.io/api?module=stats&action=tokensupply&contractaddress=0x57d90b64a1a57749b0f932f1a3395792e12e7055

Change contract address on link to your contract address

left tokens in market is (Total token for sale as crowedsale)-(value of array result)/(10^(Token Decimals of your token))

I hope this helpful

3
  • I tried with 0x4355fC160f74328f9b383dF2EC589bB3dFd82Ba0 this address (Opus foundation), but the total supply is different from what they claimed (1600 mil)
    – Js Lim
    Jul 31, 2017 at 2:31
  • Token Decimals: 18
    – TahaBA
    Jul 31, 2017 at 11:37
  • 1
    Opus foundation : Contract address:0x4355fC160f74328f9b383dF2EC589bB3dFd82Ba0 Token Decimals: 18 total supply 1600mil for sale 900mil in this case we need number token for sale 900mil-((724031315437989207411571392)/(10^18)= 900000000-724031315=175968685 number token left =175968685
    – TahaBA
    Jul 31, 2017 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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