0

I made contract ERC20 token MTCZx

https://ropsten.etherscan.io/address/0xf9471198b6f9c364f41Ea66e9a3F8daA637Ee77C#code

which can sell MTCZx tokens for ETH.

When I deployed it I make query to balanceOf with contract owner

0x1b7c7eb39ee32aeC901Ddcf50b5b46dE13E74931

https://ropsten.etherscan.io/address/0xf9471198b6f9c364f41Ea66e9a3F8daA637Ee77C#readContract

and see contract owner has 1 000 000 MTCZx balance.

When I add MTCZx to metamask I see balance only 1 MTCZx instead of 1 000 000.

The same 1 MTCZx total supply here instead of 1 000 000

https://ropsten.etherscan.io/token/0xf9471198b6f9c364f41Ea66e9a3F8daA637Ee77C

Also when I send tokens to another user https://ropsten.etherscan.io/tx/0xdcfc79ff803eda40f9a7841c84acb76434565be9fb120bc3fbdfb2f46793d7ae

I see in Metamask balance 0 tokens instead of 0.01 MTCZx

What's wrong with metamask? I or ERC20 contract?

1

The denomination unit in your ERC20 contract is 6:

uint8 public constant decimals = 6;

MetaMask displays the balance according to this value, i.e., the balance divided by 10 ** 6.

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.