A contract that can't estimate gas while selling, but can buy Without issue

how can i go about creating a token that will bring this error code, when selling, but wont bring it when buying

i am working on a practical, to create a token hardcoded with pancake v1, that buying will be possible but selling will bring out this error code of, showing tranfer gas fee cannot be estimated, who know how i can go about this.

You can literally set up the gas limit manually in metamask or other wallets. This is usually happening when a function call makes internal calls to other contracts. The calls may get too deep such that it's impossible for the wallet software to estimate gas costs. It's however easier for humans to make a rough estimate.

i am working on a practical, to create a token hardcoded with pancake v1, that buying will be possible but selling will bring out this error code of, showing tranfer gas fee cannot be estimated, who know how i can go about this.

how can i go about a token that will bring this error code, when selling, but wont bring it when buying

Please do not ask the same question at many other topics, thanks!

Many ways will lead to this issue, for example, when you sell tokens, you token will transfer to pair contract, and when you buy tokens, the token will transfer from the pair contract, so maybe there is a requirement like:

require(to != PAIRADDRESS!);

I deployed the safemoon contract. I set liquidity fee to 25 and Tax to 25. But when I tried to buy it says, price impact too high

Maybe you can set a large slippage to have a try