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.