I am using the MyAdvancedToken
code from: https://www.ethereum.org/token
I transferred tokens from owner account into the contract, to fund any buy()
. Now, I want those tokens back. Is there any way to transfer them, except for sell()
? Because of decimals issue, I could never buy that many tokens back.
I have seen similar questions, but I thought I could use transferFrom()
, and enter the contract address in the _from
field. However, that seems to fail:
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
Is there a way to do an allowance to get this to work? And why can't the contract address send the tokens using transferFrom
? Thanks.