Recently, I've created a token and it is pure ERC-20 Compliant...I've sent some token to another address but when I see it on rinkeby testnet etherscan web page it shows 0 holder despite having the transaction in transaction section below...Moreover, when I try to view token in metamask, Metamask also showed, we had trouble loading your token balance...What I'm missing here ??
Here's my code:
contract myToken {
address payable owner;
string public name = "Test TOKEN";
string public symbol = "TT";
uint public totalSupply_;
uint public tokenSold;
uint8 public decimals = 0;
uint256 public token_price = 300000000000000;
uint256 public token_incremental_price = 0;
uint256 public currentPrice;
event Transfer(address indexed _from, address indexed _to, uint tokens);
event Approval(address indexed _tokenOwner, address indexed _spender, uint tokens);
constructor(uint initialSupply) public {
owner = msg.sender;
totalSupply_ = initialSupply * 10**uint256(decimals);
totalSupply_ = initialSupply;
tokenLedger[owner] = totalSupply_;
currentPrice = token_price + token_incremental_price;
}
mapping(address => uint) internal tokenLedger;
mapping(address => mapping(address => uint256)) public allowed;
function myTokens() public view returns(uint256) {
return balanceOf(msg.sender);
}
function balanceOf(address _customerAddress) public
view
returns(uint)
{
return tokenLedger[_customerAddress];
}
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function transfer(address _toAddress, uint256 _amountOfTokens)
public
returns(bool success)
{
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenLedger[_customerAddress] && _amountOfTokens > 0);
tokenLedger[_customerAddress] = SafeMath.sub(tokenLedger[_customerAddress], _amountOfTokens);
tokenLedger[_toAddress] = SafeMath.add(tokenLedger[_toAddress], _amountOfTokens);
emit Transfer(_customerAddress, _toAddress, _amountOfTokens);
return true;
}
function transferFrom(address _from, address _to, uint256 tokens) public returns(bool success) {
require(tokens <= tokenLedger[_from]);
require(tokens > 0);
require(tokens <= allowed[_from][msg.sender]);
tokenLedger[_from] = SafeMath.sub(tokenLedger[_from], tokens);
tokenLedger[_to] = SafeMath.add(tokenLedger[_to], tokens);
allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], tokens);
emit Transfer(_from, _to, tokens);
return true;
}
function approve(address _spender, uint256 _tokens) public returns(bool success) {
allowed[msg.sender][_spender] = _tokens;
emit Approval(msg.sender, _spender, _tokens);
return true;
}
function allowance(address _owner, address _spender) public view returns(uint256 remaining)
{
return allowed[_owner][_spender];
}