Given this contract using Openzeppelin lib:
contract Token is StandardToken, Ownable {
string public name = "";
string public symbol = "";
uint8 public decimals = 18;
constructor(string _name, string _symbol, uint256 _supply, address creator) public {
owner = creator;
name = _name;
symbol = _symbol;
totalSupply_ = _supply;
balances[owner] = totalSupply_;
Transfer(0x0, owner, balances[owner]);
}
truffle(rinkeby)> Token.at('0xdc190d1ac0355bc3b9b4bba96738484cd07690ea').balanceOf.call('0xD587f68bE865c8a4F34CC2a53150dE0DA5771957'); BigNumber { s: 1, e: 2, c: [ 665 ] }
Metamask and Coinbase wallet report 0 balance when you add it as a custom token with the owner address.
Running truffle console, the owner is indeed correct and running balanceOf reports correct balance.
Is it a problem because it is assigned in the constructor and there is no transfer tx? So the problem is with the wallets or in my code?
The code passes all truffle tests for balances etc before deployed.
Note that this contract is deployed from a "mother" contract that's why owner is not msg.sender but why would that be a problem?
Tried updating with a Transfer event to be compatible with the ERC20 protocol but didn't change anything.
tokenURI_
as far as I know.Event
in the constructor with value ofbalances[owner]
and see what it gives you.