How to fix: "Gas estimation errored with the following message (see below)". [Safemoon Fork]

image

I read many people asking for this problem so now I try to fix their issue once and for all.
99% of the times this error is caused by the wrong router address of Pancakeswap.
If you are on testnet use this: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1

If you are on mainnet use this: 0x10ED43C718714eb63d5aA57B78B54704E256024E

If after changing it you still get the error, clean cookies and cache.
Are you still getting this error? Well open a topic and share your code and your problem.
Community will help

3 Likes

Hello, seems like i am that 1%... never lucky haha

Have a look at code here if youd like: https://pastebin.com/pRRXwZca .

I have tested on mainnet and testnet.
Any help is greatly appreciated!
Many thanks in advance :slight_smile:

Your compiler version should be 0.6.12, not 0.6.2

Thanks, I search problem so much but not resolve problem current, to when post you. Thank so much <3

1 Like

thanks, this solved my problem. :grinning:

I did everything but it didn't work. What is wrong with this coding? https://file.lu/d/L9U

How, help me please!

hey @amatuer1102 , just read the initial post

Thanks, i deploy on Mainnet or testnet, the same error.

That address is for testnet. If you use the UI at https://pancake.kiemtienonline360.com/#/swap you must use this router address 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3