0

I m testing ERC20 token contracts. I could be able to create and get back the tokens in the Ropstan test network. When I deploy the same contract.sol in the main network my creator address doe not get any tokens back.. when I run the function transferthe transaction says ERC-20 Token Transfer Failed to complete, check with sender for more information.

This is the contract address: https://etherscan.io/address/0xbda3d86d96eb05a8965d73cb59b12eeeaf2530be

What could be the reason?

I am using remix.

0

Assuming https://etherscan.io/tx/0xbc402bc9f35e9707675eb427ff40f5e28d673e643132759fc5b1089ed6efcc95 is one of the transactions you're wondering about, the full message is "The ERC-20 Token Transfer might have Failed (ErrCode: unable to locate corresponding Transfer event log), check with sender."

You passed a _to address of 0 and a _value of 0. From the code:

if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
    ...
    Transfer(_from, _to, _value);
    return true;
} else { return false; }

So no Transfer event is fired unless _value > 0, which it isn't.

I assume you didn't really mean to pass 0s as the parameters, so check the code/tool you're using to create the transaction and fix the issue there.

  • thanks.. but how do I have to update this code to just send the all tokens to the creator address?? that's all I want.... – Token Maniac Jan 14 '18 at 17:53
  • I'm not sure what you mean. In the constructor, all tokens are already assigned to the address that created the contract. – user19510 Jan 14 '18 at 17:54
  • oh., sorry.. I did not see the token balance till I add this custom token to my Metamask... thanks anyway.. – Token Maniac Jan 14 '18 at 17:57

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.