Title: Does not work with ERC20 Token
Last modified: May 25, 2018

---

# Does not work with ERC20 Token

 *  Resolved [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/)
 * It has worked fine with ETH but it does not work with ERC20 token. It sends the
   deposit, but it fails when I try to release the funds. I am on the ropsten testnet
   and have cleared the cache.

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [ethereumicoio](https://wordpress.org/support/users/ethereumicoio/)
 * (@ethereumicoio)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10326695)
 * Hi [@shyheim103](https://wordpress.org/support/users/shyheim103/),
    Thank you
   for your interest! I’ll check this issue on my side. If you can share your site
   address to test it on your side it would help a lot. Also, have you tried it 
   with the test token that is suggested on the Testing paragraph in the readme.
   txt file, or with your own token?
 *  Thread Starter [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10326702)
 * For more specifics, please visit [http://egoods.co/shop/](http://egoods.co/shop/)
   and try to buy something. It’s all set for the ropsten network. The ETH works
   fine, but using TTME tokens does not work at all (I guess you’d need TTME tokens
   to try?)
 *  Thread Starter [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10326737)
 * I actually just have a question, when we’re specifying the accepted ERC20 tokens,
   what address do we put in there? I was under the assumptions that it should be
   the token’s smart contract, but looking up your examples it appears to just be
   wallets. Do we put in the smart contract’s owner’s address? Or just any random
   address?
 *  Thread Starter [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10327008)
 * The website is [http://www.egoods.co/shop/](http://www.egoods.co/shop/)
 * But I’m going to try the test token. I just read the readme file. Will let you
   know what happens, thanks!
 *  Thread Starter [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10327026)
 * OK, the test coin works. I’m wondering if it could be something in the code of
   my token? Is that possible?
 *  Thread Starter [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10327351)
 * It has to be something with the way my token is coded. Here is the repository:
   [https://github.com/IntraCoin/IntraCoin/blob/master/Contracts/IntraCoinToken.sol](https://github.com/IntraCoin/IntraCoin/blob/master/Contracts/IntraCoinToken.sol)
 * The token’s features shouldn’t stop your contract from interacting with it. I
   thought it might be because I had the TransferFrom function as an owner only 
   function but after changing that it still failed to pay.
 * What do you think the problem could be?
 *  Plugin Author [ethereumicoio](https://wordpress.org/support/users/ethereumicoio/)
 * (@ethereumicoio)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10327455)
 * The problem is with your token.
    It does not supply approve and allowance methods.
   Also, it has onlyOwner transferFrom method. You can not just remove the onlyOwner
   modifier, since it would allow anyone to transfer tokens of any other user. You
   need a fully functional implementation of the ERC20 interface:
 *     ```
       /**
        * @title ERC20 interface
        * @dev see https://github.com/ethereum/EIPs/issues/20
        */
       contract ERC20 is ERC20Basic {
         function allowance(address owner, address spender) public constant returns (uint256);
         function transferFrom(address from, address to, uint256 value) public returns (bool);
         function approve(address spender, uint256 value) public returns (bool);
         event Approval(address indexed owner, address indexed spender, uint256 value);
       }
       ```
   
 *  Thread Starter [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10327618)
 * Exactly. I didn’t plan on removing onlyOwner permenantly, just to see if that
   was the issue. But got it! I’m going to modify the token code now and see if 
   it works. Thanks for your help! I figured it was probably my code!
 *  Plugin Author [ethereumicoio](https://wordpress.org/support/users/ethereumicoio/)
 * (@ethereumicoio)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10327761)
 * Glad it helped!
 *  Thread Starter [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10327822)
 * OK, I changed everything. The problem is your plugin requires that my TransferFrom
   function be open to the public as we discussed earlier that poses a problem. 
   Leaving it an ownerOnly function causes the transaction to fail. If I remove 
   the onlyOwner modifier it works fine.
 * The only thing I can come up with at the moment is to give your contract temporary
   ownership and then it gives it right back to me.
 * How else can I fix this?
    -  This reply was modified 8 years, 2 months ago by [shyheim103](https://wordpress.org/support/users/shyheim103/).
    -  This reply was modified 8 years, 2 months ago by [shyheim103](https://wordpress.org/support/users/shyheim103/).
 *  Plugin Author [ethereumicoio](https://wordpress.org/support/users/ethereumicoio/)
 * (@ethereumicoio)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10328517)
 * Your transferFrom should never be onlyOwner. It is the same as to have the transfer
   function onlyOwner.
 * Look at this implementation please: [https://github.com/OpenZeppelin/openzeppelin-solidity/blob/c05918c3cc10d9394fd5fb95deb04036204ac896/contracts/token/ERC20/StandardToken.sol](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/c05918c3cc10d9394fd5fb95deb04036204ac896/contracts/token/ERC20/StandardToken.sol)
 * You need to have this or very similar implementation in your token. Otherwise
   your token is not ERC20 token.
 *  Thread Starter [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * (@shyheim103)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10329002)
 * I got it. The key element was the line that gives the allowance to someone to
   execute that function. Yes, it would be detrimental without that line but with
   it no one can use that function without permission first. Thanks for your response!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Does not work with ERC20 Token’ is closed to new replies.

 * ![](https://ps.w.org/ether-and-erc20-tokens-woocommerce-payment-gateway/assets/
   icon.svg?rev=1840426)
 * [Ether and ERC20 tokens WooCommerce Payment Gateway](https://wordpress.org/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/)
 * [Support Threads](https://wordpress.org/support/plugin/ether-and-erc20-tokens-woocommerce-payment-gateway/)
 * [Active Topics](https://wordpress.org/support/plugin/ether-and-erc20-tokens-woocommerce-payment-gateway/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ether-and-erc20-tokens-woocommerce-payment-gateway/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ether-and-erc20-tokens-woocommerce-payment-gateway/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [shyheim103](https://wordpress.org/support/users/shyheim103/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/does-not-work-with-erc20-token/#post-10329002)
 * Status: resolved