0

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.

DEPLOY CONTRACT ON ROPSTEN

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

6
  • 1
    Did you transfer some tokens from your contract to your personnal address ? Commented May 1, 2018 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. Commented May 1, 2018 at 11:01
  • 1
    So you need to call buyTokens(address) Commented May 1, 2018 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
    Commented May 1, 2018 at 18:36
  • How can I show how much DEV token I have in my wallent and also my contract is related to ERC20 ? Commented May 1, 2018 at 18:40

1 Answer 1

2

Your constructor function in the crowdsale is misspelled

edit: Thanks Ismael for the solidity update syntax.

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

Your Answer

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

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