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

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.

Okay dear. thank you so much, you helped me a lot.

1 Like

Can I know how I have got ownership? I already signed the ownership verification and submitted updates of the token, should I wait for replay from BSC or that is it?

And If I got ownership, how to modify those functions, any recourse, please?

Thanks for the head's up! In the other thread I mentioned having problems with it in the other thread here

https://forum.openzeppelin.com/t/safemoon-fork-lp-issue/7612/3?u=peire_cardenal

I did set the V2 address and didn't use the V1 address (I use 0x10...). But I still can't remove liquidity. Any idea why this might happen? I don't care about my liquidity, I just care about fixing the issue in the contract.

Thanks for the help.

And How many times can I edit them please, I dont want to make ani mistake please?

I already tried on write contract section, is that so? and connected with owner wallet, but after a while it says: Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!

You can modify functions by using bscscan. Connect to Web3. Do the functions through the website.

Use the testnet. Do not deploy to mainnet until you are ready. Follow tutorials and guides.