我们正在开发 BEP20 代币,鉴于当前市场,我们希望使用 BUSD LP。
唯一的问题是反射和其他功能不兼容。
事务成功通过,但反射和其他功能未执行/分发。
我认为一些地方可能会有所帮助:
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
将 WETH 更改为其他内容可能会有所帮助吗?
或者也许在这里:
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)
);
}
预先感谢您的任何帮助!