I created ERC-20 token, and send other ERC-20 token to created contract address.

Can I transfer that token?


The transferred tokens are not "in your contract".

Their amount is registered in the other contract, with a mapping (address => uint256) balances.

You can view that amount via otherContract.balances[yourContractAddress], and you can transfer some or all of it by signing otherContract.transfer with the private key of yourContractAddress.

Unfortunately, the only way to retrieve the private-key of a deployed contract is by brute-force.

There are 2^256 different options, which is more or less the number of atoms in the known universe, so technically speaking, there is not enough energy in order to complete this kind of computation.

  • "Unfortunately" should actually be "Fortunately", because the whole Ethereum model would be worthless otherwise. – goodvibration Apr 1 '19 at 6:10
  • Thanks. Other token created from me too. (I create two tokens). If so can I transfer? – Heesu Cheon Apr 1 '19 at 7:23
  • @HeesuCheon: No. You should have added a designated function in the other contract (typically with permission restricted only to your account), which performs this. – goodvibration Apr 1 '19 at 9:27
  • Thank you. You should have added a designated function means impossible now? – Heesu Cheon Apr 1 '19 at 9:57
  • @HeesuCheon: For this deployment yes. You can always redeploy... – goodvibration Apr 1 '19 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.