# PSA Regarding SafeMoon Forks on PancakeSwap - Transfers not working? Read This!

**URL:** <https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692>\
**Category:** Support\
**Tags:** safemoon\
**Created:** [May 2, 2021, 12:39pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692 "2021-05-02T12:39:47Z")\
**Posts on this page:** 20\
**Page:** 1

<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 2, 2021, 12:39pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/1 "2021-05-02T12:39:47Z")

</div>

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/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3#code](https://bscscan.com/address/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3#code)  
`IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F);`

SafeMoon does not allow an update for this. There is not function in the code that will allow you to update this code.

**This is important because the Liquification Process will happen to the V1 Router, if you moved to V2 and there is no LP in the V1 router, this will cause errors and you will be unable to swap or transfer your tokens.**

If you do move to V2 then  
**In order to fix this you must set variable `swapAndLiquifyEnabled` to false.**

If you cannot do this because you rejected your ownership of your contract, then you must stay on V1. However you will not get rewards or fees for providing LP.

If you are having trouble removing Liquidity you may need to change your maxTxAmount so that when you remove liquidity it will go through.

---

<div class="post-metadata">

**Author:** ![ronaldoguedess](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ronaldoguedess/32/5448_2.png) [@ronaldoguedess](https://forum.openzeppelin.com/u/ronaldoguedess)\
**Post date:** [May 2, 2021, 1:36pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/2 "2021-05-02T13:36:26Z")

</div>

Thank you so much, my friend! you helped me a lot!!!  
I’m happy to found this group!!! congrats!!

---

<div class="post-metadata">

**Author:** ![N00blearner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/n00blearner/32/5356_2.png) [@N00blearner](https://forum.openzeppelin.com/u/N00blearner)\
**Post date:** [May 3, 2021, 10:09am UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/3 "2021-05-03T10:09:08Z")

</div>

Hey thanks for this PSA.

So if we create a new safemoon fork and update the below to the V2 router does this correct the issue and allow compatibility with Pancakeswap V2 liquidity? i.e. Can we just update the code as follows?

IUniswapV2Router02 \_uniswapV2Router = IUniswapV2Router02(0x10ed43c718714eb63d5aa57b78b54704e256024e);

---

<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 3, 2021, 11:14am UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/4 "2021-05-03T11:14:16Z")

</div>

Yes, but what if they move to V3 in the future?

You will just end up in the same issue. You should build a function that allows overwriting for this code.

---

<div class="post-metadata">

**Author:** ![ronaldoguedess](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ronaldoguedess/32/5448_2.png) [@ronaldoguedess](https://forum.openzeppelin.com/u/ronaldoguedess)\
**Post date:** [May 3, 2021, 11:36am UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/6 "2021-05-03T11:36:49Z")

</div>

> Blockquote Yes, but what if they move to V3 in the future?  
> You will just end up in the same issue. You should build a function that allows overwriting for this code.

You are right, I did it yesterday!  
now I can replace this address, if someone wants it, I can show how I did.

---

<div class="post-metadata">

**Author:** ![H4rvey](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/h4rvey/32/5222_2.png) [@H4rvey](https://forum.openzeppelin.com/u/H4rvey)\
**Post date:** [May 4, 2021, 6:23pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/7 "2021-05-04T18:23:29Z")

</div>

> [@N00blearner](#):
>
> Hey thanks for this PSA.
> 
> So if we create a new safemoon fork and update the below to the V2 router does this correct the issue and allow compatibility with Pancakeswap V2 liquidity? i.e. Can we just update the code as follows?
> 
> IUniswapV2Router02 \_uniswapV2Router = IUniswapV2Router02(0x10ed43c718714eb63d5aa57b78b54704e256024e);

Up for this one. I also wanted to know if this is enough to make safemoon fork work.

---

<div class="post-metadata">

**Author:** ![ronaldoguedess](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ronaldoguedess/32/5448_2.png) [@ronaldoguedess](https://forum.openzeppelin.com/u/ronaldoguedess)\
**Post date:** [May 5, 2021, 11:40am UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/8 "2021-05-05T11:40:53Z")

</div>

> [@H4rvey](#):
>
> Up for this one. I also wanted to know if this is enough to make safemoon fork work.

Yes, do it and safemoon fork will work.

---

<div class="post-metadata">

**Author:** ![H4rvey](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/h4rvey/32/5222_2.png) [@H4rvey](https://forum.openzeppelin.com/u/H4rvey)\
**Post date:** [May 5, 2021, 1:17pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/9 "2021-05-05T13:17:37Z")

</div>

Aight! Will give it a try! Thank you.

---

<div class="post-metadata">

**Author:** ![firedog7881](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/firedog7881/32/5519_2.png) [@firedog7881](https://forum.openzeppelin.com/u/firedog7881)\
**Post date:** [May 5, 2021, 6:18pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/10 "2021-05-05T18:18:18Z")

</div>

> [@Yoshiko](#):
>
> If you do move to V2 then  
> **In order to fix this you must set variable `swapAndLiquifyEnabled` to false.**

Can you clarify this for me?  
I haven't deployed yet - If I update the router address to the V2 address do I need to set the swapAndLiquifyEnabled function to false? I don't believe so since the function will be using the new address.

Also, do you know PacakeSwap V2 address on BSC Testnet?

---

<div class="post-metadata">

**Author:** ![simo](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@simo](https://forum.openzeppelin.com/u/simo)\
**Post date:** [May 5, 2021, 7:09pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/11 "2021-05-05T19:09:33Z")

</div>

Hi, it would be great if you could show it, thanks in advance.

---

<div class="post-metadata">

**Author:** ![ronaldoguedess](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ronaldoguedess/32/5448_2.png) [@ronaldoguedess](https://forum.openzeppelin.com/u/ronaldoguedess)\
**Post date:** [May 5, 2021, 7:43pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/12 "2021-05-05T19:43:05Z")

</div>

> [@firedog7881](#):
>
> I haven’t deployed yet

Please, before deploy it change router address to the V2.  
0x10ed43c718714eb63d5aa57b78b54704e256024e

---

<div class="post-metadata">

**Author:** ![Instant\_Moon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/instant_moon/32/5513_2.png) [@Instant\_Moon](https://forum.openzeppelin.com/u/Instant_Moon)\
**Post date:** [May 8, 2021, 4:36am UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/13 "2021-05-08T04:36:24Z")

</div>

Thanks for this !

Is there a way to remove liquidity from pancakeswap V2 if we renounce the ownership ? ( lot of bnb locked 😵 )

---

<div class="post-metadata">

**Author:** ![Downt](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@Downt](https://forum.openzeppelin.com/u/Downt)\
**Post date:** [May 9, 2021, 8:15am UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/14 "2021-05-09T08:15:11Z")

</div>

Trying to do a similar adjust to make the pcs address variable. Can you share your code so I can see your method

Would be interesting to see your approach

Many thanks

---

<div class="post-metadata">

**Author:** ![Downt](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@Downt](https://forum.openzeppelin.com/u/Downt)\
**Post date:** [May 9, 2021, 8:20am UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/15 "2021-05-09T08:20:06Z")

</div>

Did you try making the router address changeable in the code? I imagine many future PCS releases v3 v4… causing legacy contract issues …

---

<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 10, 2021, 7:21pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/16 "2021-05-10T19:21:58Z")

</div>

The solution is to write a simple getter/setter of the Router address and for the LP Pair. But no one can change it in their code because they do not use proxies. It would also require the contract to have an owner.

---

<div class="post-metadata">

**Author:** ![FreezyEx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/freezyex/32/5498_2.png) [@FreezyEx](https://forum.openzeppelin.com/u/FreezyEx)\
**Post date:** [May 10, 2021, 7:56pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/17 "2021-05-10T19:56:15Z")

</div>

I am going to create a function to change Router address. But now the question is:  
What I have to do in addition to change the router to an hipotetically v3? It is enought to remove liquidity from v1 and add to v2?

---

<div class="post-metadata">

**Author:** ![FreezyEx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/freezyex/32/5498_2.png) [@FreezyEx](https://forum.openzeppelin.com/u/FreezyEx)\
**Post date:** [May 10, 2021, 7:56pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/18 "2021-05-10T19:56:52Z")

</div>

Pancakeswap on testnet is this. No v2 I think  
0xD99D1c33F9fC3444f8101754aBC46c52416550D1

---

<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 10, 2021, 10:36pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/19 "2021-05-10T22:36:47Z")

</div>

you need to update the Router Address and the LP address. When that update happens move your LP to the new address. There are probably better ways to migrate to a new router than manually removing and re-adding. You would have to think up a migration way.

Uniswap might have a way since they created a Migrate from V2 to V3 function.

---

<div class="post-metadata">

**Author:** ![FreezyEx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/freezyex/32/5498_2.png) [@FreezyEx](https://forum.openzeppelin.com/u/FreezyEx)\
**Post date:** [May 10, 2021, 11:04pm UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/20 "2021-05-10T23:04:30Z")

</div>

Ok but should I create a new Pair on new router? Like in the constructor?

---

<div class="post-metadata">

**Author:** ![mrkawdy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mrkawdy/32/5622_2.png) [@mrkawdy](https://forum.openzeppelin.com/u/mrkawdy)\
**Post date:** [May 11, 2021, 2:20am UTC](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692/21 "2021-05-11T02:20:54Z")

</div>

I’d love to see how you were able to do this!

[Next page](https://forum.openzeppelin.com/t/psa-regarding-safemoon-forks-on-pancakeswap-transfers-not-working-read-this/7692.md?page=2)
