On https://theethereum.wiki/w/index.php/ERC20_Token_Standard there is a function which goes as follows: -

// Owner can transfer out any accidentally sent ERC20 tokens

function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
       return ERC20Interface(tokenAddress).transfer(owner, tokens); 

My reading that if this is called then the owner will receive the ERC20 tokens in the contract address - is this correct?


Yes. This addresses the human error where token holders accidentally send their tokens to the contract address itself.

ERC-20 tokens do not have a mechanism for the smart contracts to reject the transfer. Thus, tokens are permanently lost if smart contracts do not have measures to recover tokens send on them.

| improve this answer | |
  • In any case where a more decentralized countermeasure is desired, I think an ERC should be proposed to give the errant sender control over the refund request. – GViz May 28 '18 at 7:12

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.