# Interacting directly with an ERC20 token's contract for trading

**URL:** <https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958>\
**Category:** Support\
**Created:** [December 8, 2020, 7:42pm UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958 "2020-12-08T19:42:37Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/tiger/32/3775_2.png) [@tiger](https://forum.openzeppelin.com/u/tiger)\
**Post date:** [December 8, 2020, 7:42pm UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/1 "2020-12-08T19:42:37Z")

</div>

I’m currently a complete beginner on Solidity with some experience on other coding languages and I’ve been checking out the tutorials on writing/deploying contracts.

I have a Uniswap-only ERC20 token and it’s not possible to sell via Uniswap because of its sell tax. Thus, I wanted to create a contract which would allow me to interact with that token’s contract directly so that I can sell that token to its contract and receive Eth in return.

Since I’m extremely new to this and there are real funds at stake, I wanted to ask for a specific guidance although there are some presets and tutorials available here.

So I apologize in advance if this had been asked here before or if it is actually easier/harder than I think it is, I would really appreciate a step-by-step roadmap; ultimately for writing a contract that would allow me to interact directly with an ERC20 token’s contract and sell that token back to its contract.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 9, 2020, 9:54am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/2 "2020-12-09T09:54:40Z")

</div>

Hi @tiger,

Welcome to the community 👋.

I am not sure what you mean by a Uniswap-only token?

Do you want to create a Crowdsale? See [https://docs.openzeppelin.com/contracts/2.x/crowdsales](https://docs.openzeppelin.com/contracts/2.x/crowdsales) and [Simple ERC20 Crowdsale](https://forum.openzeppelin.com/t/simple-erc20-crowdsale/4863)

I recommend reading [Points to consider when creating a fungible token (ERC20, ERC777)](https://forum.openzeppelin.com/t/points-to-consider-when-creating-a-fungible-token-erc20-erc777/2915). You didn’t cover what the purpose of your token was.

---

<div class="post-metadata">

**Author:** ![tiger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/tiger/32/3775_2.png) [@tiger](https://forum.openzeppelin.com/u/tiger)\
**Post date:** [December 9, 2020, 10:05am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/3 "2020-12-09T10:05:34Z")

</div>

Hello @abcoathup,

Actually I’m not trying to create a token. What I mean by saying a Uniswap-only token is that that token only has a liquidity pool in Uniswap. I am currently holding an ERC20 token in my eth wallet which is only tradable in Uniswap; meaning that I can’t trade it in any other DEX because there no any other liquidity pools for it.

The devs of that token put a sell-tax on the token to prevent sells (50% tax), thus I cannot sell the token via Uniswap even if I set the slippage to 49.99. I can send you the Uniswap link of the token from private but I don’t know if it’s allowed to do that here.

So what I basically want to do is; to write a contract which would allow my eth wallet to interact directly with that token’s contract address to sell that token back to its contract directly so that I can sell without using Uniswap.

It would be a really simple code as fas as I’m concerned since the only thing I want to do is to interact with its contract and sell its token back to it; in return of eth.

I hope I explained it clearly,  
Thanks for your reply

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 10, 2020, 3:41am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/4 "2020-12-10T03:41:15Z")

</div>

Hi @tiger,

Feel free to share the Solidity source code (e.g. a link to the source code on Etherscan or GitHub).

I am still not sure how you can transfer the token without a fee on transfer if that is what the developers have setup. Though someone in the community may be able to advise.

---

<div class="post-metadata">

**Author:** ![tiger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/tiger/32/3775_2.png) [@tiger](https://forum.openzeppelin.com/u/tiger)\
**Post date:** [December 10, 2020, 10:22pm UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/5 "2020-12-10T22:22:03Z")

</div>

Hello @abcoathup,

I think I failed to define clearly what I was trying to do, nevertheless I solved it and made the transaction.

So I was basically trying to swap certain amount of an ERC20 token in return of ETH, via Uniswap. The devs implemented a selling fee which made the trade via Uniswap impossible with max. slippage. Thus, I wanted to find a way to interact with its contract address directly (bypassing Uniswap’s interface) in order to make the swap.

Here’s how I solved it:

From Etherscan, I made the transaction without using Uniswap’s interface. So there was no need for deploying a new smart contract for it.

Thank you.

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 11, 2020, 12:39am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/6 "2020-12-11T00:39:52Z")

</div>

Hi @tiger,

I’m glad you were able to resolve. Thanks for sharing.

---

<div class="post-metadata">

**Author:** ![Latha\_hodl](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/latha_hodl/32/4175_2.png) [@Latha\_hodl](https://forum.openzeppelin.com/u/Latha_hodl)\
**Post date:** [January 29, 2021, 11:26am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/7 "2021-01-29T11:26:09Z")

</div>

I also have a token which is tradable only in uniswap. But can’t swap it to eth in uniswap. How can we do this via etherscan? Can you please guide or any link explains this will be helpful.

---

<div class="post-metadata">

**Author:** ![Georgios\_Manousakis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/georgios_manousakis/32/3970_2.png) [@Georgios\_Manousakis](https://forum.openzeppelin.com/u/Georgios_Manousakis)\
**Post date:** [February 14, 2021, 7:16am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/8 "2021-02-14T07:16:51Z")

</div>

Hello @tiger ,

I have a similar problem with a broken smart contract…and i wanted to help me try the same …so if it’s possible can you break down a bit more how you can trade your erc20 tokens back to eth via etherscan??

Thans in advance!

---

<div class="post-metadata">

**Author:** ![tiger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/tiger/32/3775_2.png) [@tiger](https://forum.openzeppelin.com/u/tiger)\
**Post date:** [February 14, 2021, 10:52am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/9 "2021-02-14T10:52:00Z")

</div>

Hello guys,

So I’m seeing that it is a common problem that a lot of people are struggling with.

The solution is actually something I have personally discovered with trial-error rather than something I’ve seen on the internet and the solution itself varies from contract to contract.

The contract of the token on Etherscan should tell us whether if there is a way to do it straight from the etherscan. Since there are real funds at stake, it would not be wise for me to hand out a single solution; as a single miscalculation or a wrong assumption can cause complete loss of funds. It must be dealt by case-by-case scenario, thus I cannot give a universal solution as I do not intend on assisting anyone into doing something wrong.

Although I would be more than happy to help and give you specific instructions one by one on how to make the transaction via Etherscan -_ **given that the contract of the token you’re trying to swap allows it** _-.

You can personally contact me as well, if it makes a difference. I will try to reply in my free time other than my research.

Thanks, stay safe!

---

<div class="post-metadata">

**Author:** ![vizboy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/vizboy/32/4550_2.png) [@vizboy](https://forum.openzeppelin.com/u/vizboy)\
**Post date:** [March 11, 2021, 6:38am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/10 "2021-03-11T06:38:39Z")

</div>

how can I get in contact

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [March 12, 2021, 3:20am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/11 "2021-03-12T03:20:17Z")

</div>

Hi @vizboy,

Welcome to the community 👋

If you are trying to contact someone you can try messaging them on the forum.

---

<div class="post-metadata">

**Author:** ![jheff](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jheff](https://forum.openzeppelin.com/u/jheff)\
**Post date:** [March 17, 2021, 4:30pm UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/12 "2021-03-17T16:30:13Z")

</div>

Hi, I am interested in learning about how to do swaps via Etherscan as a workaround to Uniswap.

Please let me know, thanks.

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [March 18, 2021, 2:30am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/13 "2021-03-18T02:30:17Z")

</div>

As a matter of fact, call function on the etherscan is a little difficult, cause you have got to set parameter by your self, if possible, I would recommend you to operate what you want to do on the website.

---

<div class="post-metadata">

**Author:** ![Aaron1](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@Aaron1](https://forum.openzeppelin.com/u/Aaron1)\
**Post date:** [August 19, 2021, 3:27am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/14 "2021-08-19T03:27:12Z")

</div>

Hey, would you possibly be able to help me with a very similar situation to what you had. Im trying to swap my "scam" tokens back to eth. May not be possibly, i was just hoping to get someone who knows what they are looking at to check out the contract.

0xaf37d3c026bc6f58d37adf06b66d6e0d3192021b

Any help would be very much appreciated and thank you

---

<div class="post-metadata">

**Author:** ![faddasarducci](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/faddasarducci/32/13671_2.png) [@faddasarducci](https://forum.openzeppelin.com/u/faddasarducci)\
**Post date:** [March 7, 2022, 1:27am UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/15 "2022-03-07T01:27:37Z")

</div>

> [@tiger](#):
>
> From Etherscan, I made the transaction without using Uniswap’s interface. So there was no need for deploying a new smart contract for it.
> 
> Thank you.

You mentioned using etherscan, but you used some other wallet app like metamask, right? also, what specifically did you write into the txn to perform the swap?

THank you

---

<div class="post-metadata">

**Author:** ![vlo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/vlo/32/19765_2.png) [@vlo](https://forum.openzeppelin.com/u/vlo)\
**Post date:** [January 4, 2024, 3:53pm UTC](https://forum.openzeppelin.com/t/interacting-directly-with-an-erc20-tokens-contract-for-trading/4958/16 "2024-01-04T15:53:07Z")

</div>

I wonder if anyone has been able to contact @tiger ? I currently have exactly the same issue as he had (100% sell tax), and I'd love to know if it's possible to sell the token using direct interaction via Ehterscan / BscScan?
