Can't add liquidity to my token through BSCScan/Etherscan, need some help making sure the contract itself isn't the issue

The issue I’m running into is this: no matter what I try I create a liquidity pool on pancakeswaps router, I can’t do it through the GUI on their website, and I cannot do it through writing contracts on BSCScan.

I’m hoping someone can take a look at my contract and tell me what I’m doing wrong, or see if there’s an issue with the contract itself.

Right now I’ve created, verified, and tested the following contract:

pragma solidity ^0.8.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol";


contract ScamCoin is ERC20 {

//suposed to act as a stopping point for minimum total supply
uint256 private _minimumSupply = 10000000 * (10 ** 18);

/**
 * @dev Constructor that gives msg.sender all of existing tokens.
 */
constructor () public ERC20("ScamCoin", "SCAM") {
    _mint(msg.sender, 500000000000000 * (10 ** uint256(decimals())));
}

function transfer(address to, uint256 amount) public override returns (bool) {
    return super.transfer(to, _partialBurn(amount));
}

function transferFrom(address from, address to, uint256 amount) public override returns (bool) {
    return super.transferFrom(from, to, _partialBurn(amount));
}

function _partialBurn(uint256 amount) internal returns (uint256) {
    uint256 burnAmount = _calculateBurnAmount(amount);

    if (burnAmount > 0) {
        _burn(msg.sender, burnAmount);
    }

    return amount -(burnAmount);
}

function _calculateBurnAmount(uint256 amount) internal view returns (uint256) {
    uint256 burnAmount = 0;

   //supposed to calculate the burn amount?
    if (totalSupply() > _minimumSupply) {
        burnAmount = amount / 10;
        uint256 availableBurn = totalSupply() -(_minimumSupply);
        if (burnAmount > availableBurn) {
            burnAmount = availableBurn;
        }
    }

    return burnAmount;
}

}

Here’s is the contract verified on BSCScan

Here’s the approval transaction for router to spend the coins

Here’s one of the failed transactions:

And finally here’s how I’ve set up writing the contract:

I feel like I’ve tried everything possible with changing variables around on the write contract tabs, so I’m assuming something must be messed up with my contract but I don’t really know. I don’t really know where else to look for help on this point and I tried to make it as detailed as possible so hopefully someone has an answer.

It seems like your token is a deflationary token, so maybe when you try to add liquidity, you should use a much lower value than the original value, that is amountTokenDesired = 239090000000000000000000000000000
amountTokenMin = 2151810000000000000000000000, just have a try, I am not sure.

You are using pancakeswap v1. You should use v2 router

I swear if this is the reason. I’ll give up on ever trying to code again.

Still failing, though it’s now taking more time to fail.

Also I tried with those numbers Skyge, no luck.

can you send me some tokens so I can try?

Sure, what’s your wallet address?

0xD1F902fE17159eF90Fa8d0D03DC2BB726E135960

Alright, I’ve sent them over to you. Let me know what you find. Thanks for the help BTW, I’ve been puzzling over this for multiple weeks now.

I take it you haven’t been able to get it to work either?

sorry I am busy these days. I will try asap

What I did for such token is to copy the contract of some working token with liquidity and change the token metrics, name and functions as needed. First try with something that is working copy-paste 1 to 1 and then perform the needed changes. For example you can try this contract: https://github.com/religion-counter/onlyone/blob/e9473ddce29b863cb2ca7c3b3a9328e19456fb91/bsc-smartcontract/ONLYONE.sol#L735 forked from SafeMoon which takes 5% for tax - redistributed to holders and 5% for adding to liquidity