# Creating my token (BEP20): Error Pancakeswap K "TRANSFER\_FAILED"

**URL:** <https://forum.openzeppelin.com/t/creating-my-token-bep20-error-pancakeswap-k-transfer-failed/8268>\
**Category:** Contracts\
**Tags:** erc20\
**Created:** [May 12, 2021, 9:01pm UTC](https://forum.openzeppelin.com/t/creating-my-token-bep20-error-pancakeswap-k-transfer-failed/8268 "2021-05-12T21:01:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brastoken](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/brastoken/32/3872_2.png) [@brastoken](https://forum.openzeppelin.com/u/brastoken)\
**Post date:** [May 12, 2021, 9:01pm UTC](https://forum.openzeppelin.com/t/creating-my-token-bep20-error-pancakeswap-k-transfer-failed/8268/1 "2021-05-12T21:01:33Z")

</div>

**💻 Environment**  
Remix Ethereum  
Compile Version: v0.6.12+commit.27d51765

**📝Details**  
After compiling the contract I added liquidity to the 0.5 BNB pancake and I get the error “TRANSFER\_FAILED” when making the purchase.

However, as soon as I added liquidity someone made a purchase in the same second, I don’t know if it was the pancake or some bot. My question is: is there a way to resolve this error?

And if the problem is in the contract, why did someone manage to buy?

Observation: I tried all the slippage.

I cloned a contract similar to Safemoon and decreased the supply to a smaller quantity.

**🔢 Code to reproduce**

> **[Contract Address 0xeb2d878dcc05c8f39411df483574907b4fb11990 | BscScan](https://bscscan.com/address/0xeb2d878dcc05c8f39411df483574907b4fb11990#code)**
>
> The Contract Address 0xeb2d878dcc05c8f39411df483574907b4fb11990 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on...

I am willing to pay someone to help me solve this problem.

---

<div class="post-metadata">

**Author:** ![Yoshiko](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/yoshiko/32/6858_2.png) [@Yoshiko](https://forum.openzeppelin.com/u/Yoshiko)\
**Post date:** [May 14, 2021, 10:41am UTC](https://forum.openzeppelin.com/t/creating-my-token-bep20-error-pancakeswap-k-transfer-failed/8268/2 "2021-05-14T10:41:34Z")

</div>

Hi @brastoken , I have locked this thread because it is dealing with SafeMoon.

Please search the forums first. The solution has already been provided.

Refer to

> [@PSA Regarding SafeMoon Forks on PancakeSwap - Transfers not working? Read This!](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692):
>
> Recently PancakeSwap has migrated to V2. You can migrate to V2 following the guide. [https://medium.com/beefyfinance/pancakeswap-migration-2d599e262900](https://medium.com/beefyfinance/pancakeswap-migration-2d599e262900) The V2 router is now [https://bscscan.com/address/0x10ed43c718714eb63d5aa57b78b54704e256024e](https://bscscan.com/address/0x10ed43c718714eb63d5aa57b78b54704e256024e) However if you are already on V1, you will want to stay on V1 if possible because there is a problem with SafeMoon code in that the V1 router for PancakeSwap was hardcoded in. Line 758 [https://bscscan.com/address/0x8076c74c5e3f5852037f31ff0093eeb8c8add…](https://bscscan.com/address/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3#code)

It’s either SwapAndLiquify needs to be set to False or MaxTxPercent needs to be set to 100.

If you have rejected ownership then you likely cannot get the liquidity back.

---

<div class="post-metadata">

**Author:** ![Yoshiko](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/yoshiko/32/6858_2.png) [@Yoshiko](https://forum.openzeppelin.com/u/Yoshiko)\
**Post date:** [May 14, 2021, 12:13pm UTC](https://forum.openzeppelin.com/t/creating-my-token-bep20-error-pancakeswap-k-transfer-failed/8268/3 "2021-05-14T12:13:32Z")

</div>


