Good morning ! I'm trying to create a BEP-20 token. I need to program the testnet router of Pancakeswap. Impossible. Can you help me ? All advice is good to take, thanks.
(I'm working on pragma solidity ^0.8.2)
//
constructor () public {
function setRouterAddress(0x9a489505a00cE272eAa5e07Dba6491314CaE3796);
//Thank you FreezyEx
IPancakeRouter02 _newPancakeRouter = IPancakeRouter02(0x9a489505a00cE272eAa5e07Dba6491314CaE3796);
PancakePair = IPancakeFactory(_newPancakeRouter.factory()).createPair(address(this), _newPancakeRouter.WETH());
PancakeRouter = _newPancakeRouter;
// 0x10ED43C718714eb63d5aA57B78B54704E256024E
// Create a Pancake pair for this new token
pancakePair = IPancakeFactory(_pancakeRouter.factory())
.createPair(address(this), _pancakeRouter.WETH());
// set the rest of the contract variables
pancakeRouter = _pancakeRouter;
}
constructor(address _factory, address _WETH) public {
factory = _factory = 0x6725F303b657a9451d8BA641348b6761A6CC7a17;
WETH = _WETH = 0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd;
}
receive() external payable {
assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract
}