I created a vanilla custom token via a contract on testnet and minted 10,000 coins to it, and I was able to successfully send the tokens to a wallet contract at a different address. However, when I attempt to use the Watch Token
feature and paste the contract address, the balance is always zero, despite the form auto-loading the other contract variables.
Shouldn't the number next to the icon display the amount of custom tokens associated with the main account address?
I am using Mist 0.8.10 on ropsten testnet.
My contract is pretty simple:
pragma solidity ^0.4.11;
contract PractCoin {
mapping (address => uint256) public monies;
address public owner;
uint public totalCoins;
uint public initialSupply;
string public name;
uint8 decimalPlaces;
function PractCoin(uint _totalCoins, uint _initialSupply, string _name, uint8 _decimalPlaces){
owner = msg.sender;
totalCoins = _totalCoins;
initialSupply = _initialSupply;
monies[owner] = initialSupply;
name = _name;
decimalPlaces = _decimalPlaces;
}
function sendCoins(address _to, uint _amount){
if (monies[msg.sender] < _amount ||
msg.sender == _to ||
monies[_to] + _amount < _amount) throw;
monies[msg.sender] -= _amount;
monies[_to] += _amount;
CoinTransfer(_amount, _to, msg.sender);
}
function destroyContract(){
if (msg.sender == owner ) selfdestruct(owner);
ContractDestroyed("Contract Destroyed!");
}
event CoinTransfer(uint _amount, address indexed _to, address indexed _from);
event ContractDestroyed(string _message);
}