I've created a test ERC20 token like at https://theethereum.wiki/w/index.php/ERC20_Token_Standard. I've sent some test ether to the contract and can verify my account has some of the token, eg with the following command (calling the "balanceOf" function):
contractInstance.balanceOf.call(web3.eth.accounts[0])
returns:
{ [String: '7000000000000000'] s: 1, e: 15, c: [ 70 ] }
After that I want to send some of the token to another account. My transfer function is as follows:
function transfer(address _to, uint256 _value) returns (bool success) {
require(balances[msg.sender] >= _value && _value > 0);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
(I'm using the SafeMath.sol contract at https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol)
Running the following command to execute the transfer function and send some of the token to my second account:
contractInstance.transfer.call(web3.eth.accounts[1], 0.005)
returns
false
So the transfer isn't being executed. What might the issue be here?
Transfer
event.”