This is my complete contract code : https://gist.github.com/cmaliwal/31a80d36b8d873a3dca37b2b18188164

When I deployed my contract on ropsten test network using remix and metamask contract deployed successfully.


When I am trying to add token on metmask , I am getting 0 TKN instead of my token (DEV).

Add tokens on metmask

Token details

transaction address : Tx. on etherscan

contract address : contract on etherscan

  • 1
    Did you transfer some tokens from your contract to your personnal address ? – Greg Jeanmart May 1 '18 at 10:34
  • No ! I didn't transfer any tokens. As you can see on my code, DEV is mintable token (the total supply of the token starts with 0 and increases as people purchase the tokens in the crowdsale) Let's think I have 0 DEV token but it showing me 0 TKN. – Chirag Maliwal May 1 '18 at 11:01
  • 1
    So you need to call buyTokens(address) – Greg Jeanmart May 1 '18 at 11:11
  • 1
    @chiragmaliwal Your error is that you are registering the crowdsale contract in metamask and you have to register the token contract which is created in the constructor token = new DeveloperToken(). To obtain the token address you have to call crowdsale.token.call(). – Ismael May 1 '18 at 18:36
  • How can I show how much DEV token I have in my wallent and also my contract is related to ERC20 ? – Chirag Maliwal May 1 '18 at 18:40

Your constructor function in the crowdsale is misspelled

edit: Thanks Ismael for the solidity update syntax.

  • 1
    No, new version of solidity compiler the constructor function has new syntax constructor(params) { /* body */ } – Ismael May 1 '18 at 15:19
  • 1
    That is one of the issues. Please edit your answer to add that. – Ismael May 1 '18 at 15:24
  • 1
    Cheers, just edited it – Danny May 1 '18 at 15:25
  • It's just typo !! Thanks for the update , I updated the code . – Chirag Maliwal May 1 '18 at 17:26
  • this is not the reason of error. – Chirag Maliwal May 1 '18 at 17:43

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.