This question is similar to How to withdraw Ether from a contract? but different.
I am writing a smart contract for a token.
How can I transfer the tokens from the contract to my personal purse (non programmatically using such a program as Ethereum Wallet)?
Can I send the tokens from the contract like as I can do with regular wallet?
Best Answer
I'm assuming your tokens are ERC20 compliant.
The trick is that you can't transfer the tokens to your personal purse from the token contract because your personal purse already owns the tokens. The contract has to be the only place which knows who owns what tokens so the information has to be stored inside the contract. Whenever someone wants to know if address X has said tokens, they have to query the contract.
Therefore, there's also no need to try to transfer them.
The only thing you could do is reassign the tokens to a different address if you wish. You can use the
transfer
function for that.