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

I think you would have to, unless there is a way to tell the new Router and Dex what the existing Pair is. Is there a way to do that for Uni/Pancake/Sushi?

I didn’t search yet but I will check

1 Like

hello, I had the same problem with the liquidity lock on pancake v2 as you did. Can you tell me how to solve the problem? I didn’t click renounceOwnership and swapAndLiquifyEnabled - it shows false.

Check your maxTxAmount. If you still have ownership, set the MaxTxPercent to 100 using function “setMaxTxPercent”

1 Like

please tell me what is this value in uint256?

I enter 100, press write and I get an error in metamask:
ALERT: Transaction Error. Exception thrown in contract code.

I also see the following text:

I figured out the error. In the beginning, I applied the transferOwnership function to my other address, so I couldn’t interact with the contract.

I tried putting 100 as you said, but the contract has a maximum limit of 10. I also put setTaxFeePercent to 0 and setLiquidityFeePercent to 0 - but that didn’t help. I do not know what to do next.

2

Were you able to test this in testnet? I’m doing the safemoon contract but i can’t add liquidity in testnet to BNB/SAFEMOON. I can create the pair but can’t add liquidity.

Now SAFEMOON has this feature where if the contract balance goes abovenumTokensSellToAddToLiquidity which is 500000 * 10**6 * 10**9 it will swap for ETH (BNB) and then provide more liquidity. This is a feature that is important so i tested it and added >500000 * 10**6 * 10**9 into the contract and then it gave me and error that there wasn’t enough liquidity.

I assume this is because it was never added after the contract deployed. Although, in testnet, i can’t add liquidity even after i deploy with the addLiquidityETH function.

Bro, Can you please show me how dod you do that? Thanks in advance

The only errors that apply is maxTxPercent and SwapAndLiquify.

maxTxPercent is the max % you can transfer in one transaction. Set to 100.

Set SwapAndLiquify to False.

Hi Tsuchima

Can you make the address changeable for future versions anyway, please?
WHat is your advice?

Thanks

My advice is to build a function that allows you to change that. How to fix Pancakeswap's Router address in Safemoon

1 Like

Have you tested that function please? does it work properly?

It is a setter function, there isn’t much to it. Please test the function in your own contracts and see if it works for you.

Okay, but can you please tell me exactly where I should add that function on the smart contract as I am new here?

No I cannot tell you exactly. You just need to add the function somewhere in your smart contract that makes sense.

If you are new here please follow the guide OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat

This should get you up to speed.

Learning Resources:

Thank you so much, very useful resources.
sorry for bother you but another question, now my LP is stuck on Panceke V2, which I used v1 router in my SC, as well as there were few successful transaction, but now I cant remove the LP. do you have any idea how to remove it anyway?
Pancake support just do not reply :

Please refer to

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.

You mean the ownership verification on BSCscan? if I get that ownership I can change the code swapAndLiquifyEnabled to false?

Yes, that is exactly what it means.