Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metamask showing 0 balance for ERC20 tokens (openzeppelin) #3908

Closed
rawadrifai opened this issue Apr 6, 2018 · 8 comments
Closed

Metamask showing 0 balance for ERC20 tokens (openzeppelin) #3908

rawadrifai opened this issue Apr 6, 2018 · 8 comments

Comments

@rawadrifai
Copy link

Hi,
If I use open zeppelin's solidity code (npm install zeppelin-solidity), metamask is not showing the right token balance. I create a token from an account and all total supply goes to that account. Then I add the token in metamask and it shows 0. I can almost guarantee I'm not doing any stupid mistakes, I tried it many times, yet it works for a different token where all the code is one file (suspecting that could be it?).

Here's the code: https://github.com/CrypTaurus/Token. The token to deploy is Taur.sol.

  • git clone [email protected]:CrypTaurus/Token.git
  • npm install
  • truffle migrate --reset --compile-all --network [ganache | development] (or whatever network you choose in truffle.js)
@rawadrifai
Copy link
Author

rawadrifai commented Apr 6, 2018 via email

@rawadrifai
Copy link
Author

This is the legacy code the works with metamask.. https://github.com/CrypTaurus/Token/tree/master/contracts/legacy You want to look at Token.sol. There's really almost no difference besides the fact that the code is collapsed into less files. We decided to follow open zeppelin's already audited contracts and that broke metamask.

We're looking forward for a core dev to help out.

@saltwerks
Copy link

Having the same issue with a development token on a local ganache instance.

@bdresser
Copy link
Contributor

@rawadrifai are you still seeing this issue?

@horca17
Copy link

horca17 commented Jul 18, 2018

I have the same problem!

####solved######

@bdresser
Copy link
Contributor

closing due to inactivity - let us know if you're still having trouble!

@arisAlexis
Copy link

arisAlexis commented Oct 2, 2018

Yes the problem is there. If the balance is created in the constructor function then it doesn't not appear on Metamask (probably because there is no txin for a balance transfer). But if you manually query truffle for balanceOf the balance is there. This is quite important can you reopen?

You can try the contract at rinkeby at 0xedEAC23451754F6e54886A20348f31fd38ff61cE that is an ERC20 Openzeppelin Ownable contract with the owner : 0xd587f68be865c8a4f34cc2a53150de0da5771957

The owner has balance 1000 but Metamask shows 0 when added as a custom token.

@bdresser bdresser reopened this Oct 2, 2018
@arisAlexis
Copy link

I resolved the problem and it turns out it's not a Metamask issue at all. the uint was converted to a tiny number due to decimals so the balance of 0.0000000001 was not showing. Can be closed for me.

@bdresser bdresser closed this as completed Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants