Hello,
I am new to solidity and open zeppelin. Overall it seems quite straightforward, but I am stuck on something that, I am sure, is pretty simple to fix.
My smart contract has a burn function that reduces the total supply for each transaction. I am trying to implement a simple check of the total supply against the minimum supply. Once the total supply is lower or equal to the minimum supply the burn and fee should stop applying. I have tried a bunch of ways and tested via remix but the statement doesn't seem to work regardless.
Any idea of what I am doing wrong? Cheers
Sample function
function transfer(address recipient, uint256 amount) public override returns(bool) {
if(ExcludedFromFee[msg.sender] == true || isPresale) {
_transfer(_msgSender(), recipient, amount);
}
else if(TotalSupply >= _minimunSupply) {
uint burntAmount = amount.mul(Burn_Fee) / basePercent;
uint ownerAmount = amount.mul(Dev_Fee)/ basePercent;
_burn(_msgSender(), burntAmount);
_transfer(_msgSender(), owner(), ownerAmount);
_transfer(_msgSender(), recipient, amount.sub(burntAmount).sub(ownerAmount));
}
else if(TotalSupply <= _minimunSupply) {
uint burntAmount = 0;
uint ownerAmount = 0;
_transfer(_msgSender(), recipient, amount.sub(burntAmount).sub(ownerAmount));
}
return true;
}