FTF I'm a noob in Solidity! Has been created a contract sending the initial supply to the contract address. I would like to know if is it possible to send the tokens from the contract to the address (owner of the contract)?

Contract https://ropsten.etherscan.io/address/0xec7b8dafd5494654a2ce801c7abe01bb6d3d4557#code

Contract Balance https://ropsten.etherscan.io/token/0xec7b8dafd5494654a2ce801c7abe01bb6d3d4557#balances


You're currently assigning them to the contract. Just update the following lines in the contract:

balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);
  • Ok, thanks! So, the way it is cant i send from the contract to another address? – Mick Marosky Aug 4 '18 at 13:34
  • Not unless you include a special method within the contract to transfer tokens out from a contract. The ERC20 spec is designed to allow users to move tokens. The contract address itself is not meant to be a user. – Raghav Sood Aug 4 '18 at 13:37
  • I thought I could put the tokens in the contract and then use another contract to move the tokens from, like a service contract. – Mick Marosky Aug 4 '18 at 13:45
  • You can, provided the contract that holds the tokens has the appropriate code to invoke token transfers. The erc20 spec does not include such code. You can add it to the contract yourself, or deploy another contract to handle distribution with that code, and send the tokens to it. You can see an example of such a method here – Raghav Sood Aug 4 '18 at 13:49
  • Tks for your time, help me a lot! – Mick Marosky Aug 4 '18 at 13:53

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.