I created a new smart contract token with initial supply and deployed it via MetaMask. Then I added this token into MetaMask but token balance is Zero.

Now, My question is when we create a new contract then from where we get the initial balance for an address ?


When you create a token contract you define how many tokens there are initially. Furthermore you typically also define how the tokens can be distributed and who owns them - usually the original owner is either a crowdsale contract or the token contract creator.

So, without seeing your code (and especially how you deploy it - constructor arguments are often used for defining these things) it's impossible to know where to tokens are. If you simply create a simple token contract with initial balance nobody owns the tokens and therefore they can never be transferred anywhere. So remember to set someone as the token owner.

| improve this answer | |

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.