We're working on a BEP20 token and given the current market, we'd like to use a BUSD LP.
The only problem is that the reflections and other functions aren't compatible.
Transactions go through successfully, but the reflections and other functions aren't executed / distributed.
Some places I think might help:
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
Might changing WETH to something else help?
Or maybe here:
IUniswapV2Router02 pancakeswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
_pancakeswapV2LiquidityPair = IUniswapV2Factory(pancakeswapV2Router.factory())
.createPair(address(this), pancakeswapV2Router.WETH());
_pancakeswapV2Router = pancakeswapV2Router;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private {
// Approve token transfer to cover all possible scenarios
_approve(address(this), address(_pancakeswapV2Router), tokenAmount);
// Adds the liquidity and gives the LP tokens to the owner of this contract
// The LP tokens need to be manually locked
_pancakeswapV2Router.addLiquidityETH{value: bnbAmount}(
address(this),
tokenAmount,
0, // Take any amount of tokens (ratio varies)
0, // Take any amount of BNB (ratio varies)
owner(),
block.timestamp.add(300)
);
}
Thank you in advance for any help!