Should Burn work coming from the liquidity pool of Pancakeswap in Testnet?

Hi, I'm new so please forgive this if it's a newbie question...
I have deployed this code to BNB TestNet and the initial Burn works on creation. However, when I create a liquidity pool and I use other wallets to swap from Pancakeswap, I do not see any Burn taking place. Is there something wrong with the code? Do Buy and Sell Burns work differently? Am I just completely wrong?
Here is the code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract OneLoveBurn is ERC20, ERC20Burnable {
    uint256 private constant TOTAL_SUPPLY = 420420000000 * 10**18; // Including 18 decimals
    uint256 private constant INITIAL_BURN = 420000000 * 10**18; // Including 18 decimals
    uint256 private constant MAX_HOLD_LIMIT_PERCENTAGE = 420; // 4.20% expressed as 420 / 10000
    uint256 private constant BURN_PERCENTAGE = 420; // 4.20% expressed as 420 / 10000
    uint256 private constant MINIMUM_CIRCULATING_SUPPLY = 420000000 * 10**18; // Minimum circulating supply

    address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;
    address public owner;
    mapping(address => bool) public liquidityPools;

    constructor() ERC20("41Love Burn - The best burn ever", "41LoveBURN") {
        owner = msg.sender;

        // Mint the total supply to the owner
        _mint(owner, TOTAL_SUPPLY);

        // Perform the initial burn
        _transfer(owner, BURN_ADDRESS, INITIAL_BURN);
    }

    modifier onlyOwner() {
        require(msg.sender == owner, "Caller is not the owner");
        _;
    }

    function setLiquidityPool(address pool, bool isPool) external onlyOwner {
        liquidityPools[pool] = isPool;
    }

    function transfer(address recipient, uint256 amount) public override returns (bool) {
        _validateMaxHoldLimit(msg.sender, recipient, amount);
        return super.transfer(recipient, amount);
    }

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public override returns (bool) {
        if (_isBuyOrSell(sender, recipient)) {
            uint256 burnAmount = _calculateBurnAmount(amount);
            if (burnAmount > 0) {
                _transfer(sender, BURN_ADDRESS, burnAmount);
                amount -= burnAmount;
            }
        }
        _validateMaxHoldLimit(sender, recipient, amount);
        return super.transferFrom(sender, recipient, amount);
    }

    function _calculateBurnAmount(uint256 amount) internal view returns (uint256) {
        uint256 circulatingSupply = totalSupply() - balanceOf(BURN_ADDRESS);
        if (circulatingSupply <= MINIMUM_CIRCULATING_SUPPLY) {
            return 0; // Stop burning if circulating supply has reached the minimum
        }

        uint256 burnAmount = (amount * BURN_PERCENTAGE) / 10000;

        // Ensure burn doesn't reduce circulating supply below the minimum
        if (circulatingSupply - burnAmount < MINIMUM_CIRCULATING_SUPPLY) {
            burnAmount = circulatingSupply - MINIMUM_CIRCULATING_SUPPLY;
        }

        return burnAmount;
    }

    function _isBuyOrSell(address sender, address recipient) internal view returns (bool) {
        return liquidityPools[sender] || liquidityPools[recipient];
    }

    function _validateMaxHoldLimit(
        address,
        address recipient,
        uint256 amount
    ) internal view {
        uint256 maxLimit = (totalSupply() * MAX_HOLD_LIMIT_PERCENTAGE) / 10000;
        require(amount <= maxLimit, "Transfer exceeds the maximum allowed percentage of total supply");

        // Ensure recipient does not exceed the limit after receiving tokens
        uint256 recipientBalance = balanceOf(recipient) + amount;
        require(recipientBalance <= maxLimit, "Recipient balance exceeds the maximum allowed percentage");
    }

    function burn(uint256 amount) public override {
        uint256 circulatingSupply = totalSupply() - balanceOf(BURN_ADDRESS);
        require(circulatingSupply - amount >= MINIMUM_CIRCULATING_SUPPLY, "Cannot burn below the minimum circulating supply");
        _transfer(msg.sender, BURN_ADDRESS, amount);
    }

    function burnFrom(address account, uint256 amount) public override {
        uint256 circulatingSupply = totalSupply() - balanceOf(BURN_ADDRESS);
        require(circulatingSupply - amount >= MINIMUM_CIRCULATING_SUPPLY, "Cannot burn below the minimum circulating supply");
        uint256 currentAllowance = allowance(account, msg.sender);
        require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
        _approve(account, msg.sender, currentAllowance - amount);
        _transfer(account, BURN_ADDRESS, amount);
    }
}

Hi, welcome to the community! :wave:

I am not sure what you mean Burn does not take place, the balance of the Dead Address increases, so I think the Burn does take place, just totalSupply does not change.

Thank you for the welcome!

No problem let me clarify.

  1. I run that code in TestNet. = Success
  2. Then I go to Pancakeswap and add liquidity for the contract in Testnet = Success
  3. I then swap via Pancakeswap 5,000,000 = Success
  4. Transaction finishes = Success
  5. I look in the wallet and it has 5,000,000 coins = Failure (in my mind)

if 4.2% was going to be burned, than 210,000 coin should have gone to the dead wallet. and 4,790,000 should be in the wallet that bought. Is that correct?

Please let me know if I'm incorrect here, that should be what is happening with the code? Or do I not understand how the Liquidity pool works?

Perhaps I'm confused about what triggers need to happen inorder for the burn to happen?

I am a newbie so I would really appreciate any insight.

Thank you again!!!